ALGOL W


ALGOL W is a programming language. It is based on a proposal for ALGOL X by Niklaus Wirth and Tony Hoare as a successor to ALGOL 60 in International Federation for Information Processing IFIP Working Group 2.1. When the committee decided that the proposal was not a sufficient advance over ALGOL 60, the proposal was published as A contribution to the development of ALGOL. After making small modifications to the language Wirth supervised a high quality implementation for the IBM/360 at Stanford University that was widely distributed.
It represented a relatively conservative modification of ALGOL 60, adding string, bitstring, complex number and reference to record datatypes and call-by-result passing of parameters, introducing the while statement, replacing switch with the case statement, and generally tightening up the language.
The implementation was written in PL/360, an ALGOL-like assembly language designed by Wirth. The implementation includes influential debugging and profiling abilities.

Syntax and semantics

ALGOL W's syntax is built on a subset of the EBCDIC character set. In ALGOL 60 reserved words are distinct lexical items, but in ALGOL W they are merely sequences of characters, and do not need to be stropped. Reserved words and identifiers are separated by spaces. In these ways ALGOL W's syntax resembles that of Pascal and later languages.
The Algol W Language Description defines Algol W in an affix grammar that resembles BNF. This grammar was a precursor of the Van Wijngaarden grammar.
Much of Algol W's semantics is defined grammatically:
This demonstrates ALGOL W's record type facility.

RECORD PERSON NAME;
INTEGER AGE;
LOGICAL MALE;
REFERENCE FATHER, MOTHER, YOUNGESTOFFSPRING, ELDERSIBLING
);
REFERENCE PROCEDURE YOUNGESTUNCLE ;
BEGIN
REFERENCE P, M;
P := YOUNGESTOFFSPRING;
WHILE AND OR DO
P := ELDERSIBLING;
M := YOUNGESTOFFSPRING;
WHILE AND DO
M := ELDERSIBLING;
IF P = NULL THEN
M
ELSE IF M = NULL THEN
P
ELSE
IF AGE < AGE THEN P ELSE M
END

Implementation

The major part of ALGOL W, amounting to approximately 2700 cards, was written in Wirth's PL360. An interface module for the IBM operating system in use was written in IBM assembler, amounting to fewer than 250 cards.

In an OS environment on a 360/67 with spooled input and output files, the compiler will recompile itself in about 25 seconds. The compiler is approximately 2700 card images. Thus, when the OS scheduler time is subtracted from the execution time given above, it is seen that the compiler runs at a speed in excess of 100 cards per second.


In a DOS environment on a 360/30, the compiler is limited only by the speed of the card reader. The compiler has successfully recompiled itself on a 64K 360/30 at a rate of 1200 cards per minute. This is impressive when compared to the time required for the DOS Assembler to assemble the interface module which consists of under 250 cards. When the macro instructions are expanded, the DOS interface has 972 card images and the Assembler takes 15 minutes for the assembly.