Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
ALGOL 68
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
{{Short description|Programming language}} {{Use dmy dates|date=May 2019|cs1-dates=y}} {{Infobox programming language | name = ALGOL 68 | logo = Algol68RevisedReportCover.jpg | logo caption = Revised Report on the Algorithmic Language – Algol 68 Edited by: A. van Wijngaarden et al, September 1973<ref name="Wijngaarden_1976"/> | paradigms = [[Multi-paradigm programming language|Multi-paradigm]]: [[Concurrent programming language|concurrent]], [[Imperative programming|imperative]] | family = [[ALGOL]] | designers = [[Adriaan van Wijngaarden|A. van Wijngaarden]], [[Barry J. Mailloux|B. J. Mailloux]], [[John E. L. Peck|J. E. L. Peck]] and [[Cornelis H. A. Koster|C. H. A. Koster]], et al. | developer = | released = Final Report: {{Start date and age|1968}}<sup>[[#The language of the unrevised report|r0]]</sup> | latest release version = Algol 68/RR | latest release date = Revised Report: {{Start date and age|1973}}<sup>[[#Revisions|r1]]</sup> | latest preview version = | latest preview date = | typing = [[Type system#Type checking|static]], [[Strong and weak typing|strong]], [[Type system#Safely and unsafely typed systems|safe]], [[Structural type system|structural]] | scope = [[Scope (computer science)|Lexical]] | implementations = [[ALGOL 68C]], Algol 68 Genie (recent), [[ALGOL 68-R]], [[ALGOL 68RS]], [[ALGOL 68S]], [[FLACC]], [[:ru:Алгол 68|Алгол 68 Ленинград/Leningrad Unit]], [[Odra (computer)|Odra ALGOL 68]] | dialects = ALGOL 68/FR (Final Report<sup>[[#The language of the unrevised report|r0]]</sup>) | influenced by = [[ALGOL 60]], [[ALGOL Y]] | influenced = [[C (programming language)|C]],<ref name="a68-c1"/><ref name="a68-c2"/> [[C++]],<ref name="a68-c++">{{cite web |date=March 1993 |title=A History of C++: 1979−1991 |url=http://www.research.att.com/~bs/hopl2.pdf |at=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) |access-date=2008-05-06}}</ref> [[Bourne shell]], [[KornShell]], [[Bash (Unix shell)|Bash]], [[Steelman language requirements|Steelman]], [[Ada (programming language)|Ada]], [[Python (programming language)|Python]],<ref name="a68-python">{{cite web |url=http://www.amk.ca/python/writing/gvr-interview |title=Interview with Guido van Rossum |date=July 1998 |access-date=2007-04-29 |archive-url=https://web.archive.org/web/20070501105422/http://www.amk.ca/python/writing/gvr-interview |archive-date=2007-05-01 |url-status=dead}}</ref> [[Seed7]], [[Mary (programming language)|Mary]], [[S3 (programming language)|S3]] | website = {{URL|algol68-lang.org}} }} {{SpecialChars | alt = Decimal Exponent Symbol | link = http://mailcom.com/unicode/DecimalExponent.ttf | special = Unicode 6.0 "[https://www.unicode.org/charts/PDF/U2300.pdf Miscellaneous Technical]" characters | fix = Unicode#External_links | characters = something like "₁₀" ([http://mailcom.com/unicode/DecimalExponent.ttf Decimal Exponent Symbol U+23E8 TTF]) }} '''ALGOL 68''' (short for ''Algorithmic Language 1968'') is an [[imperative programming|imperative]] [[programming language]] member of the [[ALGOL]] family that was conceived as a successor to the [[ALGOL 60]] language, designed with the goal of a much wider scope of application and more rigorously defined [[Syntax (programming languages)|syntax]] and semantics. The complexity of the language's definition, which runs to several hundred pages filled with non-standard terminology, made [[compiler]] 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 the [[United Kingdom]] where it was popular on [[International Computers Limited]] (ICL) machines, and in teaching roles. Outside these fields, use was relatively limited. Nevertheless, the contributions of ALGOL 68 to the field of [[computer 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 being [[Pascal (programming language)|Pascal]], or were reimplementations for specific roles, like [[Ada (programming language)|Ada]]. 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 language [[C (programming language)|C]], which was directly influenced by ALGOL 68, especially by its [[Strong and weak typing|strong 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== 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 the [[International 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 a [[Formalism (philosophy of mathematics)|formalism]], a two-level [[formal grammar]], invented by [[Adriaan van Wijngaarden]]. [[Van Wijngaarden grammar]]s use a [[context-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 language [[technical standard]]s are labelled ''semantics'', and must be expressed in ambiguity-prone natural language prose, and then implemented in compilers as ''ad hoc'' code attached to the formal language parser. {{quote box|align=right|style=width: 23em;|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. |author=[[Cornelis H. A. Koster|C. H. A. Koster]]<ref name="ashoa68">{{cite web |title=A Shorter History of ALGOL 68 |url=http://npt.cc.rsu.ru/user/wanderer/ODP/ALGOL68.txt |access-date=2006-09-15 |url-status=dead |archive-url=https://web.archive.org/web/20060810103448/http://npt.cc.rsu.ru/user/wanderer/ODP/ALGOL68.txt |archive-date=2006-08-10}}</ref>}} The main aims and principles of design of ALGOL 68 are:<ref name="aims-and-principles">{{Cite web|url=https://jmvdveer.home.xs4all.nl//en.post.algol-68-revised-report.html#01|archive-url=https://web.archive.org/web/20130317015548/http://jmvdveer.home.xs4all.nl/report.html#011|url-status=dead|title=Revised Report on the Algorithmic Language Algol 68|at=0.1. Aims and principles of design|first=Marcel van der|last=Veer|date=5 April 2023|archive-date=17 March 2013|website=jmvdveer.home.xs4all.nl/}}</ref> # Completeness and clarity of description # [[Orthogonality]] of design # Security # Efficiency: #* Static mode checking #* Mode-independent parsing #* Independent compiling #* Loop optimizing #* Representations – in minimal & larger [[Character encoding|character sets]] ALGOL 68 has been criticized, most prominently by some members of its design committee such as [[C. A. R. Hoare]] and [[Edsger Dijkstra]], for abandoning the simplicity of [[ALGOL 60]], becoming a vehicle for complex or overly general ideas, and doing little to make the [[compiler]] writer's task easier, in contrast to deliberately simple contemporaries (and competitors) such as [[C (programming language)|C]], [[S-algol]] and [[Pascal (programming language)|Pascal]]. In 1970, [[ALGOL 68-R]] became the first working compiler for ALGOL 68. In the 1973 revision, certain features — such as [[ALGOL 68-R#No proceduring|proceduring]], gommas<ref>{{Cite web|url=https://groups.google.com/group/comp.lang.misc/msg/03af5063e1662d4d|title = Gommas?}}</ref> and [[ALGOL 68-R#No formal declarers|formal bounds]] — were omitted.<ref name="a68r0-jmvdveer">[http://jmvdveer.home.xs4all.nl/report.html#03B Revised Report on the Algorithmic Language Algol 68] {{webarchive |url=https://web.archive.org/web/20130317015548/http://jmvdveer.home.xs4all.nl/report.html#03B |date=2013-03-17}}. jmvdveer.home.xs4all.nl (1968-12-20). Retrieved on 2013-07-21.</ref> Cf. [[#The language of the unrevised report|The language of the unrevised report.<sup>r0</sup>]] Though European defence agencies (in Britain [[Royal 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 language [[Ada (programming language)|Ada]], making its use obligatory for US defense contracts. ALGOL 68 also had a notable influence in the [[Soviet Union]], details of which can be found in [[Andrey Terekhov]]'s 2014 paper: "ALGOL 68 and Its Impact on the USSR and Russian Programming",<ref>{{Cite conference |last=Terekhov |first=Andrey |date=2014 |title=ALGOL 68 and Its Impact on the USSR and Russian Programming |conference=2014 Third International Conference on Computer Technology in Russia and in the Former Soviet Union |pages=97–106 |doi=10.1109/SoRuCom.2014.29 |isbn=978-1-4799-1799-0 |s2cid=16097093}}</ref> and "Алгол 68 и его влияние на программирование в СССР и России".<ref>{{cite conference |last=Терехов |first=Андрей Николаевич |date=2014 |title=Алгол 68 и его влияние на программирование в СССР и России |language=ru |trans-title=Algol 68 and its influence on programming in the USSR and Russia |conference=Третья Международная конференция, Развитие вычислительной техники и ее программного обеспечения в России и странах бывшего СССР: история и перспективы |pages=336-347 |url=https://sorucom.iis.nsk.su/files/news/sorucom2014.pdf}}</ref> [[Steve Bourne]], who was on the ALGOL 68 revision committee, took some of its ideas to his [[Bourne shell]] (and thereby, to descendant [[Unix shell]]s such as [[Bash (Unix shell)|Bash]]) and to [[C (programming language)|C]] (and thereby to descendants such as [[C++]]). The complete history of the project can be found in [[Charles H. Lindsey|C. H. Lindsey]]'s "A History of ALGOL 68".<ref name="ahoa68"> {{cite book |last=Lindsey |first=Charles H. |author-link=Charles H. Lindsey |publisher=[[ACM Press]] |chapter=A History of ALGOL 68 |pages=27–96 |title=History of Programming Languages II |editor1-first=T. J. |editor1-last=Bergin |editor2-first=R. G. |editor2-last=Gibson |date=1996 |isbn=978-0-201-89502-5 |title-link=History of Programming Languages (conference)#HOPL II}} Also in {{cite journal|volume=28 |number=3 |pages=97–132 |date=March 1993 |title=A history of ALGOL 68 |journal=ACM SIGPLAN Notices |doi=10.1145/155360.155365 |ref=none }} Includes a comprehensive bibliography of the meetings and discussions before, during and after development of ALGOL 68. </ref> For a full-length treatment of the language, see "Programming ALGOL 68 Made Easy"<ref>[http://www.nunan.myzen.co.uk/algol68/pame.pdf Programming Algol 68 Made Easy]</ref> by Dr. Sian Mountbatten, or "Learning ALGOL 68 Genie"<ref>{{Cite web|url=https://jmvdveer.home.xs4all.nl//en.algol-68-genie.html|title=Marcel van der Veer - Algol 68 Genie|first=Marcel van der|last=Veer|website=jmvdveer.home.xs4all.nl/}}</ref> by Marcel van der Veer which includes the Revised Report. ==History== ===Origins=== ALGOL 68, as the name implies, is a follow-on to the [[ALGOL]] language that was first formalized in 1960. That same year the [[International 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, and [[ALGOL Y]], which would have the ability to modify its own programs in the style of the language [[Lisp (programming language)|LISP]].{{sfn|Lindsey|1993|p=7}} ===Definition process=== The first meeting of the ALGOL X group was held in [[Princeton University]] in May 1965. A report of the meeting noted two broadly supported themes, the introduction of [[strong typing]] and interest in [[Euler programming language|Euler's]] concepts of 'trees' or 'lists' for handling collections.{{sfn|Lindsey|1993|p=9}} Although intended as a "short-term solution to existing difficulties",{{sfn|Lindsey|1993|p=4}} ALGOL X got as far as having a compiler made for it. This compiler was written by [[Douglas T. Ross]] of the [[Massachusetts Institute of Technology]] (MIT) with the ''Automated Engineering Design'' (AED-0) system, also termed ''ALGOL Extended for Design''.<ref>{{Cite web |last=Ross |first=Douglas T. |date=October 1966 |url=http://www.dtic.mil/cgi-bin/GetTRDoc?AD=AD0296998 |archive-url=https://web.archive.org/web/20130626171225/http://www.dtic.mil/cgi-bin/GetTRDoc?AD=AD0296998 |url-status=dead |archive-date=26 June 2013 |title=An Algorithmic Theory of Language (AB26.2.2) |page=6 |website=Defense Technical Information Center |publisher=Massachusetts Institute of Technology |access-date=2020-08-12}}</ref><ref>{{Cite journal |last=Ross |first=D. T. |date=August 1967 |url=https://dl.acm.org/doi/abs/10.1145/1139498.1139500 |title=AB26.2.2 Features Essential for a Workable ALGOL X |journal=ACM SIGPLAN Notices: ALGOL Bulletin |volume=26 |issue=2 |publisher=Association for Computing Machinery: Digital Library |doi=10.1145/1139498.1139500 |s2cid=38156680 |access-date=2020-08-12|url-access=subscription }}</ref> At the second meeting in October in France, three formal proposals were presented, [[Niklaus Wirth]]'s [[ALGOL W]] along with comments about record structures by [[C.A.R. Hoare|C.A.R. (Tony) Hoare]], a similar language by Gerhard Seegmüller, and a paper by [[Adriaan 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.{{sfn|Lindsey|1993|p=9}} 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 in [[Kootwijk]], 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".{{sfn|Lindsey|1993|p=24}} 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.{{sfn|Lindsey|1993|p=10}} At the next meeting in [[Warsaw]] in October 1966,<ref>{{Cite web|url=http://archive.computerhistory.org/resources/text/algol/algol_bulletin/|title = The Algol Bulletin}}</ref> there was an initial report from the I/O Subcommittee who had met at the [[Oak Ridge National Laboratory]] and the [[University 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 of [[pointer (computer science)|pointers]]; ALGOL W used them only to refer to records, while van Wijngaarden's version could point to any object. To add confusion, [[John McCarthy (computer scientist)|John McCarthy]] presented a new proposal for [[operator overloading]] and the ability to string together ''and'' and ''or'' constructs, and [[Klaus Samelson]] wanted to allow [[anonymous function]]s. In the resulting confusion, there was some discussion of abandoning the entire effort.{{sfn|Lindsey|1993|p=10}} The confusion continued through what was supposed to be the ALGOL Y meeting in [[Zandvoort]] in May 1967.{{sfn|Lindsey|1993|p=9}} ===Publication=== A draft report was finally published in February 1968. This was met by "shock, horror and dissent",{{sfn|Lindsey|1993|p=9}} 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",{{sfn|Lindsey|1993|p=12}} a process that took six man-weeks of effort. The resulting paper, "ALGOL 68 with fewer tears",<ref>{{cite journal |title=ALGOL 68 with fewer tears |journal=The Computer Journal |date=1972 |volume=15 |issue=1 |pages=176–188 |doi=10.1093/comjnl/15.2.176 |url=https://academic.oup.com/comjnl/article-pdf/15/2/176/1002964/15-2-176.pdf |last1=Lindsey |first1=C. H. }}</ref> was widely circulated. At a wider information processing meeting in [[Zü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 and [[Peter Naur]] formally resigned their authorship positions in WG2.1 at that time.{{sfn|Lindsey|1993|p=12}} The next WG2.1 meeting took place in [[Tirrenia]] 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.{{sfn|Lindsey|1993|p=13}} 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, at [[Banff, 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.{{sfn|Lindsey|1993|p=15}} The effort took five years, burned out many of the greatest names in [[computer 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,<ref name="Hoare1968">{{cite journal |last=Hoare |first=C. A. R. |author-link=Tony Hoare |date=November 1968 |title=Critique of MR93 (Critique of ALGOL 68) |url=https://dl.acm.org/doi/10.5555/1061166.1061173 |journal=[[ALGOL Bulletin]] |volume=29 |pages=27–29}}</ref> 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=== ====ALGOL 68-R==== The first implementation of the standard, based on the late-1968 draft Report, was introduced by the [[Royal Radar Establishment]] in the UK as [[ALGOL 68-R]] in July 1970. This was, however, a subset of the full language, and [[Barry Mailloux]], the final editor of the Report, joked that "It is a question of morality. We have a Bible and you are sinning!"<ref name="implement">{{citation |editor-first=J. E. L. |editor-last=Peck |date=1970 |title=Proceedings of the IFIP working conference on ALGOL 68 Implementation |publisher=North-Holland |place=Munich |isbn=0-7204-2045-8}}</ref> This version nevertheless became very popular on the [[International Computers Limited|ICL]] machines, and became a widely-used language in military coding, especially in the UK.<ref name=shorter>{{cite web |first=C. H. A. |last=Koster |title=A Shorter History of Algol 68 |archive-url=https://web.archive.org/web/20071217203826/http://npt.cc.rsu.ru/user/wanderer/ODP/ALGOL68.txt |url=http://npt.cc.rsu.ru/user/wanderer/ODP/ALGOL68.txt |archive-date=2007-12-17}}</ref> 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 the [[activation record]] was set aside before it was used. However, this change also had the side-effect of demanding the '''PROC'''s be declared twice, once as a declaration of the types, and then again as the body of code. Another change was to eliminate the assumed '''VOID''' mode, an expression that returns no value (named a ''statement'' in other languages) and demanding the word '''VOID''' be added where it would have been assumed. Further, 68-R eliminated the explicit [[Parallel computing|parallel processing]] commands based on '''PAR'''.<ref name=implement/> ====Others==== The first full implementation of the language was introduced in 1974 by CDC Netherlands for the [[Control Data]] mainframe series. This saw limited use, mostly teaching in Germany and the Netherlands.<ref name="shorter"/> A version similar to 68-R was introduced from [[Carnegie 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 the [[DEC PDP-11]]. It too was used mostly for teaching purposes.<ref name="shorter"/> A version for [[IBM]] mainframes did not become available until 1978, when one was released from [[Cambridge University]]. This was "nearly complete". Lindsey released a version for small machines including the [[IBM PC]] in 1984.<ref name="shorter"/> Three open source Algol 68 implementations are known:<ref>{{cite web |last1=van der Veer |first1=Marcel |title=Open source Algol 68 implementations |url=http://algol68.sourceforge.net/ |website=algol68.sourceforge.net}}</ref> * '''a68g''', [[GPLv3]], written by Marcel van der Veer. * '''algol68toc''', an [[open-source software]] port of [[ALGOL 68RS]]. * experimental Algol68 frontend for [[GNU Compiler Collection|GCC]], written by Jose E. Marchesi.<ref name=":0">{{cite web |last1=E. Marchesi |first1=Jose |title= Algol 68 Front-End |url=https://gcc.gnu.org/wiki/Algol68FrontEnd |website=gcc.gnu.org}}</ref><ref name=":1">{{cite web |last1=E. Marchesi |first1=Jose |title= An Algol 68 front end for GCC |url=https://lwn.net/Articles/1003916/ |website=lwn.net}}</ref> ===Timeline=== {|class="wikitable" |- ! scope="col" | Year || scope="col" |Event || scope="col" |Contributor |- | style="text-align:right;" | March 1959 || [[ALGOL Bulletin]] Issue 1 (First) || [[Peter Naur]] / [[Association for Computing Machinery|ACM]] |- | style="text-align:right;" | February 1968 || Draft Report<sup>(DR)</sup> Published<ref>{{Cite journal|url=https://dl.acm.org/doi/10.5555/1064072.1064073|title=Draft Report on the Algorithmic Language ALGOL 68|first1=A.|last1=Van Wijngaarden|first2=B. J.|last2=Mailloux|first3=J.|last3=Peck|first4=C. H. A.|last4=Koster|date=1 March 1968|journal=ALGOL Bulletin|issue=Sup 26|pages=1–84|accessdate=7 April 2023|via=Mar. 1968}}</ref> || [[IFIP]] [[IFIP Working Group 2.1|Working Group 2.1]] |- | style="text-align:right;" | March 1968 || Algol 68 Final Report<sup>[[#The language of the unrevised report|r0]]</sup> Presented at Munich Meeting || IFIP Working Group 2.1 |- | style="text-align:right;" | June 1968 || Meeting in Tirrenia, Italy || IFIP Working Group 2.1 |- | style="text-align:right;" | Aug 1968 || Meeting in North Berwick, Scotland || IFIP Working Group 2.1 |- | style="text-align:right;" | December 1968 || ALGOL 68 Final Report<sup>[[#The language of the unrevised report|r0]]</sup> Presented at Munich Meeting || IFIP Working Group 2.1 |- | style="text-align:right;" | April 1970 || [[ALGOL 68-R]] under [[GEORGE (operating system)|GEORGE 3]] on an [[International Computers Limited|ICL]] [[ICT 1900 series|1907F]] || [[RSRE|Royal Signals and Radar Est.]] |- | style="text-align:right;" | July 1970 || ALGOL 68 for the [[Dartmouth Time-Sharing System]]<ref>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.</ref><ref>Sidney Marshall, ''On the implementation of ALGOL 68'', PhD Thesis, Dartmouth College, 1972.</ref> || Sidney Marshall |- | style="text-align:right;" | September 1973 || Algol 68 Revised Report<ref>[https://web.archive.org/web/20130101062456/http://jmvdveer.home.xs4all.nl/report.html Algol 68 Revised Report]</ref><sup>[[#Revisions|r1]]</sup> Published || IFIP Working Group 2.1 |- | style="text-align:right;" | 1975 || [[ALGOL 68C]]<sup>(C)</sup> – transportable compiler (zcode [[virtual machine|VM]]) || [[Stephen R. Bourne|S. Bourne]], [[Andrew Birrell]], and [[Michael Guy (computer scientist)|Michael Guy]] |- | style="text-align:right;" | June 1975 || G. E. Hedrick and Alan Robertson. The Oklahoma State ALGOL 68 Subset Compiler. 1975 International Conference on ALGOL 68. |- | style="text-align:right;" | June 1977 || Strathclyde ALGOL 68 conference, Scotland || ACM |- | style="text-align:right;" | May 1978 || Proposals for ALGOL H – A Superlanguage of ALGOL 68<ref>{{Cite journal|url=https://dl.acm.org/doi/10.5555/1061701.1061711|title=Proposals for ALGOL H - A Superlanguage of ALGOL 68|first1=A. P.|last1=Black|first2=V. J.|last2=Rayward-Smith|date=1 May 1978|journal=ALGOL Bulletin|issue=42|pages=36–49|accessdate=7 April 2023|via=May. 1978}}</ref> || A. P. Black, V. J. Rayward-Smith |- | style="text-align:right;" | 1984 || Full [[ALGOL 68S]]<sup>(S)</sup> compiler for Sun, SPARC, and PCs || C. H. Lindsey et al, Manchester |- | style="text-align:right;" | August 1988 || [[ALGOL Bulletin]] Issue 52 (last) || Ed. C. H. Lindsey / ACM |- | style="text-align:right;" | May 1997 || Algol68 S<sup>(S)</sup> published on the internet<ref>{{Cite web |url=http://www.cs.man.ac.uk/~chl/index.html#ALGOL%2068 |title=Algol68 S<sup>(S)</sup> published on the internet |access-date=2004-08-30 |archive-date=2005-12-03 |archive-url=https://web.archive.org/web/20051203193706/http://www.cs.man.ac.uk/~chl/index.html#ALGOL%2068 |url-status=dead }}</ref> || [[Charles H. Lindsey]] |- | style="text-align:right;" | November 2001 || Algol 68 Genie<sup>(G)</sup> published on the internet<ref>{{Cite web|url=https://jmvdveer.home.xs4all.nl/en.algol-68-genie.html|title=The Algol 68 Genie project|first=Marcel van der|last=Veer|website=jmvdveer.home.xs4all.nl|accessdate=7 April 2023}}</ref> (GNU GPL open source licensing) || [https://jmvdveer.home.xs4all.nl Marcel van der Veer] |- |January 2025 |Algol 68 GCC Front-End published by Jose E. Marchesi under the GPL<ref name=":1" /><ref name=":0" /> |[https://jemarch.net Jose E. Marchesi] |} * [https://web.archive.org/web/20071217203826/http://npt.cc.rsu.ru/user/wanderer/ODP/ALGOL68.txt "A Shorter History of Algol 68"] <!-- retrieved 2011-06-14 --> * [https://web.archive.org/web/20110514113912/http://hopl.murdoch.edu.au/showlanguage.prx?exp=311 ALGOL 68 – 3rd generation ALGOL] <!-- retrieved 2011-06-14 --> ===The Algorithmic Language ALGOL 68 Reports and Working Group members=== * March 1968: Draft Report on the Algorithmic Language ALGOL 68<ref name="a68r-1">{{cite web |title=Draft Report on the Algorithmic Language ALGOL 68 |url=http://archive.computerhistory.org/resources/text/algol/algol_bulletin/AS26/ |access-date=June 22, 2007 |date=March 1968 |url-status=live |archive-url=https://web.archive.org/web/20070930181523/http://archive.computerhistory.org/resources/text/algol/algol_bulletin/AS26/ |archive-date=2007-09-30}}</ref> – Edited by: [[Adriaan van Wijngaarden]], [[Barry J. Mailloux]], [[John E. L. Peck|John Peck]] and [[Cornelis H. A. Koster]]. {{rquote|right|"Van Wijngaarden once characterized the four authors, somewhat tongue-in-cheek, as: Koster: [[#transput: Input and output|transputter]], Peck: syntaxer, Mailloux: implementer, Van Wijngaarden: party ideologist." – Koster.}} * October 1968: Penultimate Draft Report on the Algorithmic Language ALGOL 68 — Chapters 1-9<ref name="a68r-1-9">{{cite web |title=Penultimate Draft Report on the Algorithmic Language ALGOL 68 – Chapters 1-9 |url=http://repos.project.cwi.nl:8888/cwi_repository/docs/I/09/9180A.pdf |access-date=June 22, 2007 |date=October 1968}}{{dead link|date=November 2016 |bot=InternetArchiveBot |fix-attempted=yes}}</ref> Chapters 10-12<ref name="a68r-10-12">{{cite web|title=Penultimate Draft Report on the Algorithmic Language ALGOL 68 – Chapters 10-12 |url=http://repos.project.cwi.nl:8888/cwi_repository/docs/I/09/9179A.pdf |access-date=2007-06-22 |date=October 1968}}{{dead link|date=November 2016 |bot=InternetArchiveBot |fix-attempted=yes}}</ref> — Edited by: A. van Wijngaarden, B.J. Mailloux, J. E. L. Peck and C. H. A. Koster. * December 1968: Report on the Algorithmic Language ALGOL 68 — Offprint from Numerische Mathematik, 14, 79-218 (1969); Springer-Verlag.<ref name="a68r0-kleine">{{cite web |title=Report on the Algorithmic Language ALGOL 68 |url=http://www.fh-jena.de/~kleine/history/languages/Algol68-Report.pdf |access-date=December 30, 2007 |date=December 1968 |archive-date=2008-04-06 |archive-url=https://web.archive.org/web/20080406061108/http://www.fh-jena.de/~kleine/history/languages/Algol68-Report.pdf |url-status=dead }}</ref> — Edited by: A. van Wijngaarden, B. J. Mailloux, J. E. L. Peck and C. H. A. Koster. * March 1970: Minority report, ALGOL Bulletin AB31.1.1 — signed by [[Edsger Dijkstra]], [[Fraser Duncan]], [[Jan Garwick]], [[Tony Hoare]], [[Brian Randell]], [[Gerhard Seegmüller]], [[Władysław M. Turski|Wlad Turski]], and [[Mike Woodger]]. * September 1973: Revised Report on the Algorithmic Language Algol 68 — Springer-Verlag 1976<ref name="a68r1-html">{{cite web |title=Revised Report on the Algorithmic Language Algol 68 |url=http://burks.brighton.ac.uk/burks/language/other/a68rr/rrtoc.htm |access-date=2007-04-30 |date=September 1973 |url-status=live |archive-url=https://web.archive.org/web/20070927191700/http://burks.brighton.ac.uk/burks/language/other/a68rr/rrtoc.htm |archive-date=2007-09-27}}</ref> — Edited by: A. van Wijngaarden, B. Mailloux, J. Peck, K. Koster, [[Michel Sintzoff]], [[Charles H. Lindsey]], [[Lambert Meertens]] and [[Richard G. Fisker]]. * other WG 2.1 members active in ALGOL 68 design:<ref name="ahoa68"/> [[Friedrich L. Bauer]] • [[Hans Bekic]] • [[:de:Gerhard Goos|Gerhard Goos]] • [[Peter Zilahy Ingerman]] • [[Peter Landin]] • [[John McCarthy (computer scientist)|John McCarthy]] • [[Jack N. Merner|Jack Merner]] • [[Peter Naur]] • [[Manfred Paul]] • [[Willem van der Poel]] • [[Douglas T. Ross|Doug Ross]] • [[Klaus Samelson]] • [[Niklaus Wirth]] • [[Nobuo Yoneda]]. ===Timeline of standardization=== 1968: On 20 December 1968, the "Final Report" (MR 101) was adopted by the Working Group, then subsequently approved by the General Assembly of [[UNESCO]]'s [[IFIP]] for publication. Translations of the standard were made for [[Russian language|Russian]], [[German language|German]], [[French language|French]] and [[Bulgarian language|Bulgarian]], and then later [[Japanese language|Japanese]] and [[Chinese language|Chinese]].<ref name="abp33">{{cite web |url=http://archive.computerhistory.org/resources/text/algol/ACM_Algol_bulletin/1061739/p33-ru_ian.pdf |title=The Translation of Algol 68 into Chinese |author=Lu Hu-quan |date=1971 |publisher=Institute of Mathematics, Academia Sinica |place=Peking, China |access-date=2012-08-17}}</ref> The standard was also made available in [[Braille]]. 1984: [[ISO/IEC JTC 1#History|TC 97]] considered ALGOL 68 for standardisation as "New Work Item" TC97/N1642 [http://www.open-std.org/JTC1/sc22/docs/docs0200.html][http://std.dkuug.dk/JTC1/sc22/sc22arc1.txt]. 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"[http://archive.computerhistory.org/resources/text/algol/algol_bulletin/A50/P1.HTM] and Algol 68's ISO standardisation stalled.[http://www.open-std.org/jtc1/sc22/open/n0200.pdf] 1988: Subsequently ALGOL 68 became one of the [[GOST]] standards in Russia. * GOST 27974-88 Programming language ALGOL 68 — Язык программирования АЛГОЛ 68<ref name="a68ru">{{cite web |url=http://vak.ru/lib/exe/fetch.php/book/gost/pdf/gost-27974-88.pdf |title=GOST 27974-88 Programming language ALGOL 68 – Язык программирования АЛГОЛ 68 |language=ru |date=1988 |publisher=[[GOST]] |access-date=2008-11-15 |archive-url=https://web.archive.org/web/20081115035038/http://vak.ru/lib/exe/fetch.php/book/gost/pdf/gost-27974-88.pdf |archive-date=15 November 2008 |url-status=dead}}</ref> * GOST 27975-88 Programming language ALGOL 68 extended — Язык программирования АЛГОЛ 68 расширенный<ref name="a68ruext">{{cite web |url=http://vak.ru/lib/exe/fetch.php/book/gost/pdf/gost-27975-88.pdf |title=GOST 27975-88 Programming language ALGOL 68 extended – Язык программирования АЛГОЛ 68 расширенный |language=ru |date=1988 |publisher=[[GOST]] |access-date=2008-11-15 |url-status=dead |archive-url=https://web.archive.org/web/20110429001243/http://vak.ru/lib/exe/fetch.php/book/gost/pdf/gost-27975-88.pdf |archive-date=29 April 2011}}</ref> ==Notable language elements== {{SpecialChars | alt = Decimal Exponent Symbol | link = http://mailcom.com/unicode/DecimalExponent.ttf | special = Unicode 6.0 "[https://www.unicode.org/charts/PDF/U2300.pdf Miscellaneous Technical]" characters | fix = Unicode#External_links | characters = something like "₁₀" ([http://mailcom.com/unicode/DecimalExponent.ttf Decimal Exponent Symbol U+23E8 TTF]) }} ===Bold symbols and reserved words=== 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''' "@", '''EITHER'''<sup>[[#The language of the unrevised report|r0]]</sup>, '''IS''' ":=:", '''ISNT''' '''IS NOT'''<sup>[[#The language of the unrevised report|r0]]</sup> ":/=:" ":≠:", '''OF''' "→"<sup>[[#The language of the unrevised report|r0]]</sup>, '''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''' "( ~ | ~ |: ~ | ~ | ~ )", '''PAR''' '''BEGIN''' ~ '''END''' "( ~ )", '''GO TO''', '''GOTO''', '''EXIT''' "□"<sup>[[#The language of the unrevised report|r0]]</sup>. ===Units: Expressions=== The basic language construct is the ''unit''. A unit may be a ''formula'', an ''enclosed clause'', a ''routine text'' or one of several technically needed constructs (assignation, jump, skip, nihil). The technical term ''enclosed clause'' unifies some of the inherently bracketing constructs known as ''block'', ''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''' ). This [[Guarded Command Language#Selection: if|Guarded Command]] syntax was reused by [[Stephen R. Bourne|Stephen Bourne]] in the common [[Unix]] [[Bourne shell]]. An expression may also yield a ''multiple value'', which is constructed from other values by a ''collateral clause''. This construct just looks like the parameter pack of a procedure call. ===mode: Declarations=== The basic [[data type]]s (called <code>mode</code>s in Algol 68 parlance) are <code>real</code>, <code>int</code>, <code>compl</code> ([[complex number]]), <code>bool</code>, <code>char</code>, <code>bits</code> and <code>bytes</code>. For example: '''INT''' n = 2; '''CO''' n is fixed as a constant of 2. '''CO''' '''INT''' m := 3; '''CO''' m is a newly created local ''variable'' whose value is initially set to 3. '''CO''' '''CO''' This is short for '''ref''' '''int''' m = '''loc''' '''int''' := 3; '''CO''' '''REAL''' avogadro = 6.0221415⏨23; '''CO''' Avogadro number '''CO''' '''long 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 declaration <code>'''REAL''' x;</code> is just [[syntactic sugar]] for <code>'''REF''' '''REAL''' x = '''LOC''' '''REAL''';</code>. That is, <code>x</code> is really the ''constant identifier'' for a ''reference to'' a newly generated local '''REAL''' variable. Furthermore, instead of defining both <code>float</code> and <code>double</code>, or <code>int</code> and <code>long</code> and <code>short</code>, etc., ALGOL 68 provides ''modifiers'', so that the presently common <code>double</code> would be written as '''LONG''' '''REAL''' or '''LONG''' '''LONG''' '''REAL''' instead, for example. The ''prelude constants'' <code>max real</code> and <code>min long int</code> 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''', '''COMPLEX'''<sup>G</sup>, '''BOOL''', '''CHAR''', '''STRING''', '''BITS''', '''BYTES''', '''FORMAT''', '''FILE''', '''PIPE'''<sup>G</sup>, '''CHANNEL''', '''SEMA''' * '''BITS''' – a "packed vector" of '''BOOL'''. * '''BYTES''' – a "packed vector" of '''CHAR'''. * '''STRING''' – a '''FLEX'''ible array of '''CHAR'''. * '''SEMA''' – a [[Semaphore (programming)|'''SEMA'''phore]] which can be initialised with the '''OP'''erator '''LEVEL'''. Complex types can be created from simpler ones using various type constructors: * '''REF''' ''mode'' – a reference to a value of type ''mode'', similar to '''&''' in C/C++ and '''REF''' in Pascal * '''STRUCT''' – used to build structures, like '''STRUCT''' in C/C++ and '''RECORD''' 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''', '''EVENT'''<sup>S</sup> * '''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 an '''INT''', '''REAL''' or '''COMPL''' to be of a '''LONG'''er size. * '''SHORT''' – declare an '''INT''', '''REAL''' or '''COMPL''' to be of a '''SHORT'''er size. A name for a mode (type) can be declared using a '''MODE''' declaration, which is similar to '''TYPEDEF''' in C/C++ and '''TYPE''' in Pascal: '''INT''' max=99; '''MODE''' '''NEWMODE''' = [0:9][0:max]'''STRUCT''' ( '''LONG''' '''REAL''' a, b, c, '''SHORT''' '''INT''' i, j, k, '''REF''' '''REAL''' r ); This is similar to the following C code: <syntaxhighlight lang="c"> const int max=99; typedef struct { double a, b, c; short i, j, k; float *r; } newmode[9+1][max+1]; </syntaxhighlight> For ALGOL 68, only the '''NEWMODE''' 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, the '''lower bound''' of Algol 68 arrays is one by default, but can be any integer from -''max int'' to ''max int''. Mode declarations allow types to be [[Recursive data type|recursive]]: defined directly or indirectly in terms of themselves. This is subject to some restrictions – for instance, these declarations are illegal: '''MODE''' '''A''' = '''REF''' '''A''' '''MODE''' '''A''' = '''STRUCT''' ('''A''' a, '''B''' b) '''MODE''' '''A''' = '''PROC''' ('''A''' a) '''A''' while these are valid: '''MODE''' '''A''' = '''STRUCT''' ('''REF''' '''A''' a, '''B''' b) '''MODE''' '''A''' = '''PROC''' ('''REF''' '''A''' a) '''REF''' '''A''' ===Coercions: casting=== The [[Implicit type conversion|coercions]] 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 termed ''deproceduring'', ''dereferencing'', ''uniting'', ''widening'', ''rowing'', and ''voiding''. Each coercion, except for ''uniting'', 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 ==== ALGOL 68 has a hierarchy of contexts which determine the kind of coercions available at a particular point in the program. These contexts are: {|class="wikitable" !rowspan=2 {{verth|va=middle|Context}} !rowspan=2| Context location !colspan=5| Coercions available !rowspan=2| Coercion examples in the context |- style="text-align:center" |bgcolor="#5555ff" style="color:#ffffff;" {{verth|va=middle|{{white|'''Soft'''}}}} |bgcolor="#00ee00" style="color:#ffffff;" {{verth|va=middle|{{white|'''Weak'''}}}} |bgcolor="#dddd00" style="color:#000000;" {{verth|va=middle|{{black|'''Meek'''}}}} |bgcolor="#cc8800" style="color:#ffffff;" {{verth|va=middle|{{white|'''Firm'''}}}} |bgcolor="#bb0000" style="color:#ffffff;" {{verth|va=middle|{{white|'''Strong'''}}}} |- |bgcolor="#bb0000" style="color:#ffffff;" {{verth|va=middle|{{white|'''Strong'''}}}} |Right hand side of: * Identity-declarations, as "~" in: <code>'''REAL''' x = ~</code> * Initialisations, as "~" in: <code>'''REAL''' x := ~</code> Also: * Actual-parameters of calls, as "~" in:<code>'''PROC''': sin(~)</code> * Enclosed clauses of casts, as "~" in: <code>'''REAL'''(~)</code> * Units of routine-texts * Statements yielding '''VOID''' * All parts (but one) of a balanced clause * One side of an identity relation, as "~" in: <code> ~ '''IS''' ~</code> |bgcolor="#5555ff" style="color:#ffffff;" rowspan=4 width="50px" {{verth|va=middle|{{white| deproc​edur​ing}}}} |bgcolor="#00ee00" style="color:#ffffff;" rowspan=3 width="50px" {{verth|va=middle|{{white| All '''SOFT''' then weak derefer​encing (deref​erencing or deproc​eduring, yield​ing a name)}}}} |bgcolor="#dddd00" style="color:#000000;" rowspan=2 width="50px" {{verth|va=middle| {{black|All '''WEAK''' then derefer​enc​ing (deref​erenc​ing or deproc​edur​ing)}}}} |bgcolor="#cc8800" style="color:#ffffff;" rowspan=1 width="50px" {{verth|va=middle|{{white| All '''MEEK''' then unit​ing}}}} |bgcolor="#bb0000" style="color:#ffffff;" width="50px" {{verth|va=middle|{{white| All '''FIRM''' then widen​ing, rowing or voiding}}}} |colspan=1 bgcolor="#bb0000" style="color:#ffffff;"| Widening is always applied in the '''INT''' to '''REAL''' to '''COMPL''' direction, provided the modes have the same size. For example: An '''INT''' will be coerced to a '''REAL''', but not vice versa. Examples: * to '''REAL''' from '''INT''' * to '''COMPL''' from '''REAL''' * to []'''BOOL''' from '''BITS''' * to []'''CHAR''' from '''BYTES''' A variable can also be coerced (rowed) to an array of length 1. For example: * to [1]'''INT''' from '''INT''' * to [1]'''REAL''' from '''REAL''' etc. |- |bgcolor="#cc8800" style="color:#ffffff;" {{verth|va=middle|{{white|'''Firm'''}}}} || *Operands of formulas as "~" in:<code>~ '''OP''' ~</code> *Parameters of transput calls |colspan=3 bgcolor="#cc8800" style="color:#ffffff;"| Example: <code>'''UNION'''('''INT''','''REAL''') var := 1</code> |- |bgcolor="#dddd00" style="color:#000000;" {{verth|va=middle|{{black|'''Meek'''}}}} || * Trimscripts (yielding '''INT''') * Enquiries: e.g. as "~" in the following <code>'''IF''' ~ '''THEN''' ... '''FI'''</code> and <code>'''FROM''' ~ '''BY''' ~ '''TO''' ~ '''WHILE''' ~ '''DO''' ... '''OD''' etc</code> * Primaries of calls (e.g. sin in sin(x)) |colspan=4 bgcolor="#dddd00" style="color:#000000;"|Examples: * to '''BOOL''' from '''REF''' '''REF''' '''BOOL''' * to '''INT''' from '''REF''' '''REF''' '''REF''' '''INT''' |- |bgcolor="#00ee00" style="color:#ffffff;" {{verth|va=middle|{{white|'''Weak'''}}}} || * Primaries of slices, as in "~" in: <code>~[1:99]</code> * Secondaries of selections, as "~" in: <code>value '''OF''' ~</code> |colspan=5 bgcolor="#00ee00" style="color:#ffffff;"|Examples: * to '''REF''' '''INT''' from '''REF''' '''REF''' '''INT''' * to '''REF''' '''REAL''' from '''REF''' '''REF''' '''REF''' '''REAL''' * to '''REF''' '''STRUCT''' from '''REF''' '''REF''' '''REF''' '''REF''' '''STRUCT''' |- |bgcolor="#5555ff" style="color:#ffffff;" {{verth|va=middle|{{white|'''Soft'''}}}} || The LHS of assignments, as "~" in: <code>~ := ...</code> |colspan=6 bgcolor="#5555ff" style="color:#ffffff;"| Example: * deproceduring of: <code>'''PROC''' '''REAL''' random: e.g. random</code> |} For more details about Primaries, Secondaries, Tertiary & Quaternaries refer to [[#Dyadic operators with associated priorities|Operator precedence]]. ===pr & co: Pragmats and Comments=== Pragmats are [[Directive (programming)|directives]] in the program, typically hints to the compiler; in newer languages these are called "pragmas" (no 't'). e.g. '''PRAGMAT''' heap=32 '''PRAGMAT''' '''PR''' heap=32 '''PR''' Comments can be inserted in a variety of ways: ¢ The original way of adding your 2 cents worth to a program ¢ '''COMMENT''' "bold" comment '''COMMENT''' '''CO''' Style i comment '''CO''' # 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=== ALGOL 68 being an [[expression-oriented programming languages|expression-oriented programming language]], the value returned by an [[assignment (programming)|assignment]] 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 in [[C (programming language)|C]] and [[Perl]], among others. Note that as in earlier languages such as [[Algol 60]] and [[FORTRAN]], spaces are allowed in identifiers, so that <code>half pi</code> is a ''single'' identifier (thus avoiding the ''underscores'' versus ''[[camel case (programming)|camel case]]'' versus ''all lower-case'' issues). As another example, to express the mathematical idea of a ''sum'' of <code>f(i)</code> from i=1 to n, the following ALGOL 68 ''integer expression'' suffices: ('''INT''' sum := 0; '''FOR''' i '''TO''' n '''DO''' sum +:= f(i) '''OD'''; sum) Note that, being an integer expression, the former block of code can be used in ''any 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 in [[Lisp (programming language)|Lisp]], among other languages. Compound statements are all terminated by distinctive closing brackets: *'''IF''' choice clauses: '''IF''' condition '''THEN''' statements [ '''ELSE''' statements ] '''FI''' "brief" form: ( condition | statements | statements ) '''IF''' condition1 '''THEN''' statements '''ELIF''' condition2 '''THEN''' statements [ '''ELSE''' statements ] '''FI''' "brief" form: ( condition1 | statements |: condition2 | statements | statements ) This scheme not only avoids the [[dangling else]] problem but also avoids having to use <code>'''BEGIN'''</code> and <code>'''END'''</code> in embedded [[Statement (programming)|statement]] sequences. *'''CASE''' choice clauses: '''CASE''' switch '''IN''' statements, statements,... [ '''OUT''' statements ] '''ESAC''' "brief" form: ( switch | statements,statements,... | statements ) '''CASE''' switch1 '''IN''' statements, statements,... '''OUSE''' switch2 '''IN''' statements, statements,... [ '''OUT''' statements ] '''ESAC''' "brief" form of '''CASE''' statement: ( switch1 | statements,statements,... |: switch2 | statements,statements,... | statements ) Choice clause example with ''Brief'' 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 with ''Bold'' symbols: '''PROC''' days in month = ('''INT''' year, month)'''INT''': '''CASE''' month '''IN''' 31, '''IF''' year '''MOD''' 4 '''EQ''' 0 '''AND''' year '''MOD''' 100 '''NE''' 0 '''OR''' year '''MOD''' 400 '''EQ''' 0 '''THEN''' 29 '''ELSE''' 28 '''FI''', 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 '''ESAC'''; Choice clause example mixing ''Bold'' and ''Brief'' symbols: '''PROC''' days in month = ('''INT''' year, month)'''INT''': '''CASE''' month '''IN''' ¢Jan¢ 31, ¢Feb¢ ( year '''MOD''' 4 = 0 '''AND''' year '''MOD''' 100 ≠ 0 '''OR''' year '''MOD''' 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 type '''INT''' ''or'' (uniquely) '''UNION'''. The latter allows the enforcing [[strong typing]] onto '''UNION''' variables. cf. '''[[#struct, union & .5B:.5D: Structures, unions and arrays|union]]''' below for example. *'''[[for loop|do]]''' loop clause: [ '''FOR''' index ] [ '''FROM''' first ] [ '''BY''' increment ] [ '''TO''' last ] [ '''WHILE''' condition ] '''DO''' statements '''OD''' The minimum form of a "loop clause" is thus: '''DO''' statements '''OD''' This was considered ''the'' "universal" loop, the full syntax is: '''FOR''' i '''FROM''' 1 '''BY''' -22 '''TO''' -333 '''WHILE''' i×i≠4444 '''DO''' ~ '''OD''' The construct have several unusual aspects: * only the '''''DO''' ~ '''OD''''' portion was compulsory, in which case the loop will iterate indefinitely. * thus the clause '''''TO''' 100 '''DO''' ~ '''OD''''', will iterate only 100 times. * the '''WHILE''' "syntactic element" allowed a programmer to break from a '''FOR''' loop early. e.g. '''INT''' sum sq:=0; '''FOR''' i '''WHILE''' print(("So far:",i,newline)); sum sq≠70↑2 '''DO''' sum sq+:=i↑2 '''OD''' Subsequent "extensions" to the standard Algol68 allowed the '''TO''' syntactic element to be replaced with '''UPTO''' and '''DOWNTO''' to achieve a small optimisation. The same compilers also incorporated: * '''UNTIL'''<sup>(C)</sup> – for late loop termination. * '''FOREACH'''<sup>(S)</sup> – for working on arrays in [[Parallel computing|parallel]]. Further examples can be found in the code examples below. ===struct, union & {{code|[:]}}: Structures, unions and arrays=== ALGOL 68 supports [[Array data structure|arrays]] with any number of dimensions, and it allows for the ''slicing'' of whole or partial rows or columns. '''MODE''' '''VECTOR''' = [1:3] '''REAL'''; ''# vector '''MODE''' declaration (typedef) #'' '''MODE''' '''MATRIX''' = [1:3,1:3]'''REAL'''; ''# matrix '''MODE''' declaration (typedef) #'' '''VECTOR''' v1 := (1,2,3); ''# array variable initially (1,2,3) #'' []'''REAL''' v2 = (4,5,6); ''# constant array, type equivalent to '''VECTOR''', bounds are implied #'' '''OP''' + = ('''VECTOR''' a,b) '''VECTOR''': ''# binary '''OP'''erator definition #'' ('''VECTOR''' out; '''FOR''' i '''FROM''' ⌊a '''TO''' ⌈a '''DO''' 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.: '''REF''' '''VECTOR''' row = m[2,]; ''# define a '''REF''' (pointer) to the 2nd row #'' '''REF''' '''VECTOR''' col = m[,2]; ''# define a '''REF''' (pointer) to the 2nd column #'' ALGOL 68 supports multiple field structures ('''STRUCT''') and '''[[united modes]]'''. Reference variables may point to any '''MODE''' including array slices and structure fields. For an example of all this, here is the traditional linked list declaration: '''MODE''' '''NODE''' = '''UNION''' ('''VOID''', '''REAL''', '''INT''', '''COMPL''', '''STRING'''), '''LIST''' = '''STRUCT''' ('''NODE''' val, '''REF''' '''LIST''' next); Usage example for '''UNION''' '''CASE''' of '''''NODE''''': {| border="1" style="border-collapse:collapse; border:5px double gray; float:left;" class="wikitable" ! Algol68<sup>[[#The language of the unrevised report|r0]]</sup> as in the 1968 Final Report ! Algol68<sup>[[#Revisions|r1]]</sup> as in the 1973 Revised Report |- | '''NODE''' n := "1234"; '''REAL''' r; '''INT''' i; '''COMPL''' c; '''STRING''' s '''CASE''' r,i,c,s::=n '''IN''' print(("real:", r)), print(("int:", i)), print(("compl:", c)), print(("string:", s)) '''OUT''' print(("?:", n)) '''ESAC''' | '''NODE''' n := "1234"; # or n := EMPTY; # '''CASE''' n '''IN''' ('''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''' |} {{clear}} ===proc: Procedures=== 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 > b '''THEN''' a '''ELSE''' b '''FI'''; 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 a <code>proc</code> is the value of the last expression evaluated in the procedure. References to procedures ('''ref proc''') are also permitted. [[Call by reference|Call-by-reference]] parameters are provided by specifying references (such as <code>'''ref real'''</code>) 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''' i '''FROM''' '''LWB''' a '''TO''' '''UPB''' a '''DO''' a[i] := f(a[i]) '''OD''' This simplicity of code was unachievable in ALGOL 68's predecessor [[ALGOL 60]]. ===op: Operators=== The programmer may define new '''[[Operator (programming)|operators]]''' and ''both'' those and the pre-defined ones may be [[overloading (programming)|overloaded]] and their priorities may be changed by the coder. The following example defines operator <code>'''MAX'''</code> with both dyadic and monadic versions (scanning across the elements of an array). '''PRIO''' '''MAX''' = 9; '''OP''' '''MAX''' = ('''INT''' a,b) '''INT''': ( a>b | a | b ); '''OP''' '''MAX''' = ('''REAL''' a,b) '''REAL''': ( a>b | a | b ); '''OP''' '''MAX''' = ('''COMPL''' a,b) '''COMPL''': ( '''ABS''' a > '''ABS''' b | a | b ); '''OP''' '''MAX''' = ([]'''REAL''' a) '''REAL''': ('''REAL''' out := a['''LWB''' a]; '''FOR''' i '''FROM''' '''LWB''' a + 1 '''TO''' '''UPB''' a '''DO''' ( a[i]>out | out:=a[i] ) '''OD'''; out) ====Array, Procedure, Dereference and coercion operations==== {|class="wikitable" |- ! style="background:#ccc;"|'''PRIO'''rity ! style="background:#ccc;"| Operation <sup>[[#The language of the unrevised report|r0]]&[[#Revisions|r1]]</sup> ! style="background:#ccc;"|+Algol68<sup>[[#The language of the unrevised report|r0]]</sup> ! style="background:#ccc;"|+Algol68<sup>G</sup> |- |ALIGN=CENTER| Effectively 12<br />(Primary) || dereferencing, deproceduring(~,~), subscripting[~], rowing[~,], slicing[~:~], size denotations '''LONG''' & '''SHORT''' || proceduring |ALIGN=CENTER|currying(~,,,), '''DIAG''', '''TRNSP''', '''ROW''', '''COL''' |- |ALIGN=CENTER| Effectively 11<br />(Secondary) || '''OF''' (selection), '''LOC''' & '''HEAP''' (generators) || → (selection) || '''NEW''' (generators) |} These are technically not operators, rather they are considered "[https://web.archive.org/web/20130101062456/http://jmvdveer.home.xs4all.nl/report.html#52 units associated with names]" <!-- '''DIAG''', '''TRNSP''', '''ROW''', '''COL''' as per S. G. van der Meulen, M. Veldhorst. TORRIX – A programming language for opera- tions on vectors and matrices over arbitrary fields and of variable size. Rijksuniver- siteit Utrecht [1977]. --> ====Monadic operators==== {|class="wikitable" |- ! style="background:#ccc;"|'''PRIO'''rity<br />(Tertiary) ! style="background:#ccc;"|Algol68 "Worthy characters{{ref|worthy}}"<sup>[[#The language of the unrevised report|r0]]&[[#Revisions|r1]]</sup> ! style="background:#ccc;"|+Algol68<sup>[[#The language of the unrevised report|r0]]&[[#Revisions|r1]]</sup> ! style="background:#ccc;"|+Algol68<sup>C,G</sup> ! style="background:#ccc;"|+Algol68<sup>[[#The language of the unrevised report|r0]]</sup> |- |ALIGN=CENTER| 10 || '''NOT''' ~, '''UP''', '''DOWN''', '''LWB''', '''UPB''', -, '''ABS''', '''ARG''', '''BIN''', '''ENTIER''', '''LENG''', '''LEVEL''', '''ODD''', '''REPR''', '''ROUND''', '''SHORTEN''' | ¬, ↑, ↓, ⌊, ⌈ | '''NORM''', '''TRACE''', '''T''', '''DET''', '''INV''' | '''LWS''', '''UPS''', ⎩, ⎧, '''BTB''', '''CTB''' |} <!-- '''NORM''', '''TRACE''', '''T''', '''DET''', '''INV''' as per S. G. van der Meulen, M. Veldhorst. TORRIX – A programming language for operations on vectors and matrices over arbitrary fields and of variable size. Rijksuniver-siteit Utrecht [1977]. --> ====Dyadic operators with associated priorities==== {|class="wikitable" |- ! style="background:#ccc;"|'''PRIO'''rity<br />(Tertiary) ! style="background:#ccc;"|Algol68 "Worthy characters"<sup>[[#The language of the unrevised report|r0]]&[[#Revisions|r1]]</sup> ! style="background:#ccc;"|+Algol68<sup>[[#The language of the unrevised report|r0]]&[[#Revisions|r1]]</sup> ! style="background:#ccc;"|+Algol68<sup>C,G</sup> ! style="background:#ccc;"|+Algol68<sup>[[#The language of the unrevised report|r0]]</sup> |- style="font-family:monospace" |ALIGN=CENTER|9 || +*, '''I''' || +×, ⊥ || || ! |- style="font-family:monospace" |ALIGN=CENTER|8 || '''SHL''', '''SHR''', **, '''UP''', '''DOWN''', '''LWB''', '''UPB''' || ↑, ↓, ⌊, ⌈ || || ××, ^, '''LWS''', '''UPS''', ⎩, ⎧ |- style="font-family:monospace" |ALIGN=CENTER|7 || *, /, %, '''OVER''', %*, '''MOD''', '''ELEM''' || ×, ÷, ÷×, ÷*, %×, □ || || ÷: |- style="font-family:monospace" |ALIGN=CENTER|6 || -, + || || || |- style="font-family:monospace" |ALIGN=CENTER|5 || <, '''LT''', <=, '''LE''', >=, '''GE''', >, '''GT''' || ≤, ≥ || || |- style="font-family:monospace" |ALIGN=CENTER|4 || '''EQ''' =, '''NE''' ~= /= || ≠, ¬= || || |- style="font-family:monospace" |ALIGN=CENTER|3 || &, '''AND''' || ∧ || || /\ |- style="font-family:monospace" |ALIGN=CENTER|2 || '''OR''' || ∨ || || \/ |- style="font-family:monospace" |ALIGN=CENTER|1 || '''MINUSAB''', '''PLUSAB''', '''TIMESAB''', '''DIVAB''', '''OVERAB''', '''MODAB''', '''PLUSTO''', -:=, +:=, *:=, /:=, %:=, %*:=, +=: || ×:=, ÷:=, ÷×:=, ÷*:=, %×:= || || '''MINUS''', '''PLUS''', '''DIV''', '''OVERB''', '''MODB''', ÷::=, '''PRUS''' |} Specific details: * Tertiaries include names '''NIL''' and ○. * '''LWS''': In Algol68<sup>[[#The language of the unrevised report|r0]]</sup> the operators '''LWS''' and ⎩ ... both return '''TRUE''' if the ''lower state'' of the dimension of an array is fixed. * The '''UPS''' and ⎧ operators are similar on the ''upper state''. * The '''LWB''' and '''UPB''' operators are automatically available on '''UNION'''s of different orders (and '''MODE'''s) of arrays. eg. '''UPB''' of '''{{code|union([]int, [,]real, flex[,,,]char)}}''' ====Assignation and identity relations, etc.==== These are technically not operators, rather they are considered "[https://web.archive.org/web/20130101062456/http://jmvdveer.home.xs4all.nl/report.html#052 units associated with names]" {|class="wikitable" |- ! style="background:#ccc;"|'''PRIO'''rity<br />(Quaternaries) ! style="background:#ccc;"|Algol68 "Worthy characters"<sup>[[#The language of the unrevised report|r0]]&[[#Revisions|r1]]</sup> ! style="background:#ccc;"|+Algol68<sup>[[#The language of the unrevised report|r0]]&[[#Revisions|r1]]</sup> ! style="background:#ccc;"|+Algol68<sup>C,G,R</sup> ! style="background:#ccc;"|+Algol68<sup>[[#The language of the unrevised report|r0]]</sup> |- |ALIGN=CENTER| Effectively 0 || {{tt|1=:=, '''IS''' :=:, '''ISNT''' :/=: :~=:, '''AT''' @, ":", ";"}} || {{tt|1=:≠: :¬=:}} | {{tt|1=:=:=<sup>C</sup>, =:=<sup>R</sup>}} || {{tt|1=..=, .=, '''CT''', ::, '''CTAB''', ::=, .., '''is not''', "..", ".,"}} |} Note: Quaternaries include names '''SKIP''' and ~. {{code|1=:=:}} (alternatively {{tt|1='''IS'''}}) tests if two pointers are equal; {{code|1=:/=:}} (alternatively {{tt|1='''ISNT'''}}) tests if they are unequal. =====Why {{code|1=:=:}} and {{code|1=:/=:}} are needed===== Consider trying to compare two pointer values, such as the following variables, declared as pointers-to-integer: : <code>'''REF''' '''INT''' ip, jp </code> 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 : <code>ip = jp </code> will dereference both pointers down to values of type {{tt|1='''INT'''}}, and compare those, since the {{char|{{=}}}} operator is defined for {{tt|1='''INT'''}}, but not {{tt|1='''REF''' '''INT'''}}. It is ''not legal'' to define {{char|{{=}}}} for operands of type {{tt|1='''REF''' '''INT'''}} and {{tt|1='''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 {{tt|1='''REF''' '''INT'''}} and that version of the operator called? Or should they be dereferenced further to {{tt|1='''INT'''}} and that version used instead? Therefore the following expression can never be made legal: : <code>ip = '''NIL''' </code> 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: : <code>ip :=: jp </code> : <code>ip :=: '''NIL''' </code> while legal, will probably not do what might be expected. They will always return {{tt|1='''FALSE'''}}, because they are comparing the ''actual addresses of the variables ''<code>ip</code>'' and ''<code>jp</code>'', rather than what they point to''. To achieve the right effect, one would have to write : <code>ip :=: '''REF''' '''INT'''(jp) </code> : <code>ip :=: '''REF''' '''INT'''('''NIL''') </code> ====Special characters==== :[[Image:APL-keybd2.svg|600px|thumb|[[IBM 2741]] keyboard with APL symbols]] Most of Algol's "special" characters (⊂, ≡, ␣, ×, ÷, ≤, ≥, ≠, ¬, ⊃, ≡, ∨, ∧, →, ↓, ↑, ⌊, ⌈, ⎩, ⎧, ⊥, ⏨, ¢, ○ and □) can be found on the [[IBM 2741]] keyboard with the [[APL (programming language)#Hardware|APL]] "golf-ball" print head inserted; these became available in the mid-1960s while ALGOL 68 was being drafted. These characters are also part of the [[Unicode]] standard and most of them are available in several popular [[font]]s. ===transput: Input and output=== '''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 the '''standard output''' device: <pre> print ((newpage, "Title", newline, "Value of i is ", i, "and x[i] is ", x[i], newline)) </pre> Note the predefined procedures <code>newpage</code> and <code>newline</code> passed as arguments. ====Books, channels and files==== The '''TRANSPUT''' is considered to be of '''BOOKS''', '''CHANNELS''' and '''FILES''': * '''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 to <code>match</code>. * '''CHANNEL'''s correspond to physical devices. e.g. card punches and printers. ** Three standard channels are distinguished: ''stand in'' channel, ''stand out'' channel, ''stand back'' channel. * A '''FILE''' is a means of communicating between a program and a book that has been opened via some channel. ** The '''MOOD''' of a file may be read, write, char, bin, and opened. ** transput procedures include: <code>establish, create, open, associate, lock, close, scratch</code>. ** position enquires: <code>char number, line number, page number</code>. ** layout routines include: ***<code>space</code>, <code>backspace</code>, <code>newline</code>, <code>newpage</code>. ***<code>get good line, get good page, get good book</code>, and <code>'''PROC''' set=('''REF''' '''FILE''' f, '''INT''' page,line,char)'''VOID''':</code> ** A file has '''event routines'''. e.g. <code>on logical file end, on physical file end, on page end, on line end, on format end, on value error, on char error</code>. ====formatted transput==== "Formatted transput" in ALGOL 68's transput has its own syntax and patterns (functions), with '''FORMAT'''s embedded between two $ characters.<ref>{{Cite web|url=http://www.xs4all.nl/~jmvdveer/syntax.html#formats|archiveurl=https://web.archive.org/web/20080109161728/http://www.xs4all.nl/~jmvdveer/syntax.html#formats|url-status=dead|title=Format syntax in ALGOL 68G|archive-date=9 January 2008|access-date=7 April 2023}}</ref> Examples: <pre> 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)) </pre> ===par: Parallel processing=== ''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 (programming)|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). '''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; '''PAR''' '''BEGIN''' '''WHILE''' muffins > 0 '''DO''' '''DOWN''' mouth; eat; '''UP''' mouth '''OD''', '''WHILE''' words > 0 '''DO''' '''DOWN''' mouth; speak; '''UP''' mouth '''OD''' '''END''' ===Miscellaneous=== For its technical intricacies, ALGOL 68 needs a cornucopia of methods to deny the existence of something: '''SKIP''', "~" or "?"<sup>C</sup> – an undefined value always syntactically valid, '''EMPTY''' – the only value admissible to '''VOID''', needed for selecting '''VOID''' in a '''UNION''', '''VOID''' – syntactically like a '''MODE''', but not one, '''NIL''' or "○" – a name not denoting anything, of an unspecified reference mode, () or specifically [1:0]'''INT''' – a ''vacuum'' is an empty array (here specifically of '''MODE''' []'''INT'''). ''undefined'' – a standards reports procedure raising an exception in the runtime system. ℵ – Used in the standards report to inhibit [[type introspection|introspection]] of certain types. e.g. '''SEMA''' 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. 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, the '''OUTTYPE'''/'''INTYPE''' for crude [[duck typing]], and the '''STRAIGHTOUT''' and '''STRAIGHTIN''' operators for "straightening" nested arrays and structures ==Examples of use== ===Code sample=== 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''': ('''PROC''' f = ('''INT''' m,n) '''LIST''': (m>n | '''NIL''' | cons(m, f(m+1,n))); f(1,n)); '''MODE''' '''LIST''' = '''REF''' '''NODE'''; '''MODE''' '''NODE''' = '''STRUCT''' ('''INT''' h, '''LIST''' t); '''PROC''' cons = ('''INT''' n, '''LIST''' l) '''LIST''': '''HEAP''' '''NODE''' := (n,l); '''PROC''' hd = ('''LIST''' l) '''INT''': ( l '''IS''' '''NIL''' | error("hd '''NIL'''"); '''SKIP''' | h '''OF''' l ); '''PROC''' tl = ('''LIST''' l) '''LIST''': ( l '''IS''' '''NIL''' | error("tl '''NIL'''"); '''SKIP''' | t '''OF''' l ); '''PROC''' show = ('''LIST''' l) '''VOID''': ( l '''ISNT''' '''NIL''' | print((" ",whole(hd(l),0))); show(tl(l))); '''PROC''' filter = ('''PROC''' ('''INT''') '''BOOL''' p, '''LIST''' l) '''LIST''': '''IF''' l '''IS''' '''NIL''' '''THEN''' '''NIL''' '''ELIF''' p(hd(l)) '''THEN''' cons(hd(l), filter(p,tl(l))) '''ELSE''' filter(p, tl(l)) '''FI'''; '''PROC''' sieve = ('''LIST''' l) '''LIST''': '''IF''' l '''IS''' '''NIL''' '''THEN''' '''NIL''' '''ELSE''' '''PROC''' not multiple = ('''INT''' n) '''BOOL''': n '''MOD''' 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=== * [[Cambridge CAP computer]] – All procedures constituting the operating system were written in [[ALGOL 68C]], although several other closely associated protected procedures, such as a paginator, are written in [[BCPL]].<ref>{{Cite journal |last1=Needham |first1=R. M. |last2=Wilkes |first2=M. V. |date=January 1979 |url=http://research.microsoft.com/pubs/72418/cap.pdf |title=The Cambridge CAP Computer and its Operating System| journal=Microsoft Research}}</ref> * Eldon 3 – Developed at [[Leeds University]] for the [[ICT 1900 series|ICL 1900]] was written in [[ALGOL 68-R]].<ref name="eldon">{{cite web |title=KDF9 Time Sharing: Eldon 2 is not EGDON! |url=http://www.cs.man.ac.uk/CCS/res/res49.htm#e|author=David Holdsworth |date=Winter 2009–2010 |work=Computer Resurrection – Number 49 |publisher=[[Computer Conservation Society]] |access-date=2010-10-03}}</ref> * [[Flex machine]] – The hardware was custom and microprogrammable, with an operating system, (modular) compiler, editor, garbage collector and filing system all written in [[ALGOL 68RS]]. The command shell Curt<ref>{{cite web|url=http://www.vitanuova.com/dist/doc/rsre-3522-curt.pdf|access-date=7 April 2023|website=vitanuova.com|title=RSRE Memorandum |date=September 1982|author1=I F Currie|author2=J M Foster}}</ref> was designed to access typed data similar to Algol-68 modes. * [[ICL VME|VME]] – [[S3 (programming language)|S3]] was the implementation language of the [[operating system]] VME. S3 was based on ALGOL 68 but with data types and operators aligned to those offered by the [[ICL 2900 Series]]. Note: The Soviet Era computers [[Elbrus (computer)|Эльбрус-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.<ref>[http://www.ixbt.com/cpu/e2k-spec.html Эльбрус Бабаяна и Pentium Пентковского]. Ixbt.com. Retrieved 21 July 2013.</ref> ===Applications=== Both [[ALGOL 68C]] and [[ALGOL 68-R]] are written in ALGOL 68, effectively making ALGOL 68 an application of itself. Other applications include: * [[ELLA (programming language)|ELLA]] – a hardware description language and support toolset. Developed by the [[Royal Signals and Radar Establishment]] during the 1980s and 1990s. * [[RAF Strike Command]] System – "... 400K of error-free [[ALGOL 68-RT]] code was produced with three man-years of work. ..."<ref>{{cite journal |last1=Oliver |first1=J. R. |last2=Newton |first2=R. S. |date=1979 |title=Practical experience with ALGOL 68-RT |journal=The Computer Journal |volume=22 |issue=2 |pages=114–118 |doi=10.1093/comjnl/22.2.114|doi-access=free }}</ref> ===Libraries and APIs=== * [[NAG Numerical Libraries]] – a [[software library]] of [[numerical analysis]] routines. Supplied in ALGOL 68 during the 1980s. * TORRIX – a programming system for operations on vectors and matrices over arbitrary fields and of variable size by S. G. van der Meulen and M. Veldhorst.<ref name="torrix">[http://www.softwarepreservation.org/projects/ALGOL/applications#ALGOL_68_Libraries Applications, libraries, and test suites — Software Preservation Group]. Softwarepreservation.org. Retrieved 21 July 2013.</ref> ==Program representation== A feature of ALGOL 68, inherited from the [[ALGOL]] tradition, is its different representations. Programs in the ''strict language'' (which is rigorously defined in the Report) denote production trees in the form of a sequence of grammar symbols, and should be represented using some ''representation language'', of which there are many and tailored to different purposes. * Representation languages that are intended to describe algorithms in printed works are known as ''publication languages'' and typically make use of rich typography to denote bold words and operator indications. * Representation languages that are intended to be used in compiler input, what we would call ''programming languages'', are limited by the restrictions imposed by input methods and character sets and have to resort to ''stropping regimes'' to distinguish between bold and non bold letters and digits. * Representation languages that are intended to be both produced and consumed by computers, known as ''hardware languages'', would typically use a binary compact representation. The Revised Report defines a ''reference language'' and it is recommended for representation languages that are intended to be read by humans to be close enough to the reference language so symbols can be distinguished "without further elucidation". These representation languages are called ''implementations of the reference language''. For example, the construct in the strict language '''bold-begin-symbol''' could be represented as '''begin''' in a publication language, as {{var|BEGIN}} in a programming language or as the bytes 0xC000 in some hardware language. Similarly, the strict language '''differs from symbol''' could be represented as ≠ or as /=. ALGOL 68's reserved words are effectively in a different [[namespace]] from identifiers, and spaces are allowed in identifiers in most stropping regimes, so this next fragment is legal: '''INT''' a real int = 3 ; The programmer who writes executable code does not always have an option of '''BOLD''' typeface or <u>underlining</u> in the code as this may depend on hardware and cultural issues. Different methods to denote these identifiers have been devised. This is called a ''[[Stropping (programming)|stropping]] regime''. For example, all or some of the following may be available ''programming representations'': '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. QUOTE (single apostrophe quoting) was the original recommendation{{citation needed|date=May 2025}}. It may seem that RES stropping is a contradiction to the specification, as there are no reserved words in Algol 68. This is not so. In RES stropping the representation of the bold word (or keyword) '''begin''' is {{var|begin}}, and the representation of the identifier ''begin'' is {{var|begin_}}. Note that the underscore character is just a representation artifact and not part of the represented identifier. In contrast, in non-stropped languages with reserved words, like for example C, it is not possible to represent an identifier {{var|if}}, since the representation {{var|if_}} represents the identifier {{var|if_}}, not {{var|if}}. The following characters were recommended for portability, and termed "worthy characters" in the [http://algol68-lang.org/docs/standard-hardware-representation.pdf Report on the Standard Hardware Representation of Algol 68] : * {{note|worthy}}Worthy Characters: ABCDEFGHIJKLM<wbr>NOPQRSTUVWXYZ<wbr>0123456789 "#$%'()*+,-./:;<=>@[ ]_| 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=== {| class="wikitable plainrowheaders" |- ! scope="col" | Representation ! scope="col" | Code |- ! scope="row" | Algol68 as typically published | {{pre|1= ''¢ underline or '' ''bold typeface ¢'' '''mode''' '''xint''' = '''int'''; '''xint''' sum sq:=0; '''for''' i '''while''' sum sq≠70×70 '''do''' sum sq+:=i↑2 '''od''' }} |- ! scope="row" | Quote stropping<br />(like [[Lightweight markup language#Text/font-face formatting|wikitext]]) | {{sxhl|2=text|1= 'pr' quote 'pr' 'mode' 'xint' = 'int'; 'xint' sum sq:=0; 'for' i 'while' sum sq≠70×70 'do' sum sq+:=i↑2 'od' }} |- ! scope="row" | For a [[List of binary codes#Seven-bit binary codes|7-bit]] character code compiler | {{sxhl|2=man|1= PR UPPER PR MODE XINT = INT; XINT sum sq:=0; FOR i WHILE sum sq/=70*70 DO sum sq+:=i**2 OD }} |- ! scope="row" | For a [[Six-bit character code|6-bit]] character code compiler | {{sxhl|2=man|1= .PR POINT .PR .MODE .XINT = .INT; .XINT SUM SQ:=0; .FOR I .WHILE SUM SQ .NE 70*70 .DO SUM SQ .PLUSAB I .UP 2 .OD }} |- ! scope="row" | Algol68 using '''RES''' stropping<br />(reserved word) | {{sxhl|2=man|1= .PR RES .PR mode .xint = int; .xint sum sq:=0; for i while sum sq≠70×70 do sum sq+:=i↑2 od }} |} 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|date=August 2011}} # Next day date - English variant # '''MODE''' '''DATE''' = '''STRUCT'''('''INT''' day, '''STRING''' month, '''INT''' year); '''PROC''' the day following = ('''DATE''' x) '''DATE''': '''IF''' day '''OF''' x < length of month (month '''OF''' x, year '''OF''' x) '''THEN''' (day '''OF''' x + 1, month '''OF''' x, year '''OF''' x) '''ELIF''' month '''OF''' x = "December" '''THEN''' (1, "January", year '''OF''' x + 1) '''ELSE''' (1, successor of month (month '''OF''' x), year '''OF''' x) '''FI'''; # Nachfolgetag - Deutsche Variante # '''MENGE''' '''DATUM''' = '''TUPEL'''('''GANZ''' tag, '''WORT''' monat, '''GANZ''' jahr); '''FUNKTION''' naechster tag nach = ('''DATUM''' x) '''DATUM''': '''WENN''' tag '''VON''' x < monatslaenge(monat '''VON''' x, jahr '''VON''' x) '''DANN''' (tag '''VON''' x + 1, monat '''VON''' x, jahr '''VON''' x) '''WENNABER''' monat '''VON''' x = "Dezember" '''DANN''' (1, "Januar", jahr '''VON''' x + 1) '''ANSONSTEN''' (1, nachfolgemonat(monat '''VON''' x), jahr '''VON''' x) '''ENDEWENN'''; ''Russian/Soviet example:'' In English Algol68's case statement reads '''CASE''' ~ '''IN''' ~ '''OUT''' ~ '''ESAC''', in [[Cyrillic]] this reads '''выб''' ~ '''в''' ~ '''либо''' ~ '''быв'''. ==Revisions== Except where noted (with a <sup>superscript</sup>), the language described above is that of the "Revised Report<sup>(r1)</sup>". ===The language of the unrevised report=== The original language (As per the "Final Report"<sup>[[#The language of the unrevised report|r0]]</sup>) 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 would be intended to make evaluations ''lazy''. The most useful application could have been the short-circuited evaluation of Boolean operators. In: '''OP''' '''ANDF''' = ('''BOOL''' a,'''PROC''' '''BOOL''' b)'''BOOL''':(a | b | '''FALSE'''); '''OP''' '''ORF''' = ('''BOOL''' a,'''PROC''' '''BOOL''' b)'''BOOL''':(a | '''TRUE''' | b); ''b'' is only evaluated if ''a'' is true. As defined in ALGOL 68, it did not work as expected, for example in the code: '''IF''' '''FALSE''' '''ANDF''' '''CO''' proc bool: '''CO''' ( print ("Should not be executed"); '''TRUE''') '''THEN''' ... against the programmers naïve expectations the print ''would'' be executed as it is only the ''value'' of the elaborated enclosed-clause after '''ANDF''' that was procedured. Textual insertion of the commented-out '''PROC''' '''BOOL''': 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 (''[https://groups.google.com/group/comp.lang.misc/msg/03af5063e1662d4d gomma]''s). For example in: '''PROC''' test = ('''REAL''' a; '''REAL''' b) :... ... test (x '''PLUS''' 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 (x '''PLUS''' 1, x); then the compiler could evaluate the arguments in whatever order it felt like. ===Extension proposals from IFIP WG 2.1=== After the revision of the report, some extensions to the language have been proposed to widen the applicability: * ''partial parametrisation'' (aka [[Currying#Motivation|Currying]]): 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,<ref>{{cite journal |title=Partial Parametrization |url=https://archive.computerhistory.org/resources/text/algol/algol_bulletin/A37/P42.HTM |journal=ALGOL Bulletin |date=July 1974 |first1=C. H. |last1=Lindsey |issue=37 |pages=24–26 |access-date=2022-09-19}}</ref> * ''module extension'': for support of external linkage, two mechanisms were proposed, bottom-up ''definition modules'', a more powerful version of the facilities from [[ALGOL 68-R]] and top-down ''holes'', similar to the <code>ENVIRON</code> and <code>USING</code> clauses from [[ALGOL 68C]]<ref name="modules">{{cite journal |title=A Modules and Separate Compilation facility for ALGOL 68 |journal=ALGOL Bulletin |date=December 1978 |first1=C. H. |last1=Lindsey |last2=Boom |first2=H. J. |issue=43 |pages=19–53 |url=https://archive.computerhistory.org/resources/text/algol/algol_bulletin/A43/P32.HTM|access-date=2020-01-29 |doi=}} [https://dl.acm.org/doi/10.5555/1061751.1061757 Comments] [https://dl.acm.org/doi/10.5555/1061760.1061764 errata]</ref> * ''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).<ref>{{cite journal |title=Modals |url=https://archive.computerhistory.org/resources/text/algol/algol_bulletin/A37/P43.HTM |journal=ALGOL Bulletin |date=July 1974 |first1=C. H. |last1=Lindsey |issue=37 |pages=26–29 |access-date=2022-09-19}}</ref> So far, only partial parametrisation has been implemented, in Algol 68 Genie. ===True ALGOL 68s specification and implementation timeline=== {|class="wikitable sortable" |- style="background:#ccc;" ! Name || Year || Purpose || State || Description || Target CPU || Licensing || Implementation language |- |[[Generalized ALGOL]] || 1962 || Scientific || {{flag|NLD}} || ALGOL for generalised grammars || || || |- |[[ALGOL Y]]<sup>Y</sup> || 1966 || Draft proposal || Intl || First version of Algol 68 || Specification || [[Association for Computing Machinery|ACM]] || |- |ALGOL 68<sup>DR</sup> || 1968 || Draft proposal || Intl || IFIP WG 2.1 Draft Report || Specification – March || ACM || |- |ALGOL 68<sup>[[#The language of the unrevised report|r0]]</sup> || 1968 || Standard || Intl || IFIP WG 2.1 Final Report || Specification – August || ACM || |- |[[ALGOL 68-R]]<sup>R</sup> || 1970 || Military || {{flag|UK}} || || [[ICT 1900 series|ICL 1900]] || || ALGOL 60 |- |[[EPOS ALGOL]]<sup>E</sup> || 1971 || Scientific || || || || || |- |[[ALGOL 68RS]]<sup>RS</sup> || 1972 || Military || {{flag|UK}} || Portable compiler system || ICL 2900/Series 39, Multics, VMS & {{nowrap|C generator (1993)}} || [[Crown Copyright]] || ALGOL 68RS |- |Algol 68 with areas || 1972 || Experimental & other || {{flag|UK}} || Addition of areas to Algol 68 || || || |- |Mini ALGOL 68 || 1973 || Research || {{flag|NLD}} || Interpreter for ALGOL 68 subset<ref>{{cite web |url=http://oai.cwi.nl/oai/asset/9494/9494A.pdf |title=An interpreter for simple Algol 68 Programs |archive-url=https://web.archive.org/web/20110718172314/http://oai.cwi.nl/oai/asset/9494/9494A.pdf |archive-date=2011-07-18 |url-status=dead}}</ref> || Portable interpreter || [[Mathematisch Centrum]] || [[ALGOL 60]] |- |[[OREGANO]] || 1973 || Research || {{flag|US}} || "The importance of implementation models." || || [[UCLA]] || |- |[[ALGOL 68C]]<sup>C</sup> || 1975 || Scientific || {{flag|UK}} || Cambridge Algol 68 || [[International Computers Limited|ICL]], IBM 360, PDP-10 & Unix, [[Telefunken]], TESLA 200,<ref>{{cite journal |url=https://archive.computerhistory.org/resources/text/algol/algol_bulletin/A42/P21.HTM |title=AB42.2.1 Implementation on TESLA 200 |first=J. |last=Nadrchal |journal=Algol Bulletin |issue=42 |date=May 1978}}</ref> [[Z80]] (1980)<ref>{{cite journal|url=http://www.80bus.co.uk/publications/magazines/LSG3.pdf |title=ALGOL68C on the Z80 |first=Raymond |last=Anderson |pages=52-57 |journal=Liverpool Software Gazette |edition=Third |date=March 1980 |access-date=2010-03-20 |url-status=dead |archive-url=https://web.archive.org/web/20100415194813/http://www.80bus.co.uk/publications/magazines/LSG3.pdf |archive-date=2010-04-15}}</ref> || Cambridge || ALGOL 68C |- |'''ALGOL 68 Revised Report'''<sup>[[#Revisions|r1]]</sup> || 1975 || Standard || Intl || IFIP WG 2.1 Revised Report || Specification || ACM || |- |[[Algol H]]<sup>H</sup> || 1975 || Experimental & other || {{flag|UK}} || Proposed extensions to the mode system of Algol 68 || Specification || || [[ALGOL W]] |- |[[Odra (computer)|Odra]] Algol 68 || 1976 || practical uses || {{flag|USSR}}/{{flag|Poland}} || || Odra 1204/IL || [[Copyright law of the Soviet Union|Soviet]] || [[ALGOL 60]] |- |Oklahoma ALGOL 68 || 1976 || programming instruction || {{flag|USA}} || [[Oklahoma State University]] implementation<ref>{{cite conference |last1=Hedrick |first1=G.E. |last2=Robertson |first2=Alan |title=The Oklahoma State ALGOL 68 Subset Compiler |conference=1975 International Conference on ALGOL 68 |location=Stillwater, OK |date=June 10–12, 1975}}</ref><ref>{{cite journal |last=Hedrick |first=G.E. |doi=10.1145/382175.803425 |title=ALGOL68 instruction at Oklahoma State University |journal=ACM SIGCSE Bulletin – Special Issue Eighth Technical Symposium on Computer Science Education |volume=9 |issue=3 |date=August 1977 |pages=16–20 |publisher=ACM |location=New York, NY, USA}}</ref> || [[IBM 1130]] and [[System/370]]/158 || {{Unknown|Unknown}} || ANSI [[Fortran 66]]. |- |Berlin ALGOL 68 || 1977 || Research || {{flag|DE}} || Portable compiler for System/370, Siemens S4004, and [[PDP-11]]<ref>{{cite journal |doi=10.1145/872738.807149 |title=The Berlin ALGOL 68 implementation |journal=ACM SIGPLAN Notices |volume=12 |issue=6 |pages=102-108 |first1=Wilfried |last1=Koch |first2=Christoph |last2=Oeters}}</ref><ref>{{cite conference |doi=10.1007/3-540-07410-4_665 |title=An abstract ALGOL 68 machine and its application in a machine independent compiler |conference=GI — 5. Jahrestagung |series=Lecture Notes in Computer Science |volume=34 |date=1975 |pages=642-653 |first1=W. |last1=Koch |first2=C. |last2=Oeters |editor-last=Mülbacher |editor-first=J. |publisher=Springer |location=Berlin, Heidelberg}}</ref> || Machine-independent compiler || [[Technische Universität Berlin]] || [[Compiler Description Language|CDL 2]] |- |[[FLACC]]<sup>F</sup> || 1977 || Multi-purpose || {{flag|CAN}} || Revised Report complete implementation with debug features || System/370 || lease, Chion Corporation || Assembler |- |[[ALGOL 68-RT]]<sup>RT</sup> || 1979 || Scientific || {{flag|UK}} || Parallel ALGOL 68-R || || || |- |[[RS Algol]]<sup>rs</sup> || 1979 || Scientific || {{flag|UK}} || || || || |- |ALGOL 68+ || 1980 || Scientific || {{flag|NLD}} || Proposed superlanguage of ALGOL 68<ref>{{cite web |url=http://hopl.murdoch.edu.au/showlanguage2.prx?exp%3D4351 |title=The Encyclopedia of Computer Languages |access-date=2010-03-20 |url-status=dead |archive-url=https://web.archive.org/web/20110310110439/http://hopl.murdoch.edu.au/showlanguage2.prx?exp=4351 |archive-date=2011-03-10}}</ref> || || || |- |[[M-220]] ALGOL 68 || || || {{flag|USSR}} || || M-220 || [[Copyright law of the Soviet Union|Soviet]] || EPSILON |- |[[Leningrad ALGOL 68]]<sup>L</sup> || 1980 || Telecommunications || {{flag|USSR}} || Full language + modules || IBM, DEC, CAMCOH, PS 1001 & PC || [[Copyright law of the Soviet Union|Soviet]] || |- |[[Interactive ALGOL 68]]<sup>I</sup> || 1983 || || {{flag|UK}} || [[Incremental compilation]] || PC || Noncommercial [[shareware]] ||| |- |[[ALGOL 68S]]<sup>S</sup> || 1985 || Scientific || Intl || Sun version of ALGOL 68 || [[Sun-3]], Sun [[SPARC]] (under [[SunOS]] 4.1 & [[Solaris (operating system)|Solaris]] 2), [[Atari]] ST (under [[Atari ST|GEMDOS]]), [[Acorn Archimedes]] (under [[RISC OS]]), [[VAX-11]] under [[Ultrix-32]] || || |- | Algol68toC<ref>[[SourceForge:projects/algol68/files/|Open source Algol 68 implementations – Browse Files at]]. Sourceforge.net. Retrieved on 2013-07-21.</ref> (ctrans) || 1985 || Electronics || {{flag|UK}} || ctrans from [[ELLA (programming language)|ELLA]] [[ALGOL 68RS]] || Portable C generator | {{Open source|[[Open-source software]]}} (1995) || ALGOL 68RS |- |MK2 [[Interactive ALGOL 68]] || 1992 || || {{flag|UK}} || [[Incremental compilation]] || PC || Noncommercial shareware<ref>{{cite web |url=http://www.nunan.fsnet.co.uk/algol68/a68mk2.zip |title=ZIP archive of MK2.1 release |archive-url=https://web.archive.org/web/20060829235643/http://www.nunan.fsnet.co.uk/algol68/a68mk2.zip |archive-date=2006-08-29 |url-status=dead}}</ref>|| |- |Algol 68 Genie<sup>G</sup> || 2001 || Full language || {{flag|NLD}} || Includes standard collateral clause || Portable interpreter | {{Open source|[[GPL]]}} | [[C (programming language)|C]] |- |Algol 68 Genie version 2.0.0 || 2010 || Full language || {{flag|NLD}} || || Portable interpreter; optional compilation of selected units | {{Open source|[[GPL]]}} | [[C (programming language)|C]] |- |[[GNU Compiler Collection|GCC]] (ga68) || 2025 || Full language || {{flag|ESP}} || GCC Front-End || Portable compiler | {{Open source|[[GPL]]}} | [[C (programming language)|C]] |} The [[S3 (programming language)|S3 language]] that was used to write the [[ICL 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. ===Implementation specific extensions=== ALGOL 68R from [[Royal Radar Establishment|RRE]] was the first ALGOL 68 subset implementation, running on the [[ICT 1900 series|ICL 1900]]. Based on the original language, the main subset restrictions were ''definition before use'' and no parallel processing. This compiler was popular in [[United Kingdom|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<sup>(RS)</sup> from [[Royal Signals and Radar Establishment|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|ICL 2900]]/[[ICL Series 39|Series 39]], [[Multics]] and [[VAX|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<sup>(S)</sup> 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. [[University of Cambridge|Cambridge]] [[ALGOL 68C]]<sup>(C)</sup> 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<sup>(G)</sup> 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."<ref>{{Cite web |url=http://www.fh-jena.de/~kleine/history/languages/Algol68-RR-HardwareRepresentation.pdf |title=The Report on the Standard Hardware Representation for Algol 68 |first1=Wilfred J. |last1=Hansen |first2=Hendrik |last2=Boom |access-date=2005-08-27 |archive-date=2014-01-02 |archive-url=https://web.archive.org/web/20140102201013/http://www.fh-jena.de/~kleine/history/languages/Algol68-RR-HardwareRepresentation.pdf |url-status=dead }}</ref> ==Quotes== *''... 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.<ref name="a68-c1">{{cite web |title=The Development of the C Language |author=Dennis Ritchie |date=April 1993 |url=http://cm.bell-labs.com/cm/cs/who/dmr/chist.pdf |access-date=2007-04-26 |quote=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. |url-status=dead |archive-url=http://wayback.vefsafn.is/wayback/20051106120954/http://cm.bell-labs.com/cm/cs/who/dmr/chist.pdf |archive-date=2005-11-06|author-link=Dennis Ritchie}}</ref> * ''... 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<ref name="a68-c2">{{cite web |title=C and Algol 68 |url=http://groups.google.co.uk/group/comp.lang.misc/browse_thread/thread/1e6d4bb30659b78d/f57b6f5c81502cf5 |author=Dennis Ritchie |date=June 1988 |access-date=2006-09-15|author-link=Dennis Ritchie |quote=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".}}</ref> *"Congratulations, your Master has done it" – [[Niklaus Wirth]]<ref>{{cite book |title = The Making of Algol 68 |author=C. H. A. Koster|series=Lecture Notes in Computer Science | date=1993 |citeseerx=10.1.1.76.2072}}</ref> *''The more I see of it, the more unhappy I become'' – E. W. Dijkstra, 1968<ref>{{cite web |title=To the Editor ALGOL 68 Mathematische Centrum |last=Dijkstra |first=E. W. |author-link=Edsger Dijkstra |url=http://www.cs.utexas.edu/users/EWD/transcriptions/EWD02xx/EWD230.html |access-date=2007-04-28 |url-status=live |archive-url=https://web.archive.org/web/20070421193554/http://www.cs.utexas.edu/users/EWD/transcriptions/EWD02xx/EWD230.html |archive-date=2007-04-21}}</ref> * ''[...] it was said that A68's popularity was inversely proportional to [...] the distance from Amsterdam'' – [[Guido van Rossum]]<ref>{{cite web |last=van Rossum |first=Guido |author-link=Guido van Rossum |date=June 2005 |title=Python-Dev Wishlist: dowhile |url=http://mail.python.org/pipermail/python-dev/2005-June/054225.html |access-date=2007-04-28}}</ref> * ''[...] 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." [...] '' – [[Tony Hoare|C. A. R. Hoare]] in his Oct 1980 [[Turing Award]] Lecture<ref>{{cite journal |last=Hoare |first=C. A. R. |author-link=Tony Hoare |date=February 1981 |title=The emperor's old clothes |orig-year=based on his 1980 [[Turing Award]] lecture |journal=[[Communications of the ACM]] |volume=24 |issue=2 |pages=75–83 |doi=10.1145/358549.358561 |s2cid=97895 |doi-access=free }} [http://zoo.cs.yale.edu/classes/cs422/2011/bib/hoare81emperor.pdf Alt URL] {{Webarchive|url=https://web.archive.org/web/20171002195604/http://zoo.cs.yale.edu/classes/cs422/2011/bib/hoare81emperor.pdf |date=2017-10-02 }}</ref> * ''"[...] 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.<ref>{{cite web|title=ALGOL Bulletin (referred to in AB30.1.1.1) |date=March 1970 |url=http://archive.computerhistory.org/resources/text/algol/algol_bulletin/A31/P111.HTM |access-date=2007-03-01 |url-status=live |archive-url=https://web.archive.org/web/20070930230048/http://archive.computerhistory.org/resources/text/algol/algol_bulletin/A31/P111.HTM |archive-date=2007-09-30}}</ref> ==See also== {{div col|colwidth=22em}} * [[ALGOL 60]] * [[ALGOL Y]] * [[ALGOL N]] * [[ALGOL 68C]] * [[C (programming language)]] * [[C++]] * [[Bourne shell]] * [[Bash (Unix shell)]] * [[Steelman language requirements]] * [[Ada (programming language)]] * [[Python (programming language)]] {{div col end}} ==References== ===Citations=== {{Reflist|refs= <ref name="Wijngaarden_1976">{{cite book |editor1-first=Adriaan |editor1-last=van Wijngaarden |editor-link1=Adriaan van Wijngaarden |editor2-first=Barry James |editor2-last=Mailloux |editor-link2=Barry James Mailloux |editor3-first=John Edward Lancelot |editor3-last=Peck |editor-link3=John Edward Lancelot Peck |editor4-first=Cornelis Hermanus Antonius |editor4-last=Koster |editor-link4=Cornelis Hermanus Antonius Koster |editor5-first=Michel |editor5-last=Sintzoff |editor-link5=:fr:Michel Sintzoff |editor6-first=Charles Hodgson |editor6-last=Lindsey |editor-link6=Charles Hodgson Lindsey |editor7-first=Lambert Guillaume Louis Théodore |editor7-last=Meertens |editor-link7=Lambert Guillaume Louis Théodore Meertens |editor8-first=Richard G. |editor8-last=Fisker |title=Revised Report on the Algorithmic Language ALGOL 68 |publisher=[[Springer-Verlag]] |date=1976 |isbn=978-0-387-07592-1 |oclc=1991170 |url=http://web.eah-jena.de/~kleine/history/languages/algol68-revisedreport.pdf |access-date=2019-05-11 |url-status=live |archive-url=https://web.archive.org/web/20190419223929/http://web.eah-jena.de/~kleine/history/languages/algol68-revisedreport.pdf |archive-date=2019-04-19}}</ref> }} ===Works cited=== {{Refbegin}} * 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 * {{cite journal |first=C. H. |last=Lindsey |date=1993-03-02 |title=A History of ALGOL 68 |journal=ACM SIGPLAN Notices |volume=28 |number=3 |pages=97–132 |doi=10.1145/155360.155365|doi-access=free }} * 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 '''8''', 155-190, June 1976 and '''9''', 255-256, September 1977, [http://vestein.arb-phys.uni-dortmund.de/~wb/RR/tanenbaum.pdf]{{dead link|date=June 2017 |bot=InternetArchiveBot |fix-attempted=yes}} * Woodward, P. M. and Bond, S. G., ''ALGOL 68-R Users<sup>[[sic]]</sup> Guide'', London, Her Majesty's Stationery Office, 1972 {{Refend}} ==External links== * [http://www.softwarepreservation.org/projects/ALGOL/report/Algol68_revised_report-AB.pdf Revised Report on the Algorithmic Language ALGOL 68] The official reference for users and implementors of the language (large pdf file, scanned from Algol Bulletin) * [https://web.archive.org/web/20150906170502/http://jmvdveer.home.xs4all.nl/algol68/report.html Revised Report on the Algorithmic Language ALGOL 68] Hyperlinked HTML version of the Revised Report * [http://portal.acm.org/citation.cfm?id=356671 ''A Tutorial on Algol 68''], by [[Andrew S. Tanenbaum]], in ''Computing Surveys'', Vol. 8, No. 2, June 1976, with [http://portal.acm.org/citation.cfm?id=356706 Corrigenda] (Vol. 9, No. 3, September 1977) * [https://jmvdveer.home.xs4all.nl/en.algol-68-genie.html Algol 68 Genie – a GNU GPL Algol 68 compiler-interpreter] * [http://algol68.sourceforge.net/ Open source ALGOL 68 implementations, on SourceForge] * [http://www.fh-jena.de/~kleine/history/languages/Algol68-RR-HardwareRepresentation.pdf Algol68 Standard Hardware representation (.pdf)] {{Webarchive|url=https://web.archive.org/web/20140102201013/http://www.fh-jena.de/~kleine/history/languages/Algol68-RR-HardwareRepresentation.pdf |date=2014-01-02 }} * [http://www.computer-museum.ru/histsoft/algol68.htm Из истории создания компилятора с Алгол 68] * [http://www.computer-museum.ru/english/algol68.htm Algol 68 – 25 Years in the USSR] * [https://web.archive.org/web/20060310003954/http://ant.tepkom.ru/newsite/disser/doc/Ruchlin.htm Система программ динамической поддержки для транслятора с Алгол 68] * [https://web.archive.org/web/19980220175804/http://cm.bell-labs.com/cm/cs/who/dmr/chist.html C history with Algol68 heritage] * McJones, Paul, [http://www.softwarepreservation.org/projects/ALGOL/algol68impl "Algol 68 implementations and dialects"], ''Software Preservation Group'', [[Computer History Museum]], 2011-07-05 * [https://archive.today/20150416164933/http://vintagebigblue.org/Compilerator/ALGOL68C/mvsAlgol68CCompile.php Web enabled ALGOL 68 compiler for small experiments] {{ALGOL programming}} {{Authority control}} {{DEFAULTSORT:Algol 68}} [[Category:ALGOL 68| ]] [[Category:Algol programming language family]] [[Category:Academic programming languages]] [[Category:Articles with example ALGOL 68 code]] [[Category:Computer-related introductions in 1968]] [[Category:Procedural programming languages]] [[Category:Programming languages created in 1968]] [[Category:Systems programming languages]] [[Category:Programming languages]]
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)
Pages transcluded onto the current version of this page
(
help
)
:
Template:ALGOL programming
(
edit
)
Template:Authority control
(
edit
)
Template:Char
(
edit
)
Template:Citation
(
edit
)
Template:Citation needed
(
edit
)
Template:Cite book
(
edit
)
Template:Cite conference
(
edit
)
Template:Cite journal
(
edit
)
Template:Cite web
(
edit
)
Template:Clear
(
edit
)
Template:Code
(
edit
)
Template:Dead link
(
edit
)
Template:Div col
(
edit
)
Template:Div col end
(
edit
)
Template:Flag
(
edit
)
Template:Infobox programming language
(
edit
)
Template:Note
(
edit
)
Template:Nowrap
(
edit
)
Template:Open source
(
edit
)
Template:Pre
(
edit
)
Template:Quote box
(
edit
)
Template:Ref
(
edit
)
Template:Refbegin
(
edit
)
Template:Refend
(
edit
)
Template:Reflist
(
edit
)
Template:Rquote
(
edit
)
Template:Sfn
(
edit
)
Template:Short description
(
edit
)
Template:SpecialChars
(
edit
)
Template:Sxhl
(
edit
)
Template:Tt
(
edit
)
Template:Unknown
(
edit
)
Template:Use dmy dates
(
edit
)
Template:Var
(
edit
)
Template:Verth
(
edit
)
Template:Webarchive
(
edit
)