simplified

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.

simplifiedAtlasLang, not a production compiler

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.

AtlasLang source
Examples
Function shown in the IR panels
No diagnostics. The program lexes, parses and type-checks.
What the program is here

A sequence of characters.

What this stage answers

Nothing yet — this is the input.

What it can no longer tell you

178 characters
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.