Movatterモバイル変換


[0]ホーム

URL:


Jump to content
WikipediaThe Free Encyclopedia
Search

ALGOL 68

From Wikipedia, the free encyclopedia
Programming language

ALGOL 68
Revised Report on the Algorithmic Language – Algol 68 Edited by: A. van Wijngaarden et al, September 1973[1]
ParadigmsMulti-paradigm:concurrent,imperative
FamilyALGOL
Designed byA. van Wijngaarden,B. J. Mailloux,J. E. L. Peck andC. H. A. Koster, et al.
First appearedFinal Report: 1968; 57 years ago (1968)r0
Stable release
Algol 68/RR / Revised Report: 1973; 52 years ago (1973)r1
Typing disciplinestatic,strong,safe,structural
ScopeLexical
Websitealgol68-lang.org
Majorimplementations
ALGOL 68C, Algol 68 Genie (recent),ALGOL 68-R,ALGOL 68RS,ALGOL 68S,FLACC,Алгол 68 Ленинград/Leningrad Unit,Odra ALGOL 68
Dialects
ALGOL 68/FR (Final Reportr0)
Influenced by
ALGOL 60,ALGOL Y
Influenced
C,[3][5]C++,[6]Bourne shell,KornShell,Bash,Steelman,Ada,Python,[7]Seed7,Mary,S3
This article contains Unicode 6.0 "Miscellaneous Technical" characters. Without properrendering support, you may seequestion marks, boxes, or other symbols instead of something like "₁₀" (Decimal Exponent Symbol U+23E8 TTF).

ALGOL 68 (short forAlgorithmic Language 1968) is animperativeprogramming language member of theALGOL family that was conceived as a successor to theALGOL 60 language, designed with the goal of a much wider scope of application and more rigorously definedsyntax and semantics.

The complexity of the language's definition, which runs to several hundred pages filled with non-standard terminology, madecompiler implementation difficult and it was said it had "no implementations and no users". This was only partly true; ALGOL 68 did find use in several niche markets, notably in theUnited Kingdom where it was popular onInternational Computers Limited (ICL) machines, and in teaching roles. Outside these fields, use was relatively limited.

Nevertheless, the contributions of ALGOL 68 to the field ofcomputer science have been deep, wide-ranging and enduring, although many of these contributions were only publicly identified when they had reappeared in subsequently developed programming languages. Many languages were developed specifically as a response to the perceived complexity of the language, the most notable beingPascal, or were reimplementations for specific roles, likeAda.

Many languages of the 1970s trace their design specifically to ALGOL 68, selecting some features while abandoning others that were considered too complex or out-of-scope for given roles. Among these is the languageC, which was directly influenced by ALGOL 68, especially by itsstrong typing and structures. Most modern languages trace at least some of their syntax to either C or Pascal, and thus directly or indirectly to ALGOL 68.

Overview

[edit]

ALGOL 68 features include expression-based syntax, user-declared types and structures/tagged-unions, a reference model of variables and reference parameters, string, array and matrix slicing, and concurrency.

ALGOL 68 was designed by theInternational Federation for Information Processing (IFIP)IFIP Working Group 2.1 on Algorithmic Languages and Calculi. On December 20, 1968, the language was formally adopted by the group, and then approved for publication by the General Assembly of IFIP.

ALGOL 68 was defined using aformalism, a two-levelformal grammar, invented byAdriaan van Wijngaarden.Van Wijngaarden grammars use acontext-free grammar to generate an infinite set of productions that will recognize a particular ALGOL 68 program; notably, they are able to express the kind of requirements that in many other programming languagetechnical standards are labelledsemantics, and must be expressed in ambiguity-prone natural language prose, and then implemented in compilers asad hoc code attached to the formal language parser.

ALGOL 68 was the first (and possibly one of the last) major language for which a full formal definition was made before it was implemented.

C. H. A. Koster[8]

The main aims and principles of design of ALGOL 68:

  1. Completeness and clarity of description[9]
  2. Orthogonality of design[10]
  3. Security[11]
  4. Efficiency:[12]
    • Static mode checking
    • Mode-independent parsing
    • Independent compiling
    • Loop optimizing
    • Representations – in minimal & largercharacter sets

ALGOL 68 has been criticized, most prominently by some members of its design committee such asC. A. R. Hoare andEdsger Dijkstra, for abandoning the simplicity ofALGOL 60, becoming a vehicle for complex or overly general ideas, and doing little to make thecompiler writer's task easier, in contrast to deliberately simple contemporaries (and competitors) such asC,S-algol andPascal.

In 1970,ALGOL 68-R became the first working compiler for ALGOL 68.

In the 1973 revision, certain features — such asproceduring, gommas[13] andformal bounds — were omitted.[14] C.f.The language of the unrevised report.r0

Though European defence agencies (in BritainRoyal Signals and Radar Establishment (RSRE)) promoted the use of ALGOL 68 for its expected security advantages, the American side of the NATO alliance decided to develop a different project, the languageAda, making its use obligatory for US defense contracts.

ALGOL 68 also had a notable influence in theSoviet Union, details of which can be found inAndrey Terekhov's 2014 paper: "ALGOL 68 and Its Impact on the USSR and Russian Programming",[15] and "Алгол 68 и его влияние на программирование в СССР и России".[16]

Steve Bourne, who was on the ALGOL 68 revision committee, took some of its ideas to hisBourne shell (and thereby, to descendantUnix shells such asBash) and toC (and thereby to descendants such asC++).

The complete history of the project can be found inC. H. Lindsey'sA History of ALGOL 68.[17][18]

For a full-length treatment of the language, see "Programming ALGOL 68 Made Easy"[19] by Dr. Sian Mountbatten, or "Learning ALGOL 68 Genie"[20] by Marcel van der Veer which includes the Revised Report.

History

[edit]

Origins

[edit]

ALGOL 68, as the name implies, is a follow-on to theALGOL language that was first formalized in 1960. That same year theInternational Federation for Information Processing (IFIP) formed and started the Working Group on ALGOL, or WG2.1. This group released an updated ALGOL 60 specification in Rome in April 1962. At a follow-up meeting in March 1964, it was agreed that the group should begin work on two follow-on standards, ALGOL X, which would be a redefinition of the language with some additions, andALGOL Y, which would have the ability to modify its own programs in the style of the languageLISP.[21]

Definition process

[edit]

The first meeting of the ALGOL X group was held inPrinceton University in May 1965. A report of the meeting noted two broadly supported themes, the introduction ofstrong typing and interest inEuler's concepts of 'trees' or 'lists' for handling collections.[22] Although intended as a "short-term solution to existing difficulties",[23] ALGOL X got as far as having a compiler made for it. This compiler was written byDouglas T. Ross of theMassachusetts Institute of Technology (MIT) with theAutomated Engineering Design (AED-0) system, also termedALGOL Extended for Design.[24][25]

At the second meeting in October in France, three formal proposals were presented,Niklaus Wirth'sALGOL W along with comments about record structures byC.A.R. (Tony) Hoare, a similar language by Gerhard Seegmüller, and a paper byAdriaan van Wijngaarden on "Orthogonal design and description of a formal language". The latter, written in almost indecipherable "W-Grammar", proved to be a decisive shift in the evolution of the language. The meeting closed with an agreement that van Wijngaarden would re-write the Wirth/Hoare submission using his W-Grammar.[22]

This seemingly simple task ultimately proved more difficult than expected, and the follow-up meeting had to be delayed six months. When it met in April 1966 inKootwijk, van Wijngaarden's draft remained incomplete and Wirth and Hoare presented a version using more traditional descriptions. It was generally agreed that their paper was "the right language in the wrong formalism".[26] As these approaches were explored, it became clear there was a difference in the way parameters were described that would have real-world effects, and while Wirth and Hoare protested that further delays might become endless, the committee decided to wait for van Wijngaarden's version. Wirth then implemented their current definition as ALGOL W.[27]

At the next meeting inWarsaw in October 1966,[28] there was an initial report from the I/O Subcommittee who had met at theOak Ridge National Laboratory and theUniversity of Illinois but had not yet made much progress. The two proposals from the previous meeting were again explored, and this time a new debate emerged about the use ofpointers; ALGOL W used them only to refer to records, while van Wijngaarden's version could point to any object. To add confusion,John McCarthy presented a new proposal foroperator overloading and the ability to string togetherand andor constructs, andKlaus Samelson wanted to allowanonymous functions. In the resulting confusion, there was some discussion of abandoning the entire effort.[27] The confusion continued through what was supposed to be the ALGOL Y meeting inZandvoort in May 1967.[22]

