Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

While the Futamura Projection is undoubtedly very powerful, it's worth being aware that some of its properties are significantly oversold; in practice, useful partial evaluation has a lot of the same kinds of decisions and trade-offs as optimising compilers and being Jones-Optimal isn't the same as being fast.

As an example, imagine a simple case of a program that outputs N verses of the "bottles of beer on the wall" song. A naive partial evaluator given an N will produce the whole output (potentially multi-gigabyte) string during partial evaluation, even if loading and printing that whole string may be slower than just running the original code.

Look at Pypy and GraalVM for partial evaluation in practice; none of it is free and there's a lot of engineering and tweaking involved, not to mention how it can affect debugging.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: