LockerGnomeFor serious tech professionals with a silly side.
Subscribe

Search

Retroai-historylispsoftware-preservationclaude-code

Jeff Shrager, Kent Pitman and Claude Code Got Herbert Simon's 1961 Heuristic Compiler Running Again, and It Prints the Code From His 1963 Paper

Working from a 94-page line-printer listing found in Simon's archive, the team rebuilt the program on a modern Lisp, matched its published output, and did the same for Richard Waters's 1984 KBEmacs.

The listing is headed HEURISTIC CODER 7/16/61. It’s 94 line-printer pages, about 4,470 punched cards’ worth of code, and it sat in the Herbert A. Simon Papers at Carnegie Mellon University until someone tried to run it.

Now it runs. Ask it to write a routine and it prints J13 J52 11W2 11W0 J10 11W1 J65 J32 0, which the team says is “exactly matching the code in the 1963 paper.”

Chris kneels in an excavation trench, brushing dirt off a long fanfold computer printout as a small old terminal beside him lights up with the same pattern.
Illustration: LockerGnome

The authors call the field executable archaeology, “the study of historical computational systems by running their original code, a process we call ‘reanimation.’” The same approach has already brought back the Logic Theorist and ELIZA.

The Heuristic Compiler was written in IPL-V, a list-processing language older than Lisp. Golec scanned the listing. A RAND report, RM-3588, filled in two missing pieces: “a start card, and the routine U126.” Shrager wrote the interpreter on SBCL, a modern Common Lisp. Claude Code then “extended the interpreter with eleven primitives (J-functions)” the old program needed.

The checks are the interesting part. A second test, SET SIGNAL MINUS, produced 10J3 20H5 0, but only after “removing J3’s functional description.” The cards for J3 “are numbered as though they were later additions,” which suggests someone patched the program after the paper was written. Another clue came free: “a print statement apparently left in routine U113 fortuitously reveals the intermediate stages” of the compiler’s reasoning, a debugging line from 1961 that still does its job.

KBEmacs was the bigger job. It survived as “a January 1985 printout comprised of four bound volumes of Zetalisp code, preserved by Kent Pitman.” Zetalisp ran on Lisp Machines, so Claude Code “developed the Zetalisp compatibility layer” to make it run on SBCL. The result: “All fourteen commands are parsed correctly and the generated programs are equal (in the Lisp sense) to the 1984 generated code,” and (mysqrt 2.0) returns 1.4142157.

Waters once wrote that “well over half of all the effort expended on KBEmacs went into implementing an analyzer and coder,” and that the system “has been mothballed.” It’s running again.

The paper is honest about the division of labor in another way too. Claude Code “wrote the first draft of this paper,” and the three humans are the named authors.

KBEmacs’s December 1984 self-test ran six command sequences. Three passed back then (HASH, SQRT and SUMLIST) and three failed (BUCKET, DELETE and MEMQ). So far the reanimated version reproduces only SQRT, and nobody yet knows whether the other passing runs, or the 1984 failures, will come back the same way.

More Retro

Every Retro story →