Skip to main content

projection1_source

Function projection1_source 

Source
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:

  1. Parse the program source
  2. Run the optimizer (fold, propagate, PE, DCE)
  3. Decompile the optimized AST back to source
  4. Verify no interpretive overhead remains