Stropping: Reference, Publication & Hardware Languages
4.1 Three levels of language
The ALGOL 60 Report distinguishes:
Reference language — the defining language of the Report. Its *basic symbols* include words like begin, if, integer which are *single symbols*, not sequences of letters. It uses characters like ×, ÷, ↑, ≤, ≠, ¬, ∧, ∨, ⊃, ≡ and the subscript ten ₁₀ in numbers (1.5₁₀-3).
Publication language — how algorithms are printed in journals and books: keywords in boldface (or underlined in typescript), subscripts and superscripts allowed (e.g. x² for x↑2), Greek letters, etc.
Hardware representations — how each implementation encodes the basic symbols in its machine's limited character set (punched cards, paper tape, teleprinters).
4.2 What is stropping?
Because begin is a single symbol distinct from the identifier begin, a hardware representation must mark keywords somehow. Marking keywords is called stropping (from "apostrophe"). Common regimes:
Quote stropping 'BEGIN' 'REAL' X; Very common on 1960s European machines; used by MARST ('begin') Point stropping .BEGIN.REAL X;
ALGOL 68 standard hardware representation (POINT) Upper stropping BEGIN REAL x;
Keywords in upper case, identifiers in lower case; Algol 68 Genie's default (UPPER)
Typewriters/Flexowriters with backspace-and-underscore Reserved words begin real x;
Keywords cannot be identifiers (RES); the approach used by Pascal, C and nearly all later languages begin real x
With stropping, spaces can appear *inside identifiers* (ALGOL 68: max int, is prime), and keywords never clash with identifiers.
4.3 The same program in three representations
Publication (reference) language:
MARST hardware representation (used for runnable ALGOL 60 in this course):
Upper-case quote stropping typical of 1960s punched cards:
(The 'POWER' spelling is illustrative; each 1960s compiler chose its own codings for symbols like ↑.)
begin integer i; real s;
s := 0;
for i := 1 step 1 until 10 do s := s + i↑2;
outreal(1, s)
end'begin' 'integer' i; 'real' s;
s := 0;
'for' i := 1 'step' 1 'until' 10 'do' s := s + i * i;
outreal(1, s)
'end''BEGIN' 'INTEGER' I; 'REAL' S;
S := 0;
'FOR' I := 1 'STEP' 1 'UNTIL' 10 'DO' S := S + I 'POWER' 2;
OUTREAL(1, S)
'END'4.4 MARST's representation of ALGOL 60 symbols
MARST (the GNU ALGOL 60 to C translator) uses quote stropping with lowercase keywords. The mappings below are those commonly used with MARST; consult the MARST manual (info marst) for the authoritative list for your version — in particular for the less common operators.
begin end 'begin' 'end' integer real Boolean 'integer' 'real' 'boolean' integer division (truncating) ** (see manual; ^ in some versions)
'not' 'and' 'or' 'impl' 'equiv' ₁₀ (exponent) string quotes (C-style escapes such as \n are accepted) comment up to the next ;
Other ALGOL 60 systems differ: NASE A60 and jff-algol accept their own conventions (see Chapter 6). When moving code between systems, only the stropping changes — the language is the same.
4.5 Stropping in ALGOL 68
ALGOL 68 calls keywords bold words (BEGIN, INT, PROC, MODE, and user-defined mode and operator names like VECTOR or MAX). The *Report on the Standard Hardware Representation for ALGOL 68* (Hansen & Boom, 1977) defines POINT, UPPER and RES stropping; many implementations also offered QUOTE stropping.
Algol 68 Genie uses UPPER stropping by default:
a68g also supports QUOTE stropping (selected with a command-line option or pragmat — see its manual). This course uses UPPER stropping for all ALGOL 68 code.
BEGIN
INT max count = 10; # "max count" is ONE identifier containing a space #
MODE VECTOR = [1:3] REAL; # VECTOR is a user-defined bold word #
print(("max count = ", max count, newline))
END