ALGOL 68G
Encyclopedia
ALGOL68G or Algol 68 Genie is a recent ALGOL 68
compiler
-interpreter
. ALGOL68G is a nearly full implementation of ALGOL 68 as defined by the Revised Report and also implements partial parametrisation, which is an extension of ALGOL 68. After successful parsing of an entire source program, the syntax tree, that serves as an intermediate program representation, is interpreted. The interpreter performs many runtime checks. Optionally, units with large interpreter overhead can be compiled to speed execution.
The author and maintainer of Algol 68 Genie is Marcel van der Veer. Algol 68 Genie is released under GPL
and runs on Linux, Unix, Mac OS X and Windows, and is available here.
ALGOL 68
ALGOL 68 isan imperative computerprogramming language that was conceived as a successor to theALGOL 60 programming language, designed with the goal of a...
compiler
Compiler
A compiler is a computer program that transforms source code written in a programming language into another computer language...
-interpreter
Interpreter (computing)
In computer science, an interpreter normally means a computer program that executes, i.e. performs, instructions written in a programming language...
. ALGOL68G is a nearly full implementation of ALGOL 68 as defined by the Revised Report and also implements partial parametrisation, which is an extension of ALGOL 68. After successful parsing of an entire source program, the syntax tree, that serves as an intermediate program representation, is interpreted. The interpreter performs many runtime checks. Optionally, units with large interpreter overhead can be compiled to speed execution.
The author and maintainer of Algol 68 Genie is Marcel van der Veer. Algol 68 Genie is released under GPL
GNU General Public License
The GNU General Public License is the most widely used free software license, originally written by Richard Stallman for the GNU Project....
and runs on Linux, Unix, Mac OS X and Windows, and is available here.
Features of Algol 68 Genie
- The interpreter performs checks on many events, for example: assigning to
NIL
or dereferencing ofNIL
, using uninitialised values, invalid operands to standard prelude operators and procedures, bounds check when manipulating arrays, overflow of arithmetic modes, "dangling references", that are names that refer to deallocated storage. - Precision of numeric modes: implementation of
LONG INT, LONG REAL
andLONG COMPLEX
with roughly doubled precision with respect toINT, REAL, COMPLEX
and implementation of multiprecision arithmetic throughLONG LONG INT, LONG LONG REAL
andLONG LONG COMPLEX
which are modes with user defined precision which is set by an option. - On systems that support them, Linux extensions that allow e.g. for executing child processes that communicate through pipes, matching regular expressionRegular expressionIn computing, a regular expression provides a concise and flexible means for "matching" strings of text, such as particular characters, words, or patterns of characters. Abbreviations for "regular expression" include "regex" and "regexp"...
s or fetching web page contents. - Procedures for drawing using the GNU Plotting Utilities.
- Various numerical procedures and basic linear algebra procedures from the GNU Scientific Library.
- Various PostgreSQL client routines.
- Format texts, straightening and formatted transput. Transput routines work generically on files, (dynamic) strings and pipes.
- Support for the parallel clause on platforms that support POSIX threads.
- Upper stropping is the default, quote stropping is optional.
Extensions to Algol 68
- Implementation of C.H. Lindsey's partial parametrisation proposal, which allows for curryingCurryingIn mathematics and computer science, currying is the technique of transforming a function that takes multiple arguments in such a way that it can be called as a chain of functions each with a single argument...
in Algol 68, giving it a functional sublanguage. - A simple refinement preprocessor to facilitate top-down program construction.
- Implementation of pseudo-operators
ANDF
andORF
. - Implementation of a post-checked loop. A do-part may enclose a serial clause followed by an optional until-part, or just enclose an until-part. This is an alternative to the paradigm Algol 68 post-check loop
WHILE ... DO SKIP OD
. - Implementation of
DOWNTO
with comparable function asTO
in loop clauses;DOWNTO
decreases, whereasTO
increases, the loop counter by the value of the (implicit) by-part.
Deviations from the Revised Report language
The important deviations are:- The important difference with the Revised Report transput model is that Algol 68 Genie transput does not operate on
FLEX [ ] FLEX [ ] FLEX [ ] CHAR
, but on aFLEX [ ] CHAR
. This maps better onto operating systems such as Unix or Linux. - The Algol 68 Genie parallel clause deviates from the Algol 68 parallel clause when parallel clauses are nested. In Algol 68 Genie, stack frames inside a parallel unit are private, therefore if parallel units modify a shared variable then this variable must be declared outside the outermost parallel clause, and a jump out of a parallel unit can only be targeted at a label outside the outermost parallel clause.
- Transputting a file is essentially sequential. Only
reset
can intervene with sequential processing. - When all arguments in a call of
readf, printf, writef, getf
orputf
are processed, the format associated with the corresponding file is purged - that is, remaining insertions are processed and the format is discarded.