This has many applications but one of the most basic is it *makes languages lightweight* i.e. brings down the cost of implementing a correct compiler for your language.
Conversation
They see "real world" use in projects like PyPy and GraalVM.
1
1
Blog post on Futamura projections in Graal:
blog.plan99.net/graal-truffle-
1
1
5
wrote a fantastic blog post (with pictures!) on this topic: "The Three Projections of Doctor Futamura"
blog.sigfpe.com/2009/05/three-
1
2
5
This is so cool, can't believe I hadn't heard of it. Sounds like something Lisps would excel at
1
1
They do! e.g. there seem to be quite a few Scheme partial evaluators (I'm no expert)
1
Partial evaluators for typed languages seem rarer. Duncan Coutts mentions citeseerx.ist.psu.edu/viewdoc/downlo (pdf) issues with reencoding types. The cogen approach offers a viable alternative.
1
1
But see also Scala's Lightweight Modular Staging.
1
Finally it's worth noting that the typed tagless approach was originally developed as a way to encode partial evaluation in typed languages: the first paper was "Finally Tagless, Partially Evaluated: Tagless Staged Interpreters for Simpler Typed Languages"
2
1
5
This is all fabulous, thanks mate!
1
1
Idris 1 has some interesting stuff to do with partial evaluation - I'm unsure how these experiments went though: docs.idris-lang.org/en/latest/refe
Thanks, this is awesome. I had completely forgotten about this
1
Yeah, it's super interesting! I really want to see something like this explored more in the future, perhaps treating 'phase' as a partial order on types. Conor Mc Bride has mentioned this quite a few times. Seems like a nicer approach to C++, D, and Rust's const expressions.
1
1
Show replies


