News for hackers. Stuff that matters.
Re:Multi-Stage Programming with Splice Variables by naasking on Saturday June 28, 2025 @11:28AM (#44405380)
Optimization is absolutely one of them, once you start dealing with higher order programs or programs with sophisticated control flow. Compiler optimizations are not enough to infer the Futamura projections in all cases, for instance.

https://okmij.org/ftp/tagless-final/index.html#tagless-final

Re:Multi-Stage Programming with Splice Variables by gsliepen on Sunday June 29, 2025 @05:43AM (#44411668)
Interesting, I never heard of Futamura projections before. Looking at the definition, it seems like the first projection (specializing an interpreter for given source code) is already handled pretty well by today's compilers, just by unrolling and inlining. And they can go even further and evaluate parts at compile time, see for example https://github.com/IoanThomas/constexpr-chip8. I can see how the second and third projections are not handled by compiler optimizations though.