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
(section)
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!
==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>
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)