WAITS: Programming

As an operating system for a research lab, WAITS was used extensively to write programs. In this post we'll look at which languages were used, the software development environment - and investigate an early implementation of Donald Knuth's MIX system.

/images/waits/fail-manual-cover.png Cover of the FAIL manual.. Source: Bitsavers

Lisp, FAIL and SAIL

The three main programming environments used by the lab were all maintained in house.

Lisp was the main language for AI research at that time, and as the original author of Lisp, John McCarthy, was the head of SAIL it was natural it would be used here. The main version used was Lisp 1.6, an evolution of Lisp 1.5 from MIT, but there were also other dialects - MLISP, which understands m-expressions like 2+2 instead of the more traditional Lisp s-expressions (PLUS 2 2), and UCI Lisp from the University of California in Irvine, which extended Lisp 1.6 and added tools from BBN Lisp.

Although DEC's MACRO assembler for the PDP-10 was available, the main assembler used was developed at SAIL by Phil Petit and was called FAIL. This was a single pass assembler, which ran five times as fast as DEC's version, and also had more powerful macro capabilities. This was used by system programmers and researchers who needed the extra speed and flexibility of machine language.

SAIL was the lab's version of Algol 60. It added support for linking to PDP-10 assembly language, I/O facilities, extra data structures like associative arrays and a macro package. This made it a good choice for writing system utilities and general algorithmic programs. The first version of Knuth's TeX was written in SAIL.

We'll look at Lisp and SAIL further in future posts.

Other languages

The standard set of languages from DEC - AID, BASIC and Fortran - are also available on WAITS. These work much the same as on TOPS-10, so see the linked articles above for more details. Note that the Fortran version is F40 rather than the newer Fortran-10.

There are a couple of programming languages that came from other sources. A version of SNOBOL called Fasbol which originated from the PDP-10 at Berkeley can be executed with R FASBOL. Micro-planner, based on the PLANNER language, came from MIT and can be run via R PLNR.

This is as of July 1974, the date of the system image we are running. Looking at saildart.org other languages were added later on, including Pascal, Simula and C.

The development environment

Similar to the concept of 'compile class' commands in TOPS-10 is RPG, or Rapid Program Generation, on WAITS. This can save on typing - as an example, if you just created and compiled a file with

. CREATE hworld.f4
. EXEC hworld.f4

for the rest of the login session you can type commands without parameters, so EDIT would edit the file and EXEC would compile and run it. This works across the different editors and languages supported at SAIL.

As well as the DEC-supplied CREF cross-reference listing tool and DDT debugger, SAIL created a more powerful debugger called RAID.

MIX

MIX was a hypothetical machine Donald Knuth designed and used in his book The Art of Computer Programming to illustrate how an algorithm could be implemented in code without depending on a specific computer or high level language. The book defines the MIX machine and an assembly language that can target it.

An implementation of MIX for a real machine is a handy way to experiment with these algorithms, and one was developed on the SAIL machine in around 1970. The assembler is run via R MIXAL and the virtual machine via R MIX. The latter also includes facilities for debugging, such as examining the memory or tracing through instructions.

Documentation is in MIX.RES[UP,DOC] and the source code, in FAIL, is in [MIX,SYS].

I'm not completely sure who wrote this: the source code does not state an author, and the way it describes the program ("MIX is a simulator for the MIX machine described in Knuth, vol. 1.") leads me to believe it was not Donald Knuth himself. There's a comment in MIX1[MIX,SYS]

(CS236B–June 5, 1970)

which makes me think it was done as part of a course, and looking at the Stanford publication Courses and degrees. 1969-1970 page 240 indicates CS236-B was a system programming course taught by Knuth:

The first instance of the documentation MIX.RES[UP,DOC] is from 1972, and the SAIL convention of using the programmer ID who wrote the doc as its extension, so RES. This ID was used by Richard Smith, who may have been involved in the original work or took over maintenance of it later.

Further information

My posts on TOPS-10 programming are useful to compare the languages and tools between the two systems.

Questions, corrections, comments

I welcome any questions or comments, and also especially any corrections if I have got something wrong. Please email me at rupert@timereshared.com and I will add it here and update the main text.