Publication

[edit]

A draft report was finally published in February 1968. This was met by "shock, horror and dissent",[22] mostly due to the hundreds of pages of unreadable grammar and odd terminology.Charles H. Lindsey attempted to figure out what "language was hidden inside of it",[29] a process that took six man-weeks of effort. The resulting paper, "ALGOL 68 with fewer tears",[30] was widely circulated. At a wider information processing meeting inZürich in May 1968, attendees complained that the language was being forced upon them and that IFIP was "the true villain of this unreasonable situation" as the meetings were mostly closed and there was no formal feedback mechanism. Wirth andPeter Naur formally resigned their authorship positions in WG2.1 at that time.[29]

The next WG2.1 meeting took place inTirrenia in June 1968. It was supposed to discuss the release of compilers and other issues, but instead devolved into a discussion on the language. van Wijngaarden responded by saying (or threatening) that he would release only one more version of the report. By this point Naur, Hoare, and Wirth had left the effort, and several more were threatening to do so.[31] Several more meetings followed,North Berwick in August 1968, Munich in December which produced the release of the official Report in January 1969 but also resulted in a contentious Minority Report being written. Finally, atBanff, Alberta in September 1969, the project was generally considered complete and the discussion was primarily on errata and a greatly expanded Introduction to the Report.[32]

The effort took five years, burned out many of the greatest names incomputer science, and on several occasions became deadlocked over issues both in the definition and the group as a whole. Hoare released a "Critique of ALGOL 68" almost immediately,[33] which has been widely referenced in many works. Wirth went on to further develop the ALGOL W concept and released this as Pascal in 1970.

Implementations

[edit]

ALGOL 68-R

[edit]

The first implementation of the standard, based on the late-1968 draft Report, was introduced by theRoyal Radar Establishment in the UK asALGOL 68-R in July 1970. This was, however, a subset of the full language, andBarry Mailloux, the final editor of the Report, joked that "It is a question of morality. We have a Bible and you are sinning!"[34] This version nevertheless became very popular on theICL machines, and became a widely-used language in military coding, especially in the UK.[35]

Among the changes in 68-R was the requirement for all variables to be declared before their first use. This had a significant advantage that it allowed the compiler to be one-pass, as space for the variables in theactivation record was set aside before it was used. However, this change also had the side-effect of demanding thePROCs be declared twice, once as a declaration of the types, and then again as the body of code. Another change was to eliminate the assumedVOID mode, an expression that returns no value (named astatement in other languages) and demanding the wordVOID be added where it would have been assumed. Further, 68-R eliminated the explicitparallel processing commands based onPAR.[34]

Others

[edit]

The first full implementation of the language was introduced in 1974 by CDC Netherlands for theControl Data mainframe series. This saw limited use, mostly teaching in Germany and the Netherlands.[35]

A version similar to 68-R was introduced fromCarnegie Mellon University in 1976 as 68S, and was again a one-pass compiler based on various simplifications of the original and intended for use on smaller machines like theDEC PDP-11. It too was used mostly for teaching purposes.[35]

A version forIBM mainframes did not become available until 1978, when one was released fromCambridge University. This was "nearly complete". Lindsey released a version for small machines including theIBM PC in 1984.[35]

Three open source Algol 68 implementations are known:[36]

Timeline

[edit]
YearEventContributor
March 1959ALGOL Bulletin Issue 1 (First)Peter Naur /ACM
February 1968Draft Report(DR) Published[39]IFIPWorking Group 2.1
March 1968Algol 68 Final Reportr0 Presented at Munich MeetingIFIP Working Group 2.1
June 1968Meeting in Tirrenia, ItalyIFIP Working Group 2.1
Aug 1968Meeting in North Berwick, ScotlandIFIP Working Group 2.1
December 1968ALGOL 68 Final Reportr0 Presented at Munich MeetingIFIP Working Group 2.1
April 1970ALGOL 68-R underGEORGE 3 on anICL1907FRoyal Signals and Radar Est.
July 1970ALGOL 68 for theDartmouth Time-Sharing System[40][41]Sidney Marshall
September 1973Algol 68 Revised Report[42]r1 PublishedIFIP Working Group 2.1
1975ALGOL 68C(C) – transportable compiler (zcodeVM)S. Bourne,Andrew Birrell, andMichael Guy
June 1975G. E. Hedrick and Alan Robertson. The Oklahoma State ALGOL 68 Subset Compiler. 1975 International Conference on ALGOL 68.
June 1977Strathclyde ALGOL 68 conference, ScotlandACM
May 1978Proposals for ALGOL H – A Superlanguage of ALGOL 68[43]A. P. Black, V. J. Rayward-Smith
1984FullALGOL 68S(S) compiler for Sun, SPARC, and PCsC. H. Lindsey et al, Manchester
August 1988ALGOL Bulletin Issue 52 (last)Ed. C. H. Lindsey / ACM
May 1997Algol68 S(S) published on the internet[44]Charles H. Lindsey
November 2001Algol 68 Genie(G) published on the internet[45] (GNU GPL open source licensing)Marcel van der Veer
January 2025Algol 68 GCC Front-End published by Jose E. Marchesi under the GPL[38][37]Jose E. Marchesi

The Algorithmic Language ALGOL 68 Reports and Working Group members

[edit]

"Van Wijngaarden once characterized the four authors, somewhat tongue-in-cheek, as: Koster:transputter, Peck: syntaxer, Mailloux: implementer, Van Wijngaarden: party ideologist." – Koster.

Timeline of standardization

[edit]

1968: On 20 December 1968, the "Final Report" (MR 101) was adopted by the Working Group, then subsequently approved by the General Assembly ofUNESCO'sIFIP for publication. Translations of the standard were made forRussian,German,French andBulgarian, and then laterJapanese andChinese.[51] The standard was also made available inBraille.

1984:TC 97 considered ALGOL 68 for standardisation as "New Work Item" TC97/N1642[2][3]. West Germany, Belgium, Netherlands, USSR and Czechoslovakia willing to participate in preparing the standard but the USSR and Czechoslovakia "were not the right kinds of member of the right ISO committees"[4] and Algol 68's ISO standardisation stalled.[5]

1988: Subsequently ALGOL 68 became one of theGOST standards in Russia.

  • GOST 27974-88 Programming language ALGOL 68 — Язык программирования АЛГОЛ 68[52]
  • GOST 27975-88 Programming language ALGOL 68 extended — Язык программирования АЛГОЛ 68 расширенный[53]

Notable language elements

[edit]
This article contains Unicode 6.0 "Miscellaneous Technical" characters. Without properrendering support, you may seequestion marks, boxes, or other symbols instead of something like "₁₀" (Decimal Exponent Symbol U+23E8 TTF).

Bold symbols and reserved words

[edit]

The standard language contains about sixty reserved words, typically bolded in print, and some with "brief symbol" equivalents:

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,AT "@",EITHERr0,IS ":=:",ISNTIS NOTr0 ":/=:" ":≠:",OF "→"r0,TRUE,FALSE,EMPTY,NIL "○",SKIP "~",CO "¢",COMMENT "¢",PR,PRAGMAT,CASE ~IN ~OUSE ~IN ~OUT ~ESAC "( ~ | ~ |: ~ | ~ | ~ )",FOR ~FROM ~TO ~BY ~WHILE ~DO ~OD,IF ~THEN ~ELIF ~THEN ~ELSE ~FI "( ~ | ~ |: ~ | ~ | ~ )",PARBEGIN ~END "( ~ )",GO TO,GOTO,EXIT "□"r0.

Units: Expressions

[edit]

The basic language construct is theunit. A unit may be aformula, anenclosed clause, aroutine text or one of several technically needed constructs (assignation, jump, skip, nihil). The technical termenclosed clause unifies some of the inherently bracketing constructs known asblock,do statement,switch statement in other contemporary languages. When keywords are used, generally the reversed character sequence of the introducing keyword is used for terminating the enclosure, e.g. (IF ~THEN ~ELSE ~FI,CASE ~IN ~OUT ~ESAC,FOR ~WHILE ~DO ~OD ). ThisGuarded Command syntax was reused byStephen Bourne in the commonUnixBourne shell. An expression may also yield amultiple value, which is constructed from other values by acollateral clause. This construct just looks like the parameter pack of a procedure call.

