pub fn projection1_source(
_core_types: &str,
_interpreter: &str,
program: &str,
) -> Result<String, String>Expand description
First Futamura Projection: PE(interpreter, program) = compiled_program
Specializes the interpreter with respect to a fixed program, producing a compiled version with no interpretive overhead. For a self-interpreter (where source and target language are the same), this produces the program itself, with static optimizations applied.
The pipeline:
- Parse the program source
- Run the optimizer (fold, propagate, PE, DCE)
- Decompile the optimized AST back to source
- Verify no interpretive overhead remains