S-algol

S-algol (St Andrews Algol)[1]: vii  is a computer programming language derivative of ALGOL 60 developed at the University of St Andrews in 1979 by Ron Morrison and Tony Davie.

The language is a modification of ALGOL to contain orthogonal data types that Morrison created for his PhD thesis.

It was also the language taught for several years in the 1980s at a local school in St. Andrews, Madras College.

It supports database ability by providing for longevity of data in the form of a persistent heap that survives termination of PS-algol programs.

Ron Morrison's 1979 PhD thesis, On the Development of Algol, describes the design and implementation of the S-algol language.

[4]: 5  The 1981 computer science text Recursive Descent Compiling describes the compiler implementation and bootstrapping process,[2] and the 1982 book An Introduction to Programming with S-algol uses the language to teach computer programming.

[1]: vii  Due to the small 64 kilobyte address space available on the PDP-11, an interpreted bytecode implementation was chosen.

S-algol was also ported to the Zilog Z80 microprocessor running CP/M, including raster graphics facilities that had been added to the language.

The PS-algol implementation was the basis for S-algol ports to the Macintosh and Sun workstations, featuring a compiler rewritten in C and targeting the extended S-code.

Language elements that are declared include constants, variables, procedures and structures.

Procedure declarations do specify the data types of their arguments and return value (unless void).

The if and case control structures can have values and can be used freely in expressions as long as the type compatibility rules are met.

Morrison identifies five traits of the ALGOL family:[3]: 5 S-algol was designed to differ from prior members of the ALGOL family by being designed according to semantic principles to provide power through simplicity, and simplicity through greater generality.

The basic or primitive data types in S-algol are integer, real, boolean, file, and string.

This does not apply to infix operators, as they are syntactic sugar for common functions and are not part of the semantic model.

Matches are tested in order, so this resembles the guarded commands of Edsger Dijkstra without the non-determinism.

Tennent used the term sequel for the abstraction over sequencers, these would be generalizations of goto and break.

Reference and result parameters are rejected, which is consistent with the S-algol ban on passing l-values.

Any procedure passed as a parameter has its full type specified (in contrast to Pascal) and the same is true for a structure class.

Since variable declarations must always include an initial value, the type does not need to be specified explicitly.