mode: Declarations

[edit]

The basicdata types (calledmodes in Algol 68 parlance) arereal,int,compl (complex number),bool,char,bits andbytes. For example:

INT n = 2;CO n is fixed as a constant of 2.COINT m := 3;CO m is a newly created localvariable whose value is initially set to 3.COCO    This is short forrefint m =locint := 3;COREAL avogadro = 6.0221415⏨23;CO Avogadro numberCOlong long real long long pi = 3.14159 26535 89793 23846 26433 83279 50288 41971 69399 37510;COMPL square root of minus one = 0 ⊥ 1;

However, the declarationREAL x; is justsyntactic sugar forREFREAL x =LOCREAL;. That is,x is really theconstant identifier for areference to a newly generated localREAL variable.

Furthermore, instead of defining bothfloat anddouble, orint andlong andshort, etc., ALGOL 68 providesmodifiers, so that the presently commondouble would be written asLONGREAL orLONGLONGREAL instead, for example. Theprelude constantsmax real andmin long int are provided to adapt programs to different implementations.

All variables need to be declared, but declaration does not have to precede the first use.

primitive-declarer:INT,REAL,COMPL,COMPLEXG,BOOL,CHAR,STRING,BITS,BYTES,FORMAT,FILE,PIPEG,CHANNEL,SEMA

  • BITS – a "packed vector" ofBOOL.
  • BYTES – a "packed vector" ofCHAR.
  • STRING – aFLEXible array ofCHAR.
  • SEMA – aSEMAphore which can be initialised with theOPeratorLEVEL.

Complex types can be created from simpler ones using various type constructors:

  • REFmode – a reference to a value of typemode, similar to& in C/C++ andREF in Pascal
  • STRUCT – used to build structures, likeSTRUCT in C/C++ andRECORD in Pascal
  • UNION – used to build unions, like in C/C++ and Pascal
  • PROC – used to specify procedures, like functions in C/C++ and procedures/functions in Pascal

Other declaration symbols include:FLEX,HEAP,LOC,REF,LONG,SHORT,EVENTS

  • FLEX – declare the array to be flexible, i.e. it can grow in length on demand.
  • HEAP – allocate variable some free space from the global heap.
  • LOC – allocate variable some free space of the local stack.
  • LONG – declare anINT,REAL orCOMPL to be of aLONGer size.
  • SHORT – declare anINT,REAL orCOMPL to be of aSHORTer size.

A name for a mode (type) can be declared using aMODE declaration,which is similar toTYPEDEF in C/C++ andTYPE in Pascal:

INT max=99;MODE newmode = [0:9][0:max]STRUCT (LONGREAL a, b, c,SHORTINT i, j, k,REFREAL r );

This is similar to the following C code:

constintmax=99;typedefstruct{doublea,b,c;shorti,j,k;float*r;}newmode[9+1][max+1];

For ALGOL 68, only theNEWMODE mode-indication appears to the left of the equals symbol, and most notably the construction is made, and can be read, from left to right without regard to priorities. Also, thelower bound of Algol 68 arrays is one by default, but can be any integer from -max int tomax int.

Mode declarations allow types to berecursive: defined directly or indirectly in terms of themselves.This is subject to some restrictions – for instance, these declarations are illegal:

MODEA =REFAMODEA =STRUCT (A a,B b)MODEA =PROC (A a)A

while these are valid:

MODEA =STRUCT (REFA a,B b)MODEA =PROC (REFA a)REFA

Coercions: casting

[edit]

Thecoercions produce a coercee from a coercend according to three criteria: the a priori mode of the coercend before the application of any coercion, the a posteriori mode of the coercee required after those coercions, and the syntactic position or "sort" of the coercee. Coercions may be cascaded.

The six possible coercions are termeddeproceduring,dereferencing,uniting,widening,rowing, andvoiding. Each coercion, except foruniting, prescribes a corresponding dynamic effect on the associated values. Hence, many primitive actions can be programmed implicitly by coercions.

Context strength – allowed coercions:

  • soft – deproceduring
  • weak – dereferencing or deproceduring, yielding a name
  • meek – dereferencing or deproceduring
  • firm – meek, followed by uniting
  • strong – firm, followed by widening, rowing or voiding

Coercion hierarchy with examples

[edit]

ALGOL 68 has a hierarchy of contexts which determine the kind of coercions available at a particular point in the program. These contexts are:

Context
Context locationCoercions availableCoercion examples in the context
Soft
Weak
Meek
Firm
Strong
Strong
Right hand side of:
  • Identity-declarations, as "~" in:REAL x = ~
  • Initialisations, as "~" in:REAL x := ~

Also:

  • Actual-parameters of calls, as "~" in:PROC: sin(~)
  • Enclosed clauses of casts, as "~" in:REAL(~)
  • Units of routine-texts
  • Statements yieldingVOID
  • All parts (but one) of a balanced clause
  • One side of an identity relation, as "~" in: ~IS ~
deproc​edur​ing
AllSOFT then weak derefer​encing (deref​erencing or deproc​eduring, yield​ing a name)
AllWEAK then derefer​enc​ing (deref​erenc​ing or deproc​edur​ing)
AllMEEK then unit​ing
AllFIRM then widen​ing, rowing or voiding

Widening is always applied in theINT toREAL toCOMPL direction, provided the modes have the same size. For example: AnINT will be coerced to aREAL, but not vice versa. Examples:

  • toREAL fromINT
  • toCOMPL fromREAL
  • to []BOOL fromBITS
  • to []CHAR fromBYTES

A variable can also be coerced (rowed) to an array of length 1.

For example:

  • to [1]INT fromINT
  • to [1]REAL fromREAL etc.
Firm
  • Operands of formulas as "~" in:~OP ~
  • Parameters of transput calls
Example:

UNION(INT,REAL) var := 1

Meek
  • Trimscripts (yieldingINT)
  • Enquiries: e.g. as "~" in the following

IF ~THEN ...FI andFROM ~BY ~TO ~WHILE ~DO ...OD etc

  • Primaries of calls (e.g. sin in sin(x))
Examples:
  • toBOOL fromREFREFBOOL
  • toINT fromREFREFREFINT
Weak
  • Primaries of slices, as in "~" in:~[1:99]
  • Secondaries of selections, as "~" in:valueOF ~
Examples:
  • toREFINT fromREFREFINT
  • toREFREAL fromREFREFREFREAL
  • toREFSTRUCT fromREFREFREFREFSTRUCT
Soft
The LHS of assignments, as "~" in:~ := ...Example:
  • deproceduring of:PROCREAL random: e.g. random

For more details about Primaries, Secondaries, Tertiary & Quaternaries refer toOperator precedence.

pr & co: Pragmats and Comments

[edit]

Pragmats aredirectives in the program, typically hints to the compiler; in newer languages these are called "pragmas" (no 't'). e.g.

PRAGMAT heap=32PRAGMATPR heap=32PR

Comments can be inserted in a variety of ways:

¢ The original way of adding your 2 cents worth to a program ¢COMMENT "bold" commentCOMMENTCO Style i commentCO# Style ii comment #£ This is a hash/pound comment for a UK keyboard £

Normally, comments cannot be nested in ALGOL 68. This restriction can be circumvented by using different comment delimiters (e.g. use hash only for temporary code deletions).

Expressions and compound statements

[edit]

ALGOL 68 being anexpression-oriented programming language, the value returned by anassignment statement is a reference to the destination. Thus, the following is valid ALGOL 68 code:

REAL half pi, one pi; one pi := 2 * ( half pi := 2 * arc tan(1) )

This notion is present inC andPerl, among others. Note that as in earlier languages such asAlgol 60 andFORTRAN, spaces are allowed in identifiers, so thathalf pi is asingle identifier (thus avoiding theunderscores versuscamel case versusall lower-case issues).

As another example, to express the mathematical idea of asum off(i) from i=1 to n, the following ALGOL 68integer expression suffices:

 (INT sum := 0;FOR iTO nDO sum +:= f(i)OD; sum)

Note that, being an integer expression, the former block of code can be used inany context where an integer value can be used. A block of code returns the value of the last expression it evaluated; this idea is present inLisp, among other languages.

Compound statements are all terminated by distinctive closing brackets:

  • IF choice clauses:
