Skip to content

Compiler Internals

Cerune generates intermediate representations from source code and provides multiple execution and code-generation paths. This page summarizes their roles.

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

See Cerune IR (HIR) for resolved types and names, NodeId and source origins, direct IR execution, and MIR lowering.

Run these commands from the Cerune repository root:

ターミナルウィンドウ
cerune emit-ir examples/hello.ceru
cerune emit-mir examples/hello.ceru
cerune run-vm examples/hello.ceru

The 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.