Written in Python, Part 3: The Languages That Lost
The standard AI textbook moved its code off Lisp. The reason is written down. It was not about Lisp. Twenty years later a language solved the problem Python never solved, and lost anyway.
A series on how one language shaped artificial intelligence, and how intelligence is now reshaping it.
The Fossil at Berkeley
There is a directory on a Berkeley web server, last modified in January 2001, containing a partial Java translation of the Lisp code from Artificial Intelligence: A Modern Approach. The accompanying note explains that the work is in progress and that so far only the unify function has been translated.
That directory is where a language transition died, and it is worth knowing what it was trying to do.
Artificial Intelligence: A Modern Approach, by Stuart Russell and Peter Norvig, is the textbook. It has been the textbook for three decades, taught in more courses in more countries than any competitor, and its code repository is how a great many people first encountered a working implementation of a search algorithm or a Bayesian network. Norvig wrote that code in Common Lisp.
He was the right person to. Three years before the textbook’s first edition, Norvig published Paradigms of Artificial Intelligence Programming, a book that teaches AI by building systems in Common Lisp and which remains, decades later, one of the most admired programming books ever written. If Lisp had a case to make in artificial intelligence, Norvig was the person making it, at book length, twice.
So the interesting question is why he went looking for a way out, and the answer is unusually well documented, because he wrote it down.
Instructors and students wanted Java. Norvig listed their reasons. Java was what they already knew from other courses. They wanted graphical applications. A minority wanted applets that ran in browsers. And some of them simply could not get comfortable with Lisp syntax in the number of class hours available to spend on it.
Read that list again and notice what is absent. Not one item concerns whether Lisp is a good language for artificial intelligence. Not one concerns expressiveness, or performance, or fit to the domain. The list is entirely about what people had already learned, what they already had, and how much time they had to spare. The pressure to leave Lisp came from outside Lisp.
The Java attempt then failed on its own terms. Java was too verbose, and the distance between the book’s pseudocode and the Java implementing it was too large. A textbook’s code has an unusual constraint that production code does not: it has to look like the thing the book is explaining, or it teaches the reader nothing. Java could not meet it. The translation stalled after one function, and the evidence is still sitting on that server.
What Norvig did next is the part this instalment is about. He did not go back to Lisp, which had lost nothing in the meantime and remained the better fit. He went looking for a different language that could satisfy the constraint Java had failed, and he found Python, which he judged the closest available thing to the pseudocode in his own book. Jython meant he could still target the Java virtual machine if he needed to.
He noted, drily, that Python does not satisfy “the prerequisite of being spelled J-A-V-A”, but that Jython was close enough.
That joke contains the whole argument. The requirement was never technical. It was a spelling requirement, which is to say a requirement about what was already installed in people’s heads and on their machines. Norvig satisfied it sideways.



