- Oct. 1968: Penultimate Draft Report on the Algorithmic Language ALGOL 68 - Chapters 1-9 4 Chapters 10-12 5 - Edited by: A. Van Wijngaarden , B.J. Mailloux , J.E.L. Peck and C.H.A. Koster .
- Dec. 1968: Report on the Algorithmic Language ALGOL 68 - Offprint from Numerische Mathematik, 14, 79-218 (1969); Springer-Verlag. 6 - Edited by: A. Van Wijngaarden , B.J. Mailloux , J.E.L. Peck and C.H.A. Koster .
- Sep 1973: Revised Report on the Algorithmic Language Algol 68 - Springer-Verlag 1976 7 - Edited by: A. Van Wijngaarden , B.J. Mailloux , J.E.L. Peck , C.H.A. Koster , M. Sintzoff , C.H. Lindsey , L.G.L.T. Meertens and R.G. Fisker .
There are 61 such reserved words ( some with "brief symbol" equivalents ) in the standard sub-language:
mode,
op,
prio,
proc,
flex,
heap,
loc,
long,
ref,
short,
bits,
bool,
bytes,
char,
compl,
int,
real,
sema,
string,
void,
channel,
file,
format,
struct,
union,
of,
at "@",
is ":=:",
isnt ":≠:",
true,
false,
empty,
nil "○",
skip "~",
co "¢",
comment "¢",
pr,
pragmat,
Procedure () declarations require type specifications for both the parameters and the result ('''void''' if none):
proc max of real = (
real a, b)
real:
if a > b
then a
else b
fi;
or, using the "brief" form of the conditional statement:
These are technically not operators, rather they are considered "
units associated with names "
“:=:” (alternatively “
is”) tests if two pointers are equal; “:/=:” (alternatively “
isnt”) tests if they are unequal.
Consider trying to compare two pointer values, such as the following variables, declared as pointers-to-integer:
:
ref int ip, jp
Now consider how to decide whether these two are pointing to the same location, or whether one of them is pointing to
nil. The following expression
:
ip = jp
will dereference both pointers down to values of type
int, and compare those, since the “=” operator is defined for
int, but not
ref int. It is ''not legal'' to define “=” for operands of type
ref int and
int at the same time, because then calls become ambiguous, due to the implicit coercions that can be applied: should the operands be left as
ref int and that version of the operator called? Or should they be dereferenced further to
int and that version used instead? Therefore the following expression can never be made legal:
:
ip = nil
Hence the need for separate constructs not subject to the normal coercion rules for operands to operators. But there is a gotcha. The following calls:
:
ip :=: jp
:
ip :=: nil
while legal, will probably not do what you expect. They will always return
false, because they are comparing the ''actual addresses of the variables ''
ip'' and ''
jp'', rather than what they point to''. To achieve the right effect, you have to write
:
ip :=: ref int(jp)
:
ip :=: ref int(nil)
On 14 May 2003,
Software Patent application No. 20040230959"IS NOT OPERATOR" - was filed for the '''
ISNOT''' operator by employees of
Microsoft . This patent was granted on 18 November 2004.
The ∨, ∧, ¬, ≠, ≤, ≥, ×, ÷, ⌷, ↑, ↓, ⌊, ⌈ and ⊥ characters can be found on the
IBM 2741 keyboard with the
APL "golf-ball" print head inserted, these became available in the mid 1960s while ALGOL 68 was being drafted.
is the term used to refer to ALGOL 68's input and output facilities. There are pre-defined procedures for unformatted, formatted and binary transput. Files and other transput devices are handled in a consistent and machine-independent manner. The following example prints out some unformatted output to the '''standard output''' device:
print ((newpage, "Title", newline, "Value of i is ",
i, "and x
is ", x[i , newline))
Note the predefined procedures
newpage and
newline passed as arguments.
The is considered to be of books,
channels and
files:
- are made up of pages, and lines, and may be locked and selected via chains.
- --- A specific book can be located by name with a call to
match.
- channels correspond to physical devices. eg. card punches and printers.
- --- There are three standard channels:
stand in channel, stand out channel, stand back channel.
- A file is a means of communicating between a particular program and a book that has been opened via some channel.
- --- The of a file may be read, write, char, bin, and opened.
- --- transput procedures include:
establish, create, open, associate, lock, close, scratch.
- --- position enquires:
char number, line number, page number.
- --- layout routines include:
--space, backspace, newline, newpage.
--get good line, get good page, get good book, and proc set=(ref file f, int page,line,char)void:
- --- A file has . eg.
on logical file end, on physical file end, on page end, on line end, on format end, on value error, on char error.
"Formatted transput" in ALGOL 68's transput has its own syntax and patterns (functions), with
formats embedded between two $ characters.
Examples:
printf (($2l"The sum is:"x, g(0)$, m + n)); ¢ prints the same as: ¢
print ((new line, new line, "The sum is:", space, whole (m + n, 0))
''ALGOL 68'' supports programming of parallel processing. Using the keyword
par, a ''collateral clause'' is converted to a ''parallel clause'', where the synchronisation of actions is controlled using
Semaphore s. In A68G the parallel actions are mapped to threads when available on the hosting
Operating System . In A68S a different paradigm of parallel processing was implemented (see below).
mode foot =
{Link without Title} bits; ¢ packed vector of
bool ¢
foot left, right;
sema left toe =
level ⌈left,
right toe =
level ⌈right;
proc shoot left toe =
void: (
shoot(left toe);
print("Left: Ouch!!");
newline
),
shoot right toe =
void:(
shoot(right toe);
print("Right: Ouch!!");
newline
);
¢ 10 round clip in a 1955
Colt Python .357 Magnum ¢
sema rounds =
level 10;
¢ the Magnum needs more barrels to take full advantage of parallelism ¢
sema acquire target =
level 1;
proc shoot = (
ref sema target)
void: (
↓ acquire target;
↓ rounds;
print("BANG! ");
↓ target;
↑ acquire target
);
¢ do shooting in parallel to cater for someone hoping to stand on just one foot ¢
par (
for toe
from ⌊left
to ⌈left
do
shoot left toe
od, ¢ <= this comma is important ¢
for toe
from ⌊right
to ⌈right
do
shoot right toe
od
)
This sample program implements the
Sieve Of Eratosthenes to find all the
Prime Number s that are less than 100.
nil is the ALGOL 68 analogue of the ''null pointer'' in other languages. The notation ''x''
of ''y'' accesses a member ''x'' of a
struct ''y''.
begin # Algol-68 prime number sieve, functional style #
proc error = (
string s)
void:
(print(( newline, " error: ", s, newline));
goto stop);
proc one to = (
int n)
list:
For its technical intricacies, ALGOL 68 needs a cornucopia of methods to deny the existence of something:
skip, "~" or "?"
C - an undefined value always syntactically valid,
void - syntactically like a , but not one,
nil or "∘" - a name not denoting anything, of an unspecified reference mode,
empty - the only value admissible to
void, needed for selecting
void in a
union,
- an empty array of integral values, with mode [ int,
''undefined'' - a procedure raising an exception in the runtime system.
The term
nil is ''var'' always evaluates to
true for any variable (but see above for correct use of
is/:=:), whereas it is not known
to which value a comparison ''x'' <
skip evaluates for any integer ''x''.
ALGOL 68 leaves intentionally undefined, what happens in case of integer overflow, the integer bit representation, and the degree of numerical accuracy for floating point. In contrast, the language
Java has been criticized for over-specifying the latter.
Except where noted (with a
superscript), the language described above is that of the "Revised Report
(RR)".
The original language
(FR) differs in syntax of the ''mode cast'', and it had the feature of ''proceduring'', i.e. coercing the value of a term into a procedure which evaluates the term. Proceduring effectively can make evaluations ''lazy''. The most useful application could have been the short-circuited evaluation of boolean operators. In
The S3 programming language that was used to write the
VME operating system and much other system software on the
ICL 2900 Series was a direct derivative of Algol 68. However, it omitted many of the more complex features, and replaced the basic modes with a set of data types that mapped directly to the 2900 Series hardware architecture.
ALGOL 68R
(R) from
RRE was the first ALGOL 68 subset implementation,
running on the
ICL 1900 .
Based on the original language, the main subset restrictions were ''definition before use'' and no parallel processing.
This compiler was popular in
UK universities in the 1970s, where many
Computer Science students learnt ALGOL 68 as their first programming language; the compiler was renowned for good error messages.
ALGOL 68RS
(RS) from
RSRE was a portable compiler system written in ALGOL 68RS (bootstrapped from ALGOL 68R), and implemented on a variety of systems including the
ICL 2900/Series 39 ,
Multics and
DEC VAX/VMS .
The language was based on the Revised Report, but with similar subset restrictions to ALGOL 68R.
This compiler survives in the form of an Algol68-to-C compiler.
In ALGOL 68S
(S) from
Carnegie Mellon University the power of parallel processing was improved by adding an orthogonal extension, ''eventing''. Any variable declaration containing keyword
event made assignments to this variable eligible for parallel evaluation, i.e. the right hand side was made into a procedure which was moved to one of the processors of the
C.mmp multiprocessor system. Accesses to such variables were delayed after termination of the assignment.
Cambridge ALGOL 68C (C) was a portable compiler that implemented a subset of ALGOL 68, restricting operator definitions and omitting garbage collection, flexible rows and formatted transput.
ALGOL 68G (G) by M. van der Veer implements a usable ALGOL 68 interpreter for today's computers and operating systems. A minor restriction is that ''formatted transput'' is still not conforming to the ''Revised Report''.
"Despite good intentions, a programmer may violate portability by inadvertently employing a local extension. To guard against this, each implementation should provide a PORTCHECK pragmat option. While this option is in force, the compiler prints a message for each construct that it recognizes as violating some portability constraint."
{Link without Title}
- ''... The scheme of type composition adopted by C owes considerable debt to Algol 68, although it did not, perhaps, emerge in a form that Algol's adherents would approve of. The central notion I captured from Algol was a type structure based on atomic types (including structures), composed into arrays, pointers (references), and functions (procedures). Algol 68's concept of unions and casts also had an influence that appeared later.'' Dennis Ritchie Apr 1993. 8
- ''... C does not descend from Algol 68 is true, yet there was influence, much of it so subtle that it is hard to recover even when I think hard. In particular, the union type (a late addition to C) does owe to A68, not in any details, but in the idea of having such a type at all. More deeply, the type structure in general and even, in some strange way, the declaration syntax (the type-constructor part) was inspired by A68. And yes, of course, "long".'' Dennis Ritchie , 18 June 19889
- "Congratulations, your Master has done it" - Niklaus Wirth 10
- ''The more I see of it, the more unhappy I become'' - E.W. Dijkstra, 1968 11
- '' it was said that A68's popularity was inversely proportional to [... the distance from Amsterdam'' - Guido Van Rossum 12
- 1980 quote: ' The best we could do was to send with it a minority report, stating our considered view that, "... as a tool for the creation of sophisticated programs, the language was a failure." [... ' - , Oct 1980, re: "Dec 1968"
- Original 1968 version: ''" More than ever it will be required from an adequate programming tool that it assists, by structure, the programmer in the most difficult aspects of his job, viz. in the reliable creation of sophisticated programs. In this respect we fail to see how the language proposed here ''[Algol68 '' is a significant step forward: on the contrary, we feel that its implicit view of the programmer's task is very much the same as, say, ten years ago. This forces upon us the conclusion that, regarded as a programming tool, the language must be regarded as obsolete. [...]"'' Signed by: DIJKSTRA , DUNCAN , GARWICK , HOARE , RANDELL , SEEGMUELLER , TURSKI , WOODGER . And then on Dec. 23, 1968, Jan V. Garwick 13
- Brailsford, D.F. and Walker, A.N., ''Introductory ALGOL 68 Programming'', Ellis Horwood/Wiley, 1979
- Lindsey, C.H., ''A History of ALGOL 68'', ACM SIGPLAN Notices 28(3), March 1993. (Includes a comprehensive bibliography of the meetings and discussions before, during and after the development of ALGOL 68.)
- Lindsey, C.H. and van der Meulen, S.G., ''Informal Introduction to ALGOL 68'', North-Holland, 1971
- McGettrick, A.D., ''ALGOL 68, A First and Second Course'', Cambridge Univ. Press, 1978
- Peck, J.E.L., ''An ALGOL 68 Companion'', Univ. of British Columbia, October 1971
- Tanenbaum, A.S., ''A Tutorial on ALGOL 68'', Computing Surveys , 155-190, June 1976 and '''9''', 255-256, September 1977, http://vestein.arb-phys.uni-dortmund.de/~wb/RR/tanenbaum.pdf
- Woodward, P.M. and Bond, S.G., ''ALGOL 68-R Users Sic Guide'', London, Her Majesty's Stationery Office, 1972