pub fn compile_to_program_optimized(
source: &str,
) -> Result<CompiledProgram, ParseError>Expand description
★ THE FINALIZED, OPTIMIZED SOURCE-OF-TRUTH IR ★ — compile( optimize_program( resolve_divisions(AST) ) ).
This is the exact front-end compile_to_c/compile_to_rust run (prelude + ## No/## Require decorators
- division resolution + the full AOT optimizer lattice) — but it STOPS at the
CompiledPrograminstead of emitting a target. It is the one IR every backend will lower in the source-of-truth architecture, and the object the invariants pin:VM(opt P) = program_outcome(compile_to_program_optimized(P)). Today the bytecode backends (riscv/wasm/fabric) compile the RAW AST and miss this whole lattice — so this is also the primitive that lets them GAIN it. Mirrorscompile_to_c(src/compile.rs) up to the codegen step.