Skip to content

Parity — byte-for-byte, from scratch

The goal is blunt: a from-scratch reimplementation of the entire Nim / Nimony toolchain whose output is byte-for-byte identical to the originals — the same parse tree, the same typed IR, the same generated code, down to the byte. Not a fork, not a wrapper around Araq's binaries: each stage is rewritten and then held to the real compiler's exact output by a differential harness.

We are not all the way there yet — and that's the point of this page. It's the honest scoreboard.

Why byte-for-byte

Anyone can write a compiler that's "close." Byte-for-byte is a different bar: it means every naming decision, every emission order, every whitespace convention, every line-info offset matches the reference exactly. It's a brutal, unambiguous oracle — the diff is either empty or it isn't. Hitting it proves the reimplementation didn't just approximate Nim/Nimony's behaviour; it reproduced it. That's what makes each stage a genuine drop-in beside nimony's own.

Where each stage stands

Stageoursvs.from scratchbyte parity
parseaowlparserniflerbyte-exact on the whole compiler tree (184/184); 91–283 files byte-exact on the stdlib, 100% structural everywhere
semcheckaowlsemnimsemconstruct-by-construct; the 166-module corpus is diff-green, the byte-level diff is closing
loweraowlhexerhexercurrently runs Araq's own 25 passes, so its .c.aif is identical by construction; a from-scratch rewrite is the target
C codegenaowlclengcend-to-end correct today (runs, ASan-clean); text byte-parity with lengc is the active push
interpret / VMaowli(new)two independent engines, byte-identical to each other, held honest against native nimony execution
emit → TS / Py / JS / WASMaowlts · aowlpy · aowljs · aowlweb(nimony backends)idiomatic, readable output; behaviour-verified against native, run-for-run

✅ = written from scratch · ⏳ = reuses the reference implementation for now

The parser — proof the bar is reachable

The front of the pipeline is already there. aowlparser is diff-tested against native niflerstructural = token trees equal with line-info stripped; byte-exact = identical .p.aif including every line-info offset.

corpusfilesstructuralbyte-exact
nimony/src (the compiler itself)184184184
nimony/lib (stdlib)10510591
upstream Nim/lib310310283
curated172172156

0 crashes, 0 hangs across all four. The remaining byte gaps are catalogued, not mysterious — see Parity & gaps.

How we measure

Every claim here comes from a differential harness, not a vibe: run the input through both the reference tool and ours, normalize nothing that matters, and diff the bytes. A green diff is the only thing that counts as "done" for a construct; everything else is a punch-list item. That's how the parser got to byte-exact, and it's how each remaining stage closes the gap.

aoughwl — self-hosted platform for things n stuff. Contact / Support on Discord for access to the private backends.