Whetstone Algol resurrection

Like Caesar's Gaul, Whetstone Algol (better known colloquially as Walgol) was in three parts.
  1. The translator, which converted Algol60 into pseudo-code
  2. The Usercode assembler, which processed the code-bodied procedures
  3. The controller, which executed the program by interpreting the pseudo-code
This is described in Algol 60 Implementation by Randell and Russell.

English Electric issued parts 1 and 3. Much later, part 2 was implemented at Oxford University.

We now have the Walgol Translator and the Walgol Controller re-keyed from a dog-eared listing, in the main, by Brian Wichmann, Graham Toal and Roderick McLeod. David Holdsworth has written an assembler and a rough-and-ready emulator. Bill Findlay has implemented a properly-enginered emulator.

All the software is available for download, see the hot links in instructions below. To download, do a right mouse click on the appropriate link.

Instructions for running KDF9 Algol programs

If you download the Findlay emulator system, you will find all that you need for running Algol60 programs using KDF9's Whetstone Algol.

Error reports form Walgol are in the form a numbers that have to be looked up in a manual. For those who do not possess such a manual, the numbered errors reports from the Whetstone Algol translator are listed here, and from the Whetstone Algol controller here.

If you have difficulty running Bill's Ada emulator, you might like to try DH's rough-and-ready emulator which is written in C. Ptherwise, you can skipt down to the next heading.

To run the Walgol system you need the binary programs of both the translator (walgolt.bin) and the controller (walgolc.bin), and also the paper tape data file (ptr.txt). You also need a KDF9 — or an emulator. There is a proof-of-concept emulator (kdf9emul.c) that you can down load and compile. It is a simple command line program, and will run Walgol if you type
                kdf9emul walgolt.bin
                                generating messy diagnostic output on the console, and writing the lineprinter output to a file called punch.txt (please don’t ask).

There are two pre-compiled binary versions (but the source text has had some bugs removed since) of kdf9emul:
            kdf9emul-ms.exe compiled using Microsoft’s Visual Studio 2008, which insists on running under a fairly modern version of Windows
                        (MD5 digest=0cf302bec1fccfe8a708a985a43a83e2)
            kdf9emul-gc.exe compiled using Cygnus’s gcc compiler, which offers no objection to running under Windows 98SE or Windows7.
                        (MD5 digest=1b5807de79d9e6b8e5a71984ec1b68ad)

I am told that Macintosh binary file formats are too variable to provide a pre-compiled Mac version, but if you install the extra goodies provided by Apple, there is a gcc compiler that will generate a binary program with the command:
                gcc -o kdf9emul kdf9emul.c
The same command can be used to generate a binary program for UNIX or GNU/Linux.

Preparing “paper tape” input to Walgol.

The file holding the Algol60 program (TR1 with the Findlay system, ptr.txt with kdf9emul) is basically an ASCII (or ISO-Latin1) representation of the paper tapes that were used on KDF9. It is not a lot of fun putting in all the underline characters, and they look rather odd. The KDF9 Flexowriter which was used for paper tape preparation did not advance the carriage for the underline character, so the typescript looked OK. You can type Algol60 using more modern conventions, and convert it into ptr.txt, using KDF9Flex.bat (Win-PC version) or KDF9Flex (UNIX version). You will also need to have in the current directory absconvf.txt and absconvw.txt. and an executable program compiled from htmform.c.

Typing Algol60 in the 21st century

I propose that Algol60 programs intended for input to Walgol are typed with the following conventions:
typescriptKDF9 Algolofficial Algol60
'begin' etcbeginbegin
%÷÷ integer divide
*×× multiply
_ underline for space in a string (i.e. a * in KDF9 paper tape code)
@ for end message (because it is involved in message)
{} curly brackets for underlined square ones (Algol60 string quotes).
These are the conventions processed by KDF9Flex, but by altering absconvf.txt and absconvw.txt you can have pretty much whatever you want.

What should happen

Here is an example with ptr.txt containing:

   writetext(30, _[Hello _[s_] World!_]);

the output (on LP0 with the Findlay system or punch.txt with kdf9emul) is:

RAN/EL/000M01S/000M01S  SIZE     11


It took a while to find out how to do the space, and where did the exclamation mark go? It is not an Algol Basic Symbol, and all such symbols get printed as asterisk. It is all in upper case because KDF9 printers did not do lowercase - nor exclamation marks.
There will be lots of diagnostic output. The system did not have any way of stopping it, short of operator abandon, so it ends with a deliberate failure.

Accessing the KDF9 source code

The Walgol source texts are at walgolt.k3 and walgolc.k3, and the assembler output can be seen at walgolt.txt and walgolc.txt. As an aid to understanding the code, there are versions of the translator and controller, in which references to subroutines are hot links so that you can browse through different execution paths — of which there are many.

Comparing the different typescripts

The copy-typing was done in duplicate, and then reconciled to produce the versions that are available here. Click here for the description of the method used to produce one good version from two or more typescripts.
Here are some of the software tools that have been useful in analysing Usercode.