Blog post on Futamura projections in Graal:
blog.plan99.net/graal-truffle-
Conversation
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
1
1
3
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.
Davies and Pfenning "A modal analysis of staged computation" develops a modal type theory for partial evaluation (allowing multiple stages) that might be exactly what you want.
1
1
Oooh, cool. Will check it out. I've been following along with and 's Context Constrained computation, and and 's Granule+coeffect stuff in the hope that there's something there that could be useful for this.
1
3
Show replies


