Conversation

Mind is getting blown by multi-stage programming! Does anyone know of any simple examples of it being used as a way of doing offline partial evaluation in compilation? Most of the stuff I see is for run-time code generation. 🤔
3
4
"MetaOCaml is not very suitable for writing offline generators because of CSP [Cross-Stage Persistence]. Our type system introduces residualizable code types to solve the problem."
1
Replying to
There is a difference between partial evaluation and supercompilation but I always forget what it is. There was a bunch of supercompilation-related work on GHC a few years back but I assume you're already familiar with that as well. :)
1
1
So the issue is that if you're generating code and the generated code references an arbitrary object on the heap of the code-generator, either (a) the generated code must run in the address space of the generator or (b) you need to know how to serialize that object into syntax.
1
1
Show replies