14.4 Codegen and IR
beskid_codegen lowering to CodegenArtifact and Cranelift IR.
Codegen and IR
Lowering is where typed programs become machine-oriented artifacts the engine can JIT or AOT.
beskid_codegen::lower_source / lower_program — see Build pipeline overview and Backends JIT/AOT.
Responsibilities
Section titled “Responsibilities”| Output | Consumer |
|---|---|
CodegenArtifact | beskid_engine (JIT), beskid_aot (object/link) |
| ABI metadata | beskid_abi tables consumed by runtime |
Mod interaction
Section titled “Mod interaction”Typed emitter/transform contracts: Typed emitter and transforms. Lowering runs after merged typed AST is valid.
Fibers and builtins
Section titled “Fibers and builtins”Spawn lowers to fiber_spawn; builtins align with Builtins and symbols—codegen must not invent alternate calling conventions.