Drake questioned why each generation of tools inherits the mistakes of its predecessors. The solution: grow a toolchain from a few hundred hand-written bytes, using the C compiler and GNU tools only as a referee that checks answers, never as a builder.

Bootstrapping from 408 Bytes

The seed starts as 408 bytes of hand-written machine code. The first seed0.bin was created by a 24-line shell script using only the shell's own printf. After that initial build, seed-0 rebuilds itself. The current completeness audit tracks implemented areas, open compiler work, and what remains blocked on decisions or external stores.

At the first commit, the compiler source omc/omc.om was 12,040 lines and 208,168 bytes. To rebuild omc from the 408-byte seed on your own AArch64 Linux machine and check every rung against published hashes, run sh seed/challenge/run.sh.

A Ladder of Rungs

Each rung is a small program written in the language the rung below understands, built by the rung below. Every rung must rebuild itself to the exact same bytes, proving it reads its own language the same way the rung below does.

  • Rung 0: seed0.hex — 102 lines of 8 hex digits (30 lines for the Linux file header, 72 machine instructions each named with its Arm Architecture Reference Manual section). seed0.bin is the 408-byte program that reads text, turns every 8 hex digits into one 32-bit word, and writes the words out, skipping comments and spaces.
  • Rung 1: hex1.hex — 164 instructions plus a 30-word header, built by seed-0. Adds labels (:c marks a spot, @c after a branch fills in jump distance). Cross-checks verify jump distances agree between manual counting and hex1's arithmetic.
  • Rung 2: table.s2 — the instruction table, plain text with one line per instruction. asm2.hex1 — the assembler, 580 instructions built by hex1. Reads the table and a program with labels (up to 16 characters), writing machine words. Mistakes stop with the line number.
  • Rung 3: om3.s — translator from Omegese to machine words, 1,486 instructions built by asm2. Supports the 10 public practice tasks: all nine number types, if/else, while with a limit, for, return, and add/subtract/multiply/divide/remainder/or/xor/shifts/comparisons/negate/not/type conversions, each with error stops matching the C path.
  • Rung 4: om4.s — om3 grown into a translator that can build real programs, about 4,000 lines in asm2's language. Adds function definitions, whole program mode, fixed global pools, local arrays with checked indexes, text with stored length, read/write/exit Linux calls, and signed divide/remainder/shift/true/false/for with computed count/note lines.

Design Principles

Several rules from the B-to-C lessons govern what om4 accepts or refuses:

  • No terminator bytes — arrays and texts know their length
  • No pointers — only array indexing with checked bounds
  • No hidden sharing — same array cannot be passed twice in one call
  • No undefined behaviour — unsigned numbers wrap, signed numbers trap on overflow, division by zero traps, bad indexes trap
  • No automatic conversions — mixing types in one operation is refused
  • Capacities — input past capacity refused with error 14, never overrun

Unlike omc's run-time growing tables, om4 keeps fixed tables. The seed chain uses 164 words versus 600 for the C path on the 10 practice tasks — a 27% difference primarily from the C path's design of storing every value to memory and back.

Verification

Each rung rebuilds to byte-identical output. Audits use objdump as the referee: zero disagreements between om3/om4 source and objdump disassembly. Five planted mistakes in each source are caught. Broken or out-of-subset programs receive their own error numbers. Forty-one broken or forbidden programs are refused, including a value nested 1,024 deep (om4 now stops where it used to crash).

A copy of om4 with signed divide made unsigned produces different results, so checks would notice such a slip. Four whole programs match committed expected outputs (recursive Fibonacci, sorting 1,000 numbers, echo of 50,000 fixture bytes, byte copy that reverses input). Fourteen whole programs stop with the given status or value (including 2^64-1 and 2^63 read as ulong). Machine word counts show the seed chain consistently uses fewer words than the C path on every task.