Introduction to ALGOL

ALGOL (ALGOrithmic Language) is a family of imperative programming languages designed by international committees between 1958 and 1968.

1.1 What is ALGOL?

ALGOL (ALGOrithmic Language) is a family of imperative programming languages designed by international committees between 1958 and 1968. It was created to be:

A universal, machine-independent language for expressing numerical algorithms.

Close to standard mathematical notation.

Suitable for publishing algorithms in journals (for two decades, *Communications of the ACM* printed its "Algorithms" section in ALGOL 60).

Mechanically translatable into machine code.

There are three main members:

ALGOL 58 (IAL) Preliminary report (Perlis & Samelson, eds.)

A preliminary draft; spawned JOVIAL, MAD, NELIAC 1960, revised 1962/63

*Revised Report on the Algorithmic Language ALGOL 60* (Naur, ed.) Small, elegant, enormously influential 1968, revised 1973/75

*Revised Report on the Algorithmic Language ALGOL 68* (van Wijngaarden et al.)

Large, orthogonal, formally defined, controversial Close relatives include ALGOL W (Wirth & Hoare, 1966), Simula 67 (an ALGOL 60 superset), Burroughs Extended ALGOL (still used on Unisys ClearPath MCP systems), and Pascal (Wirth's simplification of ALGOL W ideas).

1.2 Why study ALGOL today?

Almost every mainstream imperative language — Pascal, C, C++, Java, C#, Ada, Go, Python's block structure, even shell syntax — descends from ideas first made precise in ALGOL.

ALGOL 60 introduced or popularized block structure, lexical scope, recursion, the call stack, if-then-else expressions, the for loop, and BNF grammars.

ALGOL 68 introduced orthogonality, user-defined operators, unions with type-safe discrimination, void, casts, struct, references as first-class values, compound assignment operators (+:=), and parallel clauses.

Understanding call by name, thunks, displays and coercions sharpens your understanding of every modern compiler and language runtime.

The languages are still runnable: Algol 68 Genie (a68g) is actively maintained, MARST translates ALGOL 60 to C, and Unisys still ships ALGOL compilers for its MCP mainframes.

1.3 Key characteristics of ALGOL 60

Block structure: begin ... end blocks with their own local declarations.

Static (lexical) scoping: identifiers refer to the textually enclosing declaration.

Recursive procedures with call by value and call by name parameters.

Dynamic arrays: bounds computed at block entry.

Types: integer, real, Boolean (plus arrays, procedures, labels, switches, strings as parameters only).

No standard I/O in the Report — I/O was left to implementations (see §19).

Free format: spaces and newlines have no meaning (outside strings).

1.4 Key characteristics of ALGOL 68

A small number of orthogonal concepts combined freely: modes (types), references, rows, structures, unions, procedures, operators.

Everything is an expression (a "unit" yields a value — possibly VOID).

Strong static typing with implicit coercions governed by syntactic contexts.

Garbage-collected heap (HEAP) alongside stack allocation (LOC).

Built-in transput (I/O) library, including formatted transput.

Parallel clauses with semaphores.

Defined by a two-level (van Wijngaarden) grammar that captures context-sensitive rules.

1.5 How this course is organized

Part I lays foundations: history, BNF, stropping, tools, and the basic statements of ALGOL 60.

Part II covers ALGOL 60's procedures (call by name, Jensen's device, recursion), scope, I/O, known problems, classic algorithms, ALGOL W and dialects.

Part III is a deep dive into ALGOL 68 using Algol 68 Genie.

Part IV covers influence, comparisons, projects, pitfalls, capstones and reference appendices.

Notation in this course. In prose, ALGOL 60 keywords appear in bold or code as begin, the *publication* style. Runnable ALGOL 60 listings use MARST's quote stropping ('begin'). ALGOL 68 listings use Algol 68 Genie's UPPER stropping (BEGIN, INT, PROC in capitals; identifiers in lower case). Chapter 4 explains why these differ.