IF conditionTHEN statements [ELSE statements ]FI "brief" form:  ( condition | statements | statements )
IF condition1THEN statementsELIF condition2THEN statements [ELSE statements ]FI "brief" form:  ( condition1 | statements |: condition2 | statements | statements )

This scheme not only avoids thedangling else problem but also avoids having to useBEGIN andEND in embeddedstatement sequences.

  • CASE choice clauses:
CASE switchIN statements, statements,... [OUT statements ]ESAC "brief" form:  ( switch | statements,statements,... | statements )
CASE switch1IN statements, statements,...OUSE switch2IN statements, statements,... [OUT statements ]ESAC "brief" form ofCASE statement:  ( switch1 | statements,statements,... |: switch2 | statements,statements,... | statements )

Choice clause example withBrief symbols:

PROC days in month = (INT year, month)INT:  (month|    31,    (year÷×4=0 ∧ year÷×100≠0  ∨  year÷×400=0 | 29 | 28 ),    31, 30, 31, 30, 31, 31, 30, 31, 30, 31  );

Choice clause example withBold symbols:

PROC days in month = (INT year, month)INT:CASE monthIN    31,IF yearMOD 4EQ 0AND yearMOD 100NE 0OR  yearMOD 400EQ 0THEN 29ELSE 28FI,    31, 30, 31, 30, 31, 31, 30, 31, 30, 31ESAC;

Choice clause example mixingBold andBrief symbols:

PROC days in month = (INT year, month)INT:CASE monthIN¢Jan¢ 31,¢Feb¢ ( yearMOD 4 = 0AND yearMOD 100 ≠ 0OR  yearMOD 400 = 0 | 29 | 28 ),¢Mar¢ 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 ¢ to Dec. ¢ESAC;

Algol68 allowed the switch to be of either typeINTor (uniquely)UNION. The latter allows the enforcingstrong typing ontoUNION variables. c.f.union below for example.

  • do loop clause:
 [FOR index ] [FROM first ] [BY increment ] [TO last ] [WHILE condition ]DO statementsOD The minimum form of a "loop clause" is thus:DO statementsOD

This was consideredthe "universal" loop, the full syntax is:

FOR iFROM 1BY -22TO -333WHILE i×i≠4444DO ~OD

The construct have several unusual aspects:

  • only theDO ~OD portion was compulsory, in which case the loop will iterate indefinitely.
  • thus the clauseTO 100DO ~OD, will iterate only 100 times.
  • theWHILE "syntactic element" allowed a programmer to break from aFOR loop early. e.g.
INT sum sq:=0;FOR iWHILE  print(("So far:",i,newline));  sum sq≠70↑2DO  sum sq+:=i↑2OD

Subsequent "extensions" to the standard Algol68 allowed theTO syntactic element to be replaced withUPTO andDOWNTO to achieve a small optimisation. The same compilers also incorporated:

  • UNTIL(C) – for late loop termination.
  • FOREACH(S) – for working on arrays inparallel.

Further examples can be found in the code examples below.

struct, union &[:]: Structures, unions and arrays

[edit]

ALGOL 68 supportsarrays with any number of dimensions, and it allows for theslicing of whole or partial rows or columns.

MODEVECTOR = [1:3]REAL;# vectorMODE declaration (typedef)  #MODEMATRIX = [1:3,1:3]REAL;# matrixMODE declaration (typedef)  #VECTOR v1  := (1,2,3);# array variable initially (1,2,3)   # []REAL v2   = (4,5,6);# constant array, type equivalent toVECTOR, bounds are implied  #OP + = (VECTOR a,b)VECTOR:# binaryOPerator definition         #   (VECTOR out;FOR iFROM ⌊aTO ⌈aDO out[i] := a[i]+b[i]OD; out);MATRIX m := (v1, v2, v1+v2); print ((m[,2:]));# a slice of the 2nd and 3rd columns #

Matrices can be sliced either way, e.g.:

REFVECTOR row = m[2,];# define aREF (pointer) to the 2nd row #REFVECTOR col = m[,2];# define aREF (pointer) to the 2nd column #

ALGOL 68 supports multiple field structures (STRUCT) andunited modes. Reference variables may point to anyMODE including array slices and structure fields.

For an example of all this, here is the traditional linked list declaration:

MODENODE =UNION (VOID,REAL,INT,COMPL,STRING),LIST =STRUCT (NODE val,REFLIST next);

Usage example forUNIONCASE ofNODE:

Algol68r0 as in the 1968 Final ReportAlgol68r1 as in the 1973 Revised Report
NODE n := "1234";REAL r;INT i;COMPL c;STRING sCASE r,i,c,s::=nIN   print(("real:", r)),   print(("int:", i)),   print(("compl:", c)),   print(("string:", s))OUT print(("?:", n))ESAC
NODE n := "1234"; # or n := EMPTY; #CASE nIN   (VOID):     print(("void:", "EMPTY")),   (REAL r):   print(("real:", r)),   (INT i):    print(("int:", i)),   (COMPL c):  print(("compl:", c)),   (STRING s): print(("string:", s))OUT         print(("?:", n))ESAC

proc: Procedures

[edit]

Procedure (PROC) declarations require type specifications for both the parameters and the result (VOID if none):

PROC max of real = (REAL a, b)REAL:IF a > bTHEN aELSE bFI;

or, using the "brief" form of the conditional statement:

PROC max of real = (REAL a, b)REAL: (a>b | a | b);

The return value of aproc is the value of the last expression evaluated in the procedure. References to procedures (ref proc) are also permitted.Call-by-reference parameters are provided by specifying references (such asref real) in the formal argument list. The following example defines a procedure that applies a function (specified as a parameter) to each element of an array:

PROC apply = (REF []REAL a,PROC (REAL)REAL f):  FOR iFROMLWB aTOUPB aDO a[i] := f(a[i])OD

This simplicity of code was unachievable in ALGOL 68's predecessorALGOL 60.

op: Operators

[edit]

The programmer may define newoperators andboth those and the pre-defined ones may beoverloaded and their priorities may be changed by the coder. The following example defines operatorMAX with both dyadic and monadic versions (scanning across the elements of an array).

PRIOMAX = 9;  OPMAX = (INT a,b)INT: ( a>b | a | b );OPMAX = (REAL a,b)REAL: ( a>b | a | b );OPMAX = (COMPL a,b)COMPL: (ABS a >ABS b | a | b );  OPMAX = ([]REAL a)REAL:    (REAL out := a[LWB a];FOR iFROMLWB a + 1TOUPB aDO ( a[i]>out | out:=a[i] )OD;     out)

Array, Procedure, Dereference and coercion operations

[edit]
PRIOrityOperationr0&r1+Algol68r0+Algol68G
Effectively 12
(Primary)
dereferencing, deproceduring(~,~), subscripting[~], rowing[~,], slicing[~:~], size denotationsLONG &SHORTproceduringcurrying(~,,,),DIAG,TRNSP,ROW,COL
Effectively 11
(Secondary)
OF (selection),LOC &HEAP (generators)→ (selection)NEW (generators)

These are technically not operators, rather they are considered "units associated with names"

Monadic operators

[edit]
PRIOrity
(Tertiary)
Algol68 "Worthy characters[6]"r0&r1+Algol68r0&r1+Algol68C,G+Algol68r0
10NOT ~,UP,DOWN,LWB,UPB,

-,ABS,ARG,BIN,ENTIER,LENG,LEVEL,ODD,REPR,ROUND,SHORTEN

¬, ↑, ↓, ⌊, ⌈NORM,TRACE,T,DET,INVLWS,UPS, ⎩, ⎧,BTB,CTB

Dyadic operators with associated priorities

[edit]
PRIOrity
(Tertiary)
Algol68 "Worthy characters"r0&r1+Algol68r0&r1+Algol68C,G+Algol68r0
9+*,I+×, ⊥!
8SHL,SHR, **,UP,DOWN,LWB,UPB↑, ↓, ⌊, ⌈××, ^,LWS,UPS, ⎩, ⎧
7*, /,  %,OVER,  %*,MOD,ELEM×, ÷, ÷×, ÷*, %×, □÷:
6-, +
5<,LT, <=,LE, >=,GE, >,GT≤, ≥
4EQ =,NE ~= /=≠, ¬=
3&,AND/\
2OR\/
1MINUSAB,PLUSAB,TIMESAB,DIVAB,OVERAB,MODAB,PLUSTO,

-:=, +:=, *:=, /:=, %:=, %*:=, +=:

