Source → Compiler Pipeline
One program, twelve representations. Everything below is produced by the AtlasLang compiler in this repository — the tokens are the lexer's output, the SSA is the SSA converter's output, the assembly is the code generator's output for the allocation the register allocator actually chose.
AtlasLang is a real, complete compiler — lexer, Pratt parser, type checker, SSA construction over dominance frontiers, an optimizer with legality preconditions, a graph-colouring register allocator and a stack VM — and nothing on this page is a fixture. It is also small: no floats, no heap, no wrapping integer overflow, and an x86-64 backend that is illustrative rather than assemblable. Where a panel simplifies, it says so.
A sequence of characters.
Nothing yet — this is the input.
—
fn add(a: int, b: int): int {
return a + b;
}
let x = 1 + 2 * 3;
let n = 0;
while (n < 3) {
if (n == 1) { x = x + 10; } else { x = x + 1; }
n = n + 1;
}
print(add(x, n));
Where to go next
The same program, with one thing changed.
Turn individual passes on and off and watch the cascade — and the two that refuse to fire.
Reduce the register count until the allocator has to spill, and see which value it picks and why.
Run the bytecode one instruction at a time, watching the operand stack and the locals.