Skip to main content

compile_to_c_via_bytecode

Function compile_to_c_via_bytecode 

Source
pub fn compile_to_c_via_bytecode(source: &str) -> Result<String, ParseError>
Expand description

★ Phase 1 — compile to C by lowering the bytecode CompiledProgram directly (the codegen_c::from_program Op-walker), the bytecode-IR-as-source-of-truth path that REPLACES the AST-based compile_to_c. It lowers the OPTIMIZED IR (compile_to_program_optimized) — the SAME optimize_program the AST compile_to_c runs, honoring the LOGOS source’s ## No/## Require opt decorators — so the whole AOT optimizer lattice (constant-fold, SCCP, egraph, LICM, deforest, supercompile, closed-form, bound_version) reaches the C. One pristine, optimal pipeline: source → (opt flags honored) optimized bytecode → Op-walker → C. Grown op-by-op behind c_bytecode_lock; returns a typed Err on any op not yet lowered (callers fall back to the AST emitter until the Op-walker covers the corpus).