CHRIS HAY

IDEAS · SYSTEMS · OBJECTS / LONDON · 2026

A compiler from 1951 ran. It needed four corrections.

A language, a machine and a compiler that existed on paper, a coding agent, and three ways of being wrong that had to agree.

ABOUT THIS NOTE +

A note about running the compiler in Corrado Böhm’s 1951 dissertation, which is written in the language it compiles, for a machine that was only ever a design. A coding agent built the machine, typed in the compiler from the 1954 printing, and wrote two independent readings to check it against. As printed, the compiler does not work. With three corrections, one of them reported by Knuth and Trabb Pardo in 1976, and a fourth change that is needed only because of how this reconstruction compiles the compiler’s own formulas, it compiles itself. The language, the machine and the compiler run in the browser.

N-BOHMOPENRECORDED 2026-11-22PUBLISHED · V1.1CITE ↓FOLLOW ↓

01 / A COMPILER ON PAPER

In 1951 Corrado Böhm submitted a doctoral dissertation at ETH Zürich. It describes a computer, a language for it in which every statement is an assignment, and a compiler written in that language. Knuth and Trabb Pardo call it “the first compiler in its own language”. The computer was a design, and the compiler stayed on the page. I asked a coding agent to build the machine and run it.

Böhm, Calculatrices digitales, 1954 printing ↗

02 / THREE READINGS

A compiler typed in by an agent, running on a machine the same agent built, proves nothing by itself: if they are wrong in the same way, they agree. So there are three readings of every program. One works out each formula as written, as algebra, with no machine. One is a second compiler, written from the prose of the thesis and not from Böhm’s code. The third is Böhm’s compiler, as instruction numbers on the simulated machine. They have to agree number for number.

03 / AS PRINTED

They did not. For the simplest program there is, the compiler as printed writes four numbers and none of them is an instruction. The group that encodes a plain copy adds up the two addresses and leaves out the operation code. An earlier section of the thesis encodes the same formula with the code in it.

04 / TWO BRANCHES AT ONCE

There is no “if” in this language. A program chooses by multiplying each destination by 0 or 1 and adding, so exactly one multiplier may be 1. In group C of the compiler two of them are 1 for every symbol that is not a parenthesis, and the compiler continues at the sum of two groups. This one the agent did not see coming. It showed up in a trace of the first run.

05 / KNUTH’S PAGE

The third was already known. In 1976 Knuth and Trabb Pardo wrote: “It appears to be necessary to add one more statement in order to fix a bug in his program, caused by overlaying information when a left parenthesis follows an operator symbol”. They did not print the fix, so the one here is ours. They did work one formula through by hand, and with the fix in, the compiler’s six instructions for that formula match their page line for line. That page is the only check in this note that did not come from the agent.

Knuth and Trabb Pardo, 1976, pp. 39–41 ↗

06 / THE FOURTH NEEDS A MACHINE

With three corrections the compiler works when its own formulas are read as algebra. On the machine it stops after one number. Böhm’s method computes every product in a variable called X, and the compiler keeps its place among the parentheses in a variable it also calls X. Once the compiler has itself been turned into instructions, its own code overwrites its own bookmark. The thesis names the two letters its method uses. It does not say a program must avoid them. This fourth change is of a different kind from the other three: an independent review later found that writing the compiler’s formulas fully bracketed, which the thesis also allows, avoids the clash without renaming anything.

07 / IT COMPILES ITSELF

With its X renamed, the compiler gets through its own text. Read as algebra over its own source it writes 401 instruction numbers. Those numbers, run on the machine over the same source, write the compiler again, and that copy does the same. The third copy is identical to the first, and all of them are identical to what the second compiler writes.

The language, the machine and the compiler run in the browser. You can write a program, see the instructions Böhm’s compiler makes of it, run the compiler as printed, and have it compile itself.

WHAT THIS DOES NOT SHOW

  • This may not be the first time the compiler has run. Peter Sestoft’s 2016 translation says he implemented it in Java. I could not find that code and do not know which corrections it needed.
  • Of the three slips, one was reported in 1976. I have not found the other two written down, but I read two sources, not the literature. The fourth change, renaming X, depends on how this reconstruction compiles the compiler’s formulas.
  • All three readings were written by the same agent in one session. They are three routes, not three authors. A second model, OpenAI’s Codex, later reviewed the repository independently and found that the algebra and the machine read input in different orders inside brackets; they now agree. Its review, and what was done about each point, is in the repository.
  • The compiler was typed in from a scan. For the two formulas that were not known to be wrong, the French printing and the English translation agree. Two arrows the printing leaves out of group J′ are supplied, the loader’s printed constant 94999010000 is read as Sestoft’s 9490010000, and a repeated label in Böhm’s second Euclid program is corrected; each is now listed as a slip in the repository.
  • The corrections are a reading of what Böhm meant. He is not here to ask.

Agreement between things one author wrote is evidence of consistency. The page somebody else worked by hand is evidence of correctness.

OPEN

If a program has only ever existed on paper, how would you know it was right?

Having an agent produce a compiler was the cheap part. The work was arranging three ways to be wrong and making them agree, and even then the one outside check was a single hand-worked formula from 1976. Knuth and Trabb Pardo’s own test program in Böhm’s language is correct as algebra and prints nothing on the machine, because it uses the letters S and X.

PUBLICATION HISTORY

Each version preserves its manuscript, claims and source references. Research status is recorded separately from publication.

  1. V1.0 · 2026-11-22 ↗

    First publication: Böhm's 1951 compiler run on a simulation of his machine, the four corrections it needed, the one outside check, and the limits of three readings by one author OPEN

    MANUSCRIPT JSON ↗ · BIBTEX ↗ · CSL JSON ↗

  2. V1.1 · 2026-11-22 ↗

    Of the four corrections, three are slips; the fourth, renaming X, is needed only because of how this reconstruction compiles the compiler's own formulas. Two arrows supplied in group J', the loader's constant and a repeated label in the second Euclid program are now disclosed, and an independent review by a second model is described. OPEN

    MANUSCRIPT JSON ↗ · BIBTEX ↗ · CSL JSON ↗

MACHINE-READABLE HISTORY ↗

SOURCES & PROVENANCE

AUTHOR / Chris Hay · VERSION / 1.1

PUBLISHED 22 NOV 2026 · REVISED 22 NOV 2026 · VERSION 1.1

CITE

CITE THIS

Research note · 1.1

Hay, C. (2026). A compiler from 1951 ran. It needed four corrections. (Version 1.1). Chris Hay. https://chrishayuk.com/records/N-BOHM/1.1