×:=, ÷:=, ÷×:=, ÷*:=,  %×:=MINUS,PLUS,DIV,OVERB,MODB, ÷::=,PRUS

Specific details:

  • Tertiaries include namesNIL and ○.
  • LWS: In Algol68r0 the operatorsLWS and ⎩ ... both returnTRUE if thelower state of the dimension of an array is fixed.
  • TheUPS and ⎧ operators are similar on theupper state.
  • TheLWB andUPB operators are automatically available onUNIONs of different orders (andMODEs) of arrays. eg.UPB ofunion([]int, [,]real, flex[,,,]char)

Assignation and identity relations, etc.

[edit]

These are technically not operators, rather they are considered "units associated with names"

PRIOrity
(Quaternaries)
Algol68 "Worthy characters"r0&r1+Algol68r0&r1+Algol68C,G,R+Algol68r0
Effectively 0:=,IS :=:,ISNT :/=: :~=:,AT @, ":", ";":≠: :¬=::=:=C, =:=R..=, .=,CT, ::,CTAB, ::=, ..,is not, "..", ".,"

Note: Quaternaries include namesSKIP and ~.

:=: (alternativelyIS) tests if two pointers are equal;:/=: (alternativelyISNT) tests if they are unequal.

Why:=: and:/=: are needed
[edit]

Consider trying to compare two pointer values, such as the following variables, declared as pointers-to-integer:

REFINT ip, jp

Now consider how to decide whether these two are pointing to the same location, or whether one of them is pointing toNIL. The following expression

ip = jp

will dereference both pointers down to values of typeINT, and compare those, since the= operator is defined forINT, but notREFINT. It isnot legal to define= for operands of typeREFINT andINT at the same time, because then calls become ambiguous, due to the implicit coercions that can be applied: should the operands be left asREFINT and that version of the operator called? Or should they be dereferenced further toINT 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 expressions:

ip :=: jp
ip :=:NIL

while legal, will probably not do what might be expected. They will always returnFALSE, because they are comparing theactual addresses of the variablesip andjp, rather than what they point to. To achieve the right effect, one would have to write

ip :=:REFINT(jp)
ip :=:REFINT(NIL)

Special characters

[edit]
IBM 2741 keyboard with APL symbols

Most of Algol's "special" characters (⊂, ≡, ␣, ×, ÷, ≤, ≥, ≠, ¬, ⊃, ≡, ∨, ∧, →, ↓, ↑, ⌊, ⌈, ⎩, ⎧, ⊥, ⏨, ¢, ○ and □) can be found on theIBM 2741 keyboard with theAPL "golf-ball" print head inserted; these became available in the mid-1960s while ALGOL 68 was being drafted. These characters are also part of theUnicode standard and most of them are available in several popularfonts.

transput: Input and output

[edit]

Transput is the term used to refer to ALGOL 68's input and output facilities. It includes 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 thestandard output device:

  print ((newpage, "Title", newline, "Value of i is ",    i, "and x[i] is ", x[i], newline))

Note the predefined proceduresnewpage andnewline passed as arguments.

Books, channels and files

[edit]

TheTRANSPUT is considered to be ofBOOKS,CHANNELS andFILES:

  • Books are made up of pages, lines and characters, and may be backed up by files.
    • A specific book can be located by name with a call tomatch.
  • CHANNELs correspond to physical devices. e.g. card punches and printers.
    • Three standard channels are distinguished:stand in channel,stand out channel,stand back channel.
  • AFILE is a means of communicating between a program and a book that has been opened via some channel.
    • TheMOOD 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, andPROC set=(REFFILE f,INT page,line,char)VOID:
    • A file hasevent routines. e.g.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

[edit]

"Formatted transput" in ALGOL 68's transput has its own syntax and patterns (functions), withFORMATs embedded between two $ characters.[54]

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))

par: Parallel processing

[edit]

ALGOL 68 supports programming of parallel processing. Using the keywordPAR, acollateral clause is converted to aparallel clause, where the synchronisation of actions is controlled usingsemaphores. In A68G the parallel actions are mapped to threads when available on the hostingoperating system. In A68S a different paradigm of parallel processing was implemented (see below).

PROC    eat =VOID: ( muffins-:=1; print(("Yum!",new line))),    speak =VOID: ( words-:=1; print(("Yak...",new line))); INT muffins := 4, words := 8;SEMA mouth =LEVEL 1; PARBEGINWHILE muffins > 0DODOWN mouth;        eat;UP mouthOD,WHILE words > 0DODOWN mouth;        speak;UP mouthODEND

Miscellaneous

[edit]

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,EMPTY – the only value admissible toVOID, needed for selectingVOID in aUNION,VOID – syntactically like aMODE, but not one,NIL or "○" – a name not denoting anything, of an unspecified reference mode,() or specifically [1:0]INT – avacuum is an empty array (here specifically ofMODE []INT).undefined – a standards reports procedure raising an exception in the runtime system.ℵ – Used in the standards report to inhibitintrospection of certain types. e.g.SEMA

The termNILISvar always evaluates toTRUE for any variable (but see above for correct use ofIS :/=:), whereas it is not known to which value a comparisonx <SKIP evaluates for any integerx.

ALGOL 68 leaves intentionally undefined what happens in case ofinteger overflow, the integer bit representation, and the degree of numerical accuracy for floating point.

Both official reports included some advanced features that were not part of the standard language. These were indicated with an ℵ and considered effectively private. Examples include "≮" and "≯" for templates, theOUTTYPE/INTYPE for crudeduck typing, and theSTRAIGHTOUT andSTRAIGHTIN operators for "straightening" nested arrays and structures

Examples of use

[edit]

Code sample

[edit]

This sample program implements theSieve of Eratosthenes to find all theprime numbers that are less than 100.NIL is the ALGOL 68 analogue of thenull pointer in other languages. The notationxOFy accesses a memberx of aSTRUCTy.

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:     (PROC f = (INT m,n)LIST: (m>n |NIL | cons(m, f(m+1,n))); f(1,n));  MODELIST =REFNODE;MODENODE =STRUCT (INT h,LIST t);PROC cons = (INT n,LIST l)LIST:HEAPNODE := (n,l);PROC hd   = (LIST l)INT: ( lISNIL | error("hdNIL");SKIP | hOF l );PROC tl   = (LIST l)LIST: ( lISNIL | error("tlNIL");SKIP | tOF l );PROC show = (LIST l)VOID: ( lISNTNIL | print((" ",whole(hd(l),0))); show(tl(l)));  PROC filter = (PROC (INT)BOOL p,LIST l)LIST:IF lISNILTHENNILELIF p(hd(l))THEN cons(hd(l), filter(p,tl(l)))ELSE filter(p, tl(l))FI;  PROC sieve = (LIST l)LIST:IF lISNILTHENNILELSEPROC not multiple = (INT n)BOOL: nMOD hd(l) ~= 0;        cons(hd(l), sieve( filter( not multiple, tl(l) )))FI;  PROC primes = (INT n)LIST: sieve( tl( one to(n) ));    show( primes(100) )END

Operating systems written in ALGOL 68

[edit]
  • Cambridge CAP computer – All procedures constituting the operating system were written inALGOL 68C, although several other closely associated protected procedures, such as a paginator, are written inBCPL.[55]
  • Eldon 3 – Developed atLeeds University for theICL 1900 was written inALGOL 68-R.[56]
  • Flex machine – The hardware was custom and microprogrammable, with an operating system, (modular) compiler, editor, garbage collector and filing system all written inALGOL 68RS. The command shell Curt[57] was designed to access typed data similar to Algol-68 modes.
  • VMES3 was the implementation language of theoperating system VME. S3 was based on ALGOL 68 but with data types and operators aligned to those offered by theICL 2900 Series.

Note: The Soviet Era computersЭльбрус-1 (Elbrus-1) and Эльбрус-2 were created using high-level language Эль-76 (AL-76), rather than the traditional assembly. Эль-76 resembles Algol-68, The main difference is the dynamic binding types in Эль-76 supported at the hardware level. Эль-76 is used for application, job control, system programming.[58]

Applications

[edit]

BothALGOL 68C andALGOL 68-R are written in ALGOL 68, effectively making ALGOL 68 an application of itself. Other applications include:

Libraries and APIs

[edit]

Program representation

[edit]

