On this page

0002. Write the bootstrap compiler in Rust

Context

The compiler must exist before Harness can compile itself. It will be written mostly by AI agents and read by people. It emits C, so the host language decides the compiler's own speed, correctness and distribution, not the speed of Harness programs.

Decision

Rust on the stable channel, edition 2024, no unsafe, few dependencies, one Cargo workspace. The compiler ships as one static binary, harness.

Alternatives considered

Consequences

Enums and pattern matching fit ASTs and IRs. cargo test runs every test, including golden programs and the C runtime's tests. CI needs only rustup and a C compiler. Self-hosting is a separate decision at M16.5, made on measured compile speed.