pub fn run_genuine_p2_on_target(
program: &str,
core_types: &str,
interpreter: &str,
) -> Result<String, String>Expand description
Run genuine P2 on a specific target: PE(pe_source, pe_mini(target))
This is the real Futamura Projection 2 applied end-to-end:
- Build pe_mini applied to the target (pe_mini compiles the target)
- Encode the combined pe_mini+target as CProgram data
- Run pe_source on the encoded data (PE specializes pe_mini for this target)
- Decompile the residual to LOGOS source
- Execute the decompiled residual to get the target’s output
No decompilation of specialized functions — the PE directly produces the compiled target as CStmt data, which is decompiled to a simple LOGOS program and run.