A feature of ALGOL 68, inherited from theALGOL tradition, is its different representations. There is arepresentation language used to describe algorithms in printed work, astrict language (rigorously defined in the Report), and an officialreference language intended to be used in compiler input. The examples containBOLD typeface words, this is theSTRICT language. ALGOL 68's reserved words are effectively in a differentnamespace from identifiers, and spaces are allowed in identifiers, so this next fragment is legal:

INT a real int = 3 ;

The programmer who writes executable code does not always have an option ofBOLD typeface orunderlining in the code as this may depend on hardware and cultural issues. Different methods to denote these identifiers have been devised. This is called astropping regime. For example, all or some of the following may be availableprogramming representations:

INT a real int = 3; # theSTRICT language #'INT'A REAL INT = 3; # QUOTE stropping style #.INT A REAL INT = 3; # POINT stropping style # INT a real int = 3; # UPPER stropping style # int a_real_int = 3; # RES stropping style, there are 61 accepted reserved words #

All implementations must recognize at least POINT, UPPER and RES inside PRAGMAT sections. Of these, POINT and UPPER stropping are quite common, while RES stropping is a contradiction to the specification (as there are no reserved words). QUOTE (single apostrophe quoting) was the original recommendation, while matched apostrophe quoting, common in ALGOL 60, is not used much in ALGOL 68.[61]

The following characters were recommended for portability, and termed "worthy characters" in theReport on the Standard Hardware Representation of Algol 68Archived 2014-01-02 at theWayback Machine:

  • ^ Worthy Characters: ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789 "#$%'()*+,-./:;<=>@[ ]_|

This reflected a problem in the 1960s where some hardware didn't support lower-case, nor some other non-ASCII characters, indeed in the 1973 report it was written: "Four worthy characters — "|", "_", "[", and "]" — are often coded differently, even at installations which nominally use the same character set."

  • Base characters: "Worthy characters" are a subset of "base characters".

Example of different program representations

[edit]
RepresentationCode
Algol68 "strict"
as typically published
¢ underline orbold typeface ¢MODEXINT =INT;XINT sum sq:=0;FOR iWHILE   sum sq≠70×70DO   sum sq+:=i↑2OD
Quote stropping
(likewikitext)
'pr' quote 'pr''mode' 'xint' = 'int';'xint' sum sq:=0;'for' i 'while'  sum sq≠70×70'do'  sum sq+:=i↑2'od'
For a7-bit character code compiler
PR UPPER PRMODE XINT = INT;XINT sum sq:=0;FOR i WHILE  sum sq/=70*70DO  sum sq+:=i**2OD
For a6-bit character code compiler
.PRPOINT.PR.MODE.XINT=.INT;.XINTSUMSQ:=0;.FORI.WHILE  SUM SQ .NE 70*70.DO  SUM SQ .PLUSAB I .UP 2.OD
Algol68 usingRES stropping
(reserved word)
.PRRES.PRmode .xint = int;.xintsumsq:=0;for i while  sum sq≠70×70do  sum sq+:=i↑2od

ALGOL 68 allows for every natural language to define its own set of keywords Algol-68. As a result, programmers are able to write programs using keywords from their native language. Below is an example of a simple procedure that calculates "the day following", the code is in two languages: English and German.[citation needed]

 # Next day date - English variant #MODEDATE =STRUCT(INT day,STRING month,INT year);PROC the day following = (DATE x)DATE:IF dayOF  x < length of month (monthOF x, yearOF x)THEN (dayOF x + 1, monthOF x, yearOF x)ELIF monthOF x = "December"THEN (1, "January", yearOF x + 1)ELSE (1, successor of month (monthOF x), yearOF x)FI;
 # Nachfolgetag - Deutsche Variante #MENGEDATUM =TUPEL(GANZ tag,WORT monat,GANZ jahr);FUNKTION naechster tag nach = (DATUM x)DATUM:WENN tagVON x < monatslaenge(monatVON x, jahrVON x)DANN (tagVON x + 1, monatVON x, jahrVON x)WENNABER monatVON x = "Dezember"DANN (1, "Januar", jahrVON x + 1)ANSONSTEN (1, nachfolgemonat(monatVON x), jahrVON x)ENDEWENN;

Russian/Soviet example:In English Algol68's case statement readsCASE ~IN ~OUT ~ESAC, inCyrillic this readsвыб ~в ~либо ~быв.

Revisions

[edit]

Except where noted (with asuperscript), the language described above is that of the "Revised Report(r1)".

The language of the unrevised report

[edit]

The original language (As per the "Final Report"r0) differs in syntax of themode cast, and it had the feature ofproceduring, i.e. coercing the value of a term into a procedure which evaluates the term. Proceduring would be intended to make evaluationslazy. The most useful application could have been the short-circuited evaluation of Boolean operators. In:

OPANDF = (BOOL a,PROCBOOL b)BOOL:(a | b |FALSE);OPORF = (BOOL a,PROCBOOL b)BOOL:(a |TRUE | b);

b is only evaluated ifa is true.

As defined in ALGOL 68, it did not work as expected, for example in the code:

IFFALSEANDFCO proc bool:CO ( print ("Should not be executed");TRUE)THEN ...

against the programmers naïve expectations the printwould be executed as it is only thevalue of the elaborated enclosed-clause afterANDF that was procedured. Textual insertion of the commented-outPROCBOOL: makes it work.

Some implementations emulate the expected behaviour for this special case by extension of the language.

Before revision, the programmer could decide to have the arguments of a procedure evaluated serially instead of collaterally by using semicolons instead of commas (gommas).

For example in:

PROC test = (REAL a;REAL b) :......test (xPLUS 1, x);

The first argument to test is guaranteed to be evaluated before the second, but in the usual:

PROC test = (REAL a, b) :......test (xPLUS 1, x);

then the compiler could evaluate the arguments in whatever order it felt like.

Extension proposals from IFIP WG 2.1

[edit]

After the revision of the report, some extensions to the language have been proposed to widen the applicability:

  • partial parametrisation (akaCurrying): creation of functions (with fewer parameters) by specification of some, but not all parameters for a call, e.g. a function logarithm of two parameters, base and argument, could be specialised to natural, binary or decadic log,[62]
  • module extension: for support of external linkage, two mechanisms were proposed, bottom-updefinition modules, a more powerful version of the facilities fromALGOL 68-R and top-downholes, similar to theENVIRON andUSING clauses fromALGOL 68C[63]
  • mode parameters: for implementation of limited parametrical polymorphism (most operations on data structures like lists, trees or other data containers can be specified without touching the pay load).[64]

So far, only partial parametrisation has been implemented, in Algol 68 Genie.

True ALGOL 68s specification and implementation timeline

[edit]
NameYearPurposeStateDescriptionTarget CPULicensingImplementation language
Generalized ALGOL1962Scientific NLDALGOL for generalised grammars
ALGOL YY1966Draft proposalIntlFirst version of Algol 68SpecificationACM
ALGOL 68DR1968Draft proposalIntlIFIP WG 2.1 Draft ReportSpecification – MarchACM
ALGOL 68r01968StandardIntlIFIP WG 2.1 Final ReportSpecification – AugustACM
ALGOL 68-RR1970Military UKICL 1900ALGOL 60
EPOS ALGOLE1971Scientific
ALGOL 68RSRS1972Military UKPortable compiler systemICL 2900/Series 39, Multics, VMS &C generator (1993)Crown CopyrightALGOL 68RS
Algol 68 with areas1972Experimental & other UKAddition of areas to Algol 68
Mini ALGOL 681973Research NLD"An interpreter for simple Algol 68 Programs"Archived 2011-07-18 at theWayback MachinePortable interpreterMathematisch CentrumALGOL 60
OREGANO1973Research US"The importance of implementation models."UCLA
ALGOL 68CC1975Scientific UKCambridge Algol 68ICL, IBM 360, PDP 10 & Unix,Telefunken, Tesla &Z80 (1980)[65]CambridgeALGOL 68C
ALGOL 68 Revised Reportr11975StandardIntlIFIP WG 2.1 Revised ReportSpecificationACM
Algol HH1975Experimental & other UKProposed extensions to the mode system of Algol 68SpecificationALGOL W
Odra Algol 681976practical uses Soviet Union/ PolandOdra 1204/ILSovietALGOL 60
Oklahoma ALGOL 681976programming instruction USAOklahoma State University implementation[66]IBM 1130 andSystem/370/158UnknownANSIFortran 66.
Berlin ALGOL 681977Research DE"The Berlin ALGOL 68 implementation" &[67]An Abstract ALGOL 68 Machine – machine independent CompilerTechnische Universität BerlinCDL 2
FLACCF1977Multi-purpose CANRevised Report complete implementation with debug featuresSystem/370lease, Chion CorporationAssembler
ALGOL 68-RTRT1979Scientific UKParallel ALGOL 68-R
RS Algolrs1979Scientific UK
ALGOL 68+1980Scientific NLDProposed superlanguage of ALGOL 68[68]
M-220 ALGOL 68 Soviet UnionM-220SovietEPSILON
Leningrad ALGOL 68L1980Telecommunications Soviet UnionFull language + modulesIBM, DEC, CAMCOH, PS 1001 & PCSoviet
Interactive ALGOL 68I1983 UKIncremental compilationPCNoncommercialshareware
ALGOL 68SS1985ScientificIntlSun version of ALGOL 68Sun-3, SunSPARC (underSunOS 4.1 &Solaris 2),Atari ST (underGEMDOS),Acorn Archimedes (underRISC OS),VAX-11 underUltrix-32
Algol68toC[69] (ctrans)1985Electronics UKctrans fromELLAALGOL 68RSPortable C generator Open-source software (1995)ALGOL 68RS
MK2Interactive ALGOL 681992 UKIncremental compilationPCNoncommercial shareware[70]
Algol 68 GenieG2001Full language NLDIncludes standard collateral clausePortable interpreterGPLC
Algol 68 Genie version 2.0.02010Full language NLDPortable interpreter; optional compilation of selected unitsGPLC
GCC (ga68)2025Full language ESPGCC Front-EndPortable compilerGPLC

