14.4 Codegen and IR
TypedProgram to CodegenInput, ISLE emission, and Cranelift IR.
Codegen and IR
Code generation converts typed syntax facts into machine-oriented artifacts for AOT commands and the separate JIT test and REPL paths.
The production boundary is TypedProgram → CodegenInput → ISLE emission → CodegenArtifact. 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.