Compiler Internals
Cerune generates intermediate representations from source code and provides multiple execution and code-generation paths. This page summarizes their roles.
Representations and execution paths
Section titled “Representations and execution paths”| Item | Description |
|---|---|
| Cerune IR | A shared intermediate representation with resolved types and references |
| MIR | An intermediate representation with explicit control flow and operations |
| SSA | A path that converts MIR into SSA form |
| VM | Execution through Cerune bytecode |
| Code generation | C, LLVM IR, QBE IR, WAT, native assembly, and object files |
Cerune IR (HIR)
Section titled “Cerune IR (HIR)”See Cerune IR (HIR) for resolved types and names, NodeId and source origins, direct IR execution, and MIR lowering.
CLI examples
Section titled “CLI examples”Run these commands from the Cerune repository root:
cerune emit-ir examples/hello.cerucerune emit-mir examples/hello.cerucerune run-vm examples/hello.ceruThe observe command saves source information, intermediate representations, and source-to-output mappings from a single compilation. It requires an explicit --target and a new output directory specified by -o. See the CLI reference for details.