TheS3 language that was used to write theICL VME operating system and much other system software on theICL 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.

Implementation specific extensions

[edit]

ALGOL 68R fromRRE was the first ALGOL 68 subset implementation, running on theICL 1900. Based on the original language, the main subset restrictions weredefinition before use and no parallel processing. This compiler was popular inUK universities in the 1970s, where manycomputer science students learnt ALGOL 68 as their first programming language; the compiler was renowned for good error messages.

ALGOL 68RS(RS) fromRSRE was a portable compiler system written in ALGOL 68RS (bootstrapped from ALGOL 68R), and implemented on a variety of systems including theICL 2900/Series 39,Multics andDEC 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) fromCarnegie Mellon University the power of parallel processing was improved by adding an orthogonal extension,eventing. Any variable declaration containing keywordEVENT 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 theC.mmp multiprocessor system. Accesses to such variables were delayed after termination of the assignment.

CambridgeALGOL 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 68 Genie(G) by M. van der Veer is an ALGOL 68 implementation for today's computers and operating systems.

"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."[71]

Quotes

[edit]
  • ... 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.[2]
  • ... 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 1988[4]
  • "Congratulations, your Master has done it" –Niklaus Wirth[72]
  • The more I see of it, the more unhappy I become – E. W. Dijkstra, 1968[73]
  • [...] it was said that A68's popularity was inversely proportional to [...] the distance from AmsterdamGuido van Rossum[74]
  • [...] The best we could do was to send with it a minority report, stating our considered view that, "... as a tool for the reliable creation of sophisticated programs, the language was a failure." [...]C. A. R. Hoare in his Oct 1980Turing Award Lecture[75]
  • "[...] 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 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. [...]" 1968 Working Group minority report on 23 December 1968.[76]

See also

[edit]

References

[edit]

Citations

[edit]
  1. ^van Wijngaarden, Adriaan;Mailloux, Barry James;Peck, John Edward Lancelot;Koster, Cornelis Hermanus Antonius;Sintzoff, Michel[in French];Lindsey, Charles Hodgson;Meertens, Lambert Guillaume Louis Théodore; Fisker, Richard G., eds. (1976).Revised Report on the Algorithmic Language ALGOL 68(PDF).Springer-Verlag.ISBN 978-0-387-07592-1.OCLC 1991170.Archived(PDF) from the original on 2019-04-19. Retrieved2019-05-11.
  2. ^abDennis Ritchie (April 1993)."The Development of the C Language"(PDF). Archived fromthe original(PDF) on 2005-11-06. Retrieved2007-04-26.
  3. ^Influence on C: types, structures, arrays, pointers and procedures – Dennis Ritchie[2]
  4. ^abDennis Ritchie (June 1988)."C and Algol 68". Retrieved2006-09-15.
  5. ^Influence on C: union, structure, syntax and long precision – Dennis Ritchie[4]
  6. ^"A History of C++: 1979−1991"(PDF). March 1993. Page 12, 2nd paragraph: Algol68 [gave] operator overloading(§3.3.3), references (§3.3.4), and the ability to declare variables anywhere in a block (§3.3.1). Retrieved2008-05-06.
  7. ^"Interview with Guido van Rossum". July 1998. Archived fromthe original on 2007-05-01. Retrieved2007-04-29.
  8. ^"A Shorter History of ALGOL 68". Archived fromthe original on 2006-08-10. Retrieved2006-09-15.
  9. ^Veer, Marcel van der (2023-04-05)."Revised Report on the Algorithmic Language Algol 68".jmvdveer.home.xs4all.nl/. Archived fromthe original on 2013-03-17.
  10. ^Veer, Marcel van der (2023-04-05)."Revised Report on the Algorithmic Language Algol 68".jmvdveer.home.xs4all.nl/. Archived fromthe original on 2013-03-17.
  11. ^Veer, Marcel van der (2023-04-05)."Revised Report on the Algorithmic Language Algol 68".jmvdveer.home.xs4all.nl/. Archived fromthe original on 2013-03-17.
  12. ^Veer, Marcel van der (2023-04-05)."Revised Report on the Algorithmic Language Algol 68".jmvdveer.home.xs4all.nl/. Archived fromthe original on 2013-03-17.
  13. ^"Gommas?".
  14. ^Revised Report on the Algorithmic Language Algol 68Archived 2013-03-17 at theWayback Machine. jmvdveer.home.xs4all.nl (1968-12-20). Retrieved on 2013-07-21.
  15. ^Terekhov, Andrey (2014). "ALGOL 68 and Its Impact on the USSR and Russian Programming".2014 Third International Conference on Computer Technology in Russia and in the Former Soviet Union. pp. 97–106.doi:10.1109/SoRuCom.2014.29.ISBN 978-1-4799-1799-0.S2CID 16097093.
  16. ^http://toc.proceedings.com/25445webtoc.pdf "Алгол 68 и его влияние на программирование в СССР и России" – pages: 336 & 342
  17. ^Lindsey 1996.
  18. ^abLindsey, Charles H. (1996). Bergin, T. J.; Gibson, R. G. (eds.).A history of ALGOL 68.History of Programming Languages-II. Vol. 28. also in ACM SIGPLAN Notices 28(3), March 1993 (includes a comprehensive bibliography of the meetings and discussions before, during and after development of ALGOL 68).ACM Press. pp. 97–132.doi:10.1145/155360.155365.ISBN 978-0-201-89502-5.{{cite book}}:|journal= ignored (help)
  19. ^Programming Algol 68 Made Easy
  20. ^Veer, Marcel van der."Marcel van der Veer - Algol 68 Genie".jmvdveer.home.xs4all.nl/.
  21. ^Lindsey 1993, p. 7.
  22. ^abcdLindsey 1993, p. 9.
  23. ^Lindsey 1993, p. 4.
  24. ^Ross, Douglas T. (October 1966)."An Algorithmic Theory of Language (AB26.2.2)".Defense Technical Information Center. Massachusetts Institute of Technology. p. 6. Archived fromthe original on 2013-06-26. Retrieved2020-08-12.
  25. ^Ross, D. T. (August 1967)."AB26.2.2 Features Essential for a Workable ALGOL X".ACM SIGPLAN Notices: ALGOL Bulletin.26 (2). Association for Computing Machinery: Digital Library.doi:10.1145/1139498.1139500.S2CID 38156680. Retrieved2020-08-12.
  26. ^Lindsey 1993, p. 24.
  27. ^abLindsey 1993, p. 10.
  28. ^"The Algol Bulletin".
  29. ^abLindsey 1993, p. 12.
  30. ^Lindsey, C. H. (1972)."ALGOL 68 with fewer tears"(PDF).The Computer Journal.15 (1):176–188.doi:10.1093/comjnl/15.2.176.
  31. ^Lindsey 1993, p. 13.
  32. ^Lindsey 1993, p. 15.
  33. ^Hoare, C. A. R. (November 1968)."Critique of MR93 (Critique of ALGOL 68)".ALGOL Bulletin.29:27–29.
  34. ^abPeck, J. E. L., ed. (1970),Proceedings of the IFIP working conference on ALGOL 68 Implementation, Munich: North-Holland,ISBN 0-7204-2045-8
  35. ^abcdKoster, C. H. A."A Shorter History of Algol 68". Archived fromthe original on 2007-12-17.
  36. ^van der Veer, Marcel."Open source Algol 68 implementations".algol68.sourceforge.net.
  37. ^abE. Marchesi, Jose."Algol 68 Front-End".gcc.gnu.org.
  38. ^abE. Marchesi, Jose."An Algol 68 front end for GCC".lwn.net.
  39. ^Van Wijngaarden, A.; Mailloux, B. J.; Peck, J.; Koster, C. H. A. (1968-03-01)."Draft Report on the Algorithmic Language ALGOL 68".ALGOL Bulletin (Sup 26):1–84. Retrieved2023-04-07 – via Mar. 1968.
  40. ^Sidney Marshall, "ALGOL 68 Implementation",Proceedings of the IFIP Working Conference on ALGOL 68 Implementation, Munich, July 20–24, 1970, J. E. L. Peck, editor, North Holland, pages 239–243.
  41. ^Sidney Marshall,On the implementation of ALGOL 68, PhD Thesis, Dartmouth College, 1972.
  42. ^Algol 68 Revised Report
  43. ^Black, A. P.; Rayward-Smith, V. J. (1978-05-01)."Proposals for ALGOL H - A Superlanguage of ALGOL 68".ALGOL Bulletin (42):36–49. Retrieved2023-04-07 – via May. 1978.
  44. ^"Algol68 S(S) published on the internet". Archived fromthe original on 2005-12-03. Retrieved2004-08-30.
  45. ^Veer, Marcel van der."The Algol 68 Genie project".jmvdveer.home.xs4all.nl. Retrieved2023-04-07.
  46. ^"Draft Report on the Algorithmic Language ALGOL 68". March 1968.Archived from the original on 2007-09-30. Retrieved2007-06-22.
  47. ^"Penultimate Draft Report on the Algorithmic Language ALGOL 68 – Chapters 1-9"(PDF). October 1968. Retrieved2007-06-22.[permanent dead link]
  48. ^"Penultimate Draft Report on the Algorithmic Language ALGOL 68 – Chapters 10-12"(PDF). October 1968. Retrieved2007-06-22.[permanent dead link]
  49. ^"Report on the Algorithmic Language ALGOL 68"(PDF). December 1968. Archived fromthe original(PDF) on 2008-04-06. Retrieved2007-12-30.
  50. ^"Revised Report on the Algorithmic Language Algol 68". September 1973.Archived from the original on 2007-09-27. Retrieved2007-04-30.
  51. ^Lu Hu-quan (1971)."The Translation of Algol 68 into Chinese"(PDF). Peking, China: Institute of Mathematics, Academia Sinica. Retrieved2012-08-17.
  52. ^"GOST 27974-88 Programming language ALGOL 68 – Язык программирования АЛГОЛ 68"(PDF) (in Russian).GOST. 1988. Archived fromthe original(PDF) on 2008-11-15. Retrieved2008-11-15.
  53. ^"GOST 27975-88 Programming language ALGOL 68 extended – Язык программирования АЛГОЛ 68 расширенный"(PDF) (in Russian).GOST. 1988. Archived fromthe original(PDF) on 2011-04-29. Retrieved2008-11-15.
  54. ^"Format syntax in ALGOL 68G". Archived fromthe original on 2008-01-09. Retrieved2023-04-07.
  55. ^Needham, R. M.; Wilkes, M. V. (January 1979)."The Cambridge CAP Computer and its Operating System"(PDF).Microsoft Research.
  56. ^David Holdsworth (Winter 2009–2010)."KDF9 Time Sharing: Eldon 2 is not EGDON!".Computer Resurrection – Number 49.Computer Conservation Society. Retrieved2010-10-03.
  57. ^I F Currie; J M Foster (September 1982)."RSRE Memorandum"(PDF).vitanuova.com. Retrieved2023-04-07.
  58. ^Эльбрус Бабаяна и Pentium Пентковского. Ixbt.com. Retrieved 21 July 2013.
  59. ^Oliver, J. R.; Newton, R. S. (1979)."Practical experience with ALGOL 68-RT".The Computer Journal.22 (2):114–118.doi:10.1093/comjnl/22.2.114.
  60. ^Applications, libraries, and test suites — Software Preservation Group. Softwarepreservation.org. Retrieved 21 July 2013.
  61. ^Revised Report, page 123, footnote
  62. ^Lindsey, C. H. (July 1974)."Partial Parametrization".ALGOL Bulletin (37):24–26. Retrieved2022-09-19.
  63. ^Lindsey, C. H.; Boom, H. J. (December 1978)."A Modules and Separate Compilation facility for ALGOL 68".ALGOL Bulletin (43):19–53. Retrieved2020-01-29.Commentserrata
  64. ^Lindsey, C. H. (July 1974)."Modals".ALGOL Bulletin (37):26–29. Retrieved2022-09-19.
  65. ^"Archived copy"(PDF). Archived fromthe original(PDF) on 2010-04-15. Retrieved2010-03-20.{{cite web}}: CS1 maint: archived copy as title (link)
  66. ^http://htportal.acm.org/ft_gateway.cfm?id=803425&type=pdf[permanent dead link]
  67. ^An abstract ALGOL 68 machine and its application in a machine independent compiler – Springer. Springerlink.com. Retrieved on 2013-07-21.
  68. ^"The Encyclopedia of Computer Languages". Archived fromthe original on 2011-03-10. Retrieved2010-03-20.
  69. ^Open source Algol 68 implementations – Browse Files at. Sourceforge.net. Retrieved on 2013-07-21.
  70. ^[1]Archived 2006-08-29 at theWayback Machine
  71. ^"Archived copy"(PDF). Archived fromthe original(PDF) on 2014-01-02. Retrieved2005-08-27.{{cite web}}: CS1 maint: archived copy as title (link)
  72. ^C. H. A. Koster (1993).The Making of Algol 68. Lecture Notes in Computer Science.CiteSeerX 10.1.1.76.2072.
  73. ^Dijkstra, E. W."To the Editor ALGOL 68 Mathematische Centrum".Archived from the original on 2007-04-21. Retrieved2007-04-28.
  74. ^van Rossum, Guido (June 2005)."Python-Dev Wishlist: dowhile". Retrieved2007-04-28.
  75. ^Hoare, C. A. R. (February 1981) [based on his 1980Turing Award lecture]."The emperor's old clothes".Communications of the ACM.24 (2):75–83.doi:10.1145/358549.358561.S2CID 97895.Alt URLArchived 2017-10-02 at theWayback Machine
  76. ^"ALGOL Bulletin (referred to in AB30.1.1.1)". March 1970.Archived from the original on 2007-09-30. Retrieved2007-03-01.

Works cited

[edit]
  • Brailsford, D. F. and Walker, A. N.,Introductory ALGOL 68 Programming, Ellis Horwood/Wiley, 1979
  • Lindsey, C. H. and van der Meulen, S. G.,Informal Introduction to ALGOL 68, North-Holland, 1971
  • Lindsey, C. H. (1993-03-02)."A History of ALGOL 68".ACM SIGPLAN Notices.28 (3):97–132.doi:10.1145/155360.155365.
  • 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 Surveys8, 155-190, June 1976 and9, 255-256, September 1977,[7][permanent dead link]
  • Woodward, P. M. and Bond, S. G.,ALGOL 68-R Userssic Guide, London, Her Majesty's Stationery Office, 1972

External links

[edit]
Implementations
Technical
standards
Dialects
Formalisms
Community
Organizations
Professional
associations
Business
Education
Government
People
ALGOL 58
MAD
ALGOL 60
Simula
ALGOL 68
Comparison
Authority control databases: NationalEdit this at Wikidata
Retrieved from "https://en.wikipedia.org/w/index.php?title=ALGOL_68&oldid=1282624750"
Categories:
Hidden categories:

[8]ページ先頭

©2009-2025 Movatter.jp