Thursday, August 16, 2007

The original, original Adventure!

i am just barely old enough to be familiar with the original ADVENTURE.

the source code to the ORIGINAL version has been found! not the Don Woods enhanced version, which looms large in hacker lore and whose source can be found here and which was the basis of early text-based adventures like Zork on the Apple II, but the earlier version (1975-76) that Will Crowther wrote based on the real-life Colossal Cave in kentucky. There’s a corresponding scholarly article in a humanities journal (possibly it has moved here) about the source code.

The source code was found in an archived copy of Crowther’s account at stanford AI lab about a year ago.

It is neat to peruse. it’s in Fortran IV, the total source code is 13K with an additional 19K file of text data (game messages, numbers describing the connectivity graph of the areas in the game, etc.) I couldn’t get it to compile using g77, i assume because of syntactic differences between Fortran 77 and Fortran IV.

It’s our heritage as hackers! I think of it as the equivalent of trying to read Chaucer in the original (which, by the way, is another fascinating exercise i recommend if you haven’t tried it).

UPDATE: Someone has ported the code to compile under g77!

Wednesday, August 15, 2007

Computing history comes alive

So I’ve been reading more about the history of early computers– particularly interesting is The First Computers: History and Architecture (ed. Rojas) because it’s written for a technical audience and describes the hardware/software architecture of early machines (including the Mark I, ENIAC, EDSAC, etc.), early work in what we would now call theoretical CS, etc.
It’s fascinating to read about the architecture of ENIAC, which (from our modern perspective, with an understanding of instruction sets, compilers, and microarchitecture) looks like an incredible collection of hacks. “Programming” it is a tour de force. But truly revealing is reading about the operation of its special-purpose multiply, divide and square-root units, which basically had to inherit techniques of doing those operations such as those that human computers would have been able to do using simple mechanical adding machines. In particular, the square root algorithm is based on the fact that for an integer a, a^2 = sum_{i=1}^{a}(2i-1), playing various tricks with this to hone in on the square root of a fixed-point number.
Which leads me to my other thought…Notwithstanding its name, and unsurprisingly for its time, BASIC is really a language for expressing simple numerical algorithms first, and “general purpose” stuff second. (From the perspective of 1964, what did “general purpose” mean besides “slinging strings”?) At the same time, I recall David Brin’s Salon article bemoaning the loss of simple built-in languages for PC’s that kids could use to start learning how to think about computing.
So here’s my proposal for a homework in a computer history type of class, which would be Good For Today’s Youngsters(tm): research the algorithms used by human computers (and therefore, by the first mechanical and electronic computers) to do numerical tasks like square root, and implement them in an “early high-level” language like BASIC or Fortran. No namby-pamby objects here, no managed memory, none of that crap. If assembly language is like programming on bare metal, then BASIC and Fortran programming are like welding the metal with only cheap goggles and no gloves–it builds character, and would provide a “what must it have been like” insight besides.