Interactive ALGOL 68
Appearance
| Interactive ALGOL 68 | |
|---|---|
| Paradigms | structured, imperative |
| Family | ALGOL |
| Designed by | Peter Craven |
| Developer | Algol Applications, Oxford and Cambridge Compilers Ltd (OCCL) |
| First appeared | 1984 |
| Final release | Final
/ 2004 |
| Typing discipline | static, strong, safe, structural |
| Scope | lexical |
| Platform | Intel x86, Inmos Transputer: SPARC |
| OS | Linux, SunOS-4.1.3 (Solaris 1); Windows 95, NT; OS/2 |
| License | proprietary |
| Influenced by | |
| ALGOL 68 | |
The Interactive ALGOL 68 is a structured, imperative high-level computer programming language, a dialect of, and compiler for, ALGOL 68. It was made available by Peter Craven of Algol Applications in 1984,[1] then in 1994 from OCCL (Oxford and Cambridge Compilers Ltd) until 2004.[2]
Platforms
[edit]- Inmos Transputer family
- Linux for Intel x86 computers
- OS/2 version 2.0 and after
- SunOS-4.1.3 (Solaris 1) for SPARC-based computers
- Microsoft Windows 95 and Windows NT for Intel
Extensions to standard ALGOL 68
[edit]- Ability to include source code, and versions of source code.
- Nestable comments
- FORALL syntactic element for looping over arrays.
- ANYMODE a union of all MODEs known to the compiler, and hence dynamic typing.
- Enhanced coercions (casting) allowing stringer then "strong" coercions.
- Enstructuring automatically coerces a variable from type to struct(type)
- Conforming coerces UNION (THING, MOODS) to THING, but if that is not the current mood of the union, then a run-time error will be generated.
- Library interface to the native operating system and other libraries.
- The operator SIZE
- Pseudo-operators ANDTH and OREL, and ANF and ORF for Short-circuit evaluation of Boolean expressions.
- Arrays can be slices with stride to select a subset of elements.
- MOID is treated differently.
Example of code
[edit]MODULE vectors
BEGIN
INT dim=3;
MODE VECTOR = [dim]REAL;
OP + = (VECTOR a, b) VECTOR: ( VECTOR out; FOR i FROM LWB a TO UPB a DO out:=a[i]+b[i] OD; out ),
- = (VECTOR a, b) VECTOR: ( VECTOR out; FOR i FROM LWB a TO UPB a DO out:=a[i]-b[i] OD; out ),
DOT = (VECTOR a, b) REAL: ( REAL out:=0; FOR i FROM LWB a TO UPB a DO out+:=a[i]*b[i] OD; out );
END
KEEP VECTOR, +, -, DOT
Restrictions to the language from the standard ALGOL 68
[edit]- Variable, Modes and Operators must be declared before use.
- Anonymous procedure may use rows-declarer as a parameter.
- No transient subnames of flexible arrays.
- No formatted Transput (or format-texts).
- Restricted use of straightening of multiple values during Transput.
- Limited use of BYTES, BITS and BOOL.
- restricted use of labels to follow EXIT statements.
See also
[edit]References
[edit]- ^ "AB52.3.1: Survey of Viable ALGOL 68 Implementations". Archived from the original on 27 September 2007. Retrieved 26 April 2007.
- ^ "Oxford and Cambridge Compilers Ltd Home Page". Archived from the original on 12 June 2004. Retrieved 26 April 2007.