Compiler and Toolchain
This section describes how the Cesium compiler is put together: its backends, how it bootstraps, the semantic IR every frontend lowers to, and the small language subset the first compiler stage accepts.
Info: Status
These pages summarize decision records kept as issues in cesiumlang/cesium. Stage 0 (cesium0) and cesium1, a compiler for S0 written in S0, are implemented and tested in CI on Linux, macOS and Windows with the QBE backend; the rest is a plan. Where a page and its decision record disagree, the decision record wins.
Pages
- Architecture - Two backends behind a semantic IR, the toolchain, the runtime model and the target platforms
- Bootstrap Chain - Stage 0 in portable C,
cesium1in S0, then the real compiler; what CI builds and what contributors download - Semantic IR (SIR) - The core level of the IR that every frontend lowers to
- The S0 Subset - The tiny subset of Cesium that stage 0 compiles
- Stage 0 C Dialect - The portable C subset stage 0 is written in
- Freestanding Targets - What bare-metal targets require of the language, library and compiler
- Diagnostics - The error codes of
cesium0andcesium1, each with what it means and how to fix it
Decision Records
| Record | Subject |
|---|---|
| cesiumlang/cesium#4 | ADR 0001: compiler backend, LLVM packaging and toolchain |
| cesiumlang/cesium#5 | ADR 0002: bootstrap strategy and hosting the compiler |
| cesiumlang/cesium#6 | ADR 0003: freestanding targets |
| cesiumlang/cesium#7 | ADR 0004: two backends, QBE first and LLVM as the primary release backend |
| cesiumlang/cesium#8 | Design: Cesium semantic IR (SIR) |
| cesiumlang/cesium#9 | Design: stage 0 and the S0 subset |
| cesiumlang/cesium#10 | Design: stage 0 C dialect |
| cesiumlang/cesium#11 | Design: ownership, borrowing and lifetimes |
Requirements carried over from the removed C++ prototype (documentation generator, command-line interface, logging) are in cesiumlang/cesium#64.
See also the language specification draft and the language reference.