On this page

0011. The walking skeleton compiles the AST straight to C

Context

The first goal is a working language as early as possible. The review asks for a typed IR from the start, but there are no types until M2.

Decision

M1 emits C directly from the AST. Every value is an int64_t, and string literals appear only as arguments to print and println. M3.3 replaces this path with typed AST → Core IR → C and deletes the direct path. Tag cp/1.2-fib keeps the direct version reachable for comparison.

Alternatives considered

Consequences

Some M1 code generation is thrown away in M3. The golden tests written in M1 keep their value: they guard the replacement.