ALGOL 68C
Encyclopedia
The ALGOL68C computer programming language compiler was developed for the CHAOS OS for the CAP capability computer
CAP computer
The Cambridge CAP computer was the first successful experimental computer that demonstrated the use of security capabilities, both in hardware and software. It was developed at the University of Cambridge Computer Laboratory in the 1970s...

 at Cambridge University
University of Cambridge
The University of Cambridge is a public research university located in Cambridge, United Kingdom. It is the second-oldest university in both the United Kingdom and the English-speaking world , and the seventh-oldest globally...

 in 1971 by Stephen Bourne and Michael Guy as a dialect of ALGOL 68
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...

. Other early contributors were Andrew D. Birrell and Ian Walker.

The initial compiler was written in PSYCO
Psyco
Psyco is a specializing just-in-time compiler for Python originally developed by Armin Rigo and further maintained and developed by Christian Tismer....

 (the Princeton SYntax COmpiler by Edgar T. Irons) and implemented by J.H. Mathewman at Cambridge. The language was called Z was subsequently morphed into ALGOL 68. ALGOL68C was built to develop the CAMbridge ALgebra system called CAMAL.

Subsequent work was done on the compiler after Bourne left Cambridge University in 1975. Garbage collection was added and the code base is still running on an emulated OS/MVT using Hercules
Hercules emulator
Hercules is a computer emulator which allows software designed for IBM mainframe computers and for plug-compatible mainframes to run on other types of computer hardware: notably on low-cost personal computers...

.

The ALGOL68C compiler generated ZCODE output, that could then be either compiled into the local machine code by a ZCODE translator or run interpreted. ZCODE is a register-based intermediate language. This ability to interpret or compile ZCODE encouraged the porting of ALGOL 68C to numerous different computer platforms. Aside from the CAP capability computer the compiler was ported to systems including CMS
Conversational Monitor System
The Conversational Monitor System is a relatively simple interactive computing single-user operating system.* CMS is part of IBM's VM family, which runs on IBM mainframe computers...

, TOPS-10
TOPS-10
The TOPS-10 System was a computer operating system from Digital Equipment Corporation for the PDP-10 mainframe computer launched in 1967...

 and Z80.

Popular Culture

A very early predecessor of this compiler was used by Guy and Bourne to write the first life game program
Conway's Game of Life
The Game of Life, also known simply as Life, is a cellular automaton devised by the British mathematician John Horton Conway in 1970....

s on the PDP-7
PDP-7
The DEC PDP-7 is a minicomputer produced by Digital Equipment Corporation. Introduced in 1965, it was the first to use their Flip-Chip technology. With a cost of only $72,000 USD, it was cheap but powerful by the standards of the time. The PDP-7 was the third of Digital's 18-bit machines, with...

 with a DEC 340 display (see Scientific American
Scientific American
Scientific American is a popular science magazine. It is notable for its long history of presenting science monthly to an educated but not necessarily scientific public, through its careful attention to the clarity of its text as well as the quality of its specially commissioned color graphics...

 article) "For long-lived populations such as this one Conway sometimes uses a PDP-7 computer with a screen on which he can observe the changes. The program was written by M. J. T. Guy and S. R. Bourne. Without its help some discoveries about the game would have been difficult to make." Scientific American
Scientific American
Scientific American is a popular science magazine. It is notable for its long history of presenting science monthly to an educated but not necessarily scientific public, through its careful attention to the clarity of its text as well as the quality of its specially commissioned color graphics...

 223 (October 1970): 120-123.

Various Liverpool Software Gazette
Liverpool Software Gazette
Liverpool Software Gazette was a short-lived computer magazine published by Microdigital, a company who were based in Liverpool, England and run by Bruce Everiss.-History:...

 issues detail the Z80 implementation. The compiler required about 120Kb of memory to run, hence the Z80's 64Kb memory is actually too small to run the compiler. So ALGOL 68C programs for the Z80 had to be cross compiled
Cross compiler
A cross compiler is a compiler capable of creating executable code for a platform other than the one on which the compiler is run. Cross compiler tools are used to generate executables for embedded system or multiple platforms. It is used to compile for a platform upon which it is not feasible to...

 from ALGOL 68C running on the larger CAP capability computer or an IBM 370
IBM 370
The IBM 370 printer was used on the IBM 305 RAMAC computer system, introduced by IBM on September 14, 1956. The 370 was connected to the 305 by a serial data line from the S track of the computer's drum memory and printed 80-columns with a punched tape controlled carriage...

 mainframe.

Algol 68C and Unix

Stephen Bourne subsequently reused ALGOL 68
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...

's revered if ~ then ~ else ~ fi, case ~ in ~ out ~ esac and for ~ while ~ do ~ od clauses in the common Unix
Unix
Unix is a multitasking, multi-user computer operating system originally developed in 1969 by a group of AT&T employees at Bell Labs, including Ken Thompson, Dennis Ritchie, Brian Kernighan, Douglas McIlroy, and Joe Ossanna...

 Bourne shell
Bourne shell
The Bourne shell, or sh, was the default Unix shell of Unix Version 7 and most Unix-like systems continue to have /bin/sh - which will be the Bourne shell, or a symbolic link or hard link to a compatible shell - even when more modern shells are used by most users.Developed by Stephen Bourne at AT&T...

, but with in's syntax changed, out removed, and od replaced with done (to avoid conflict with the od
Od (Unix)
od is an octal dumping program for Unix and Unix-like systems. It can also dump hexadecimal or decimal data.od is one of the earliest Unix programs, having appeared in version 1 AT&T Unix. It is also specified in the POSIX standards...

 utility).

After Cambridge
University of Cambridge
The University of Cambridge is a public research university located in Cambridge, United Kingdom. It is the second-oldest university in both the United Kingdom and the English-speaking world , and the seventh-oldest globally...

, Bourne spent nine years at Bell Labs
Bell Labs
Bell Laboratories is the research and development subsidiary of the French-owned Alcatel-Lucent and previously of the American Telephone & Telegraph Company , half-owned through its Western Electric manufacturing subsidiary.Bell Laboratories operates its...

 with the Seventh Edition Unix team. As well as developing the Bourne shell, he ported ALGOL 68C to Unix on the DEC PDP-11
PDP-11
The PDP-11 was a series of 16-bit minicomputers sold by Digital Equipment Corporation from 1970 into the 1990s, one of a succession of products in the PDP series. The PDP-11 replaced the PDP-8 in many real-time applications, although both product lines lived in parallel for more than 10 years...

-45 and included a special option in his Unix debugger
Debugger
A debugger or debugging tool is a computer program that is used to test and debug other programs . The code to be examined might alternatively be running on an instruction set simulator , a technique that allows great power in its ability to halt when specific conditions are encountered but which...

 "adb
ADB
ADB is a three-letter acronym that may refer to the intergovernmental organizations:* The Asian Development Bank, a non-profit financial institution whose aim is to help developing Asian countries...

" to obtain a stack backtrace for programs written in ALGOL68C. Here is an extract from the Unix 7th edition adb manual pages:
NAME
adb - debugger
SYNOPSIS
adb [-w] [ objfil [ corfil ] ]
[...]
COMMANDS
[...]
$modifier
Miscellaneous commands. The available modifiers
are:
[...]
a ALGOL 68 stack backtrace. If address is
given then it is taken to be the address of
the current frame (instead of r4). If count
is given then only the first count frames
are printed.

ALGOL 68C extensions to Algol 68

Below is a sampling of some notable extensions:
  • Automatic op:= for any operator, e.g. *:= and +:=
  • UPTO, DOWNTO and UNTIL in loop-clauses;
  • displacement operator (:=:=)
  • ANDF, ORF and THEF syntactic elements.
  • separate compilation - ENVIRON clause and USING clause
  • scopes not checked
  • bounds in formal-declarers
  • CODE ... EDOC clause - for embedding ZCODE

The ENVIRON and USING clauses.

Separate compilation in ALGOL 68C is done using the ENVIRON and USING clauses. The ENVIRON saves the complete environment at the point it appears. A separate module written starting with a USING clause is effectively inserted into the first module at the point the ENVIRON clause appears.

ENVIRON and USING are useful for a top-down style of programming, in contrast to the bottom-up style implied by traditional library mechanisms.

These clauses are kind of the inverse of the #include found in the C programming language
C (programming language)
C is a general-purpose computer programming language developed between 1969 and 1973 by Dennis Ritchie at the Bell Telephone Laboratories for use with the Unix operating system....

, or import found in Python
Python (programming language)
Python is a general-purpose, high-level programming language whose design philosophy emphasizes code readability. Python claims to "[combine] remarkable power with very clear syntax", and its standard library is large and comprehensive...

. The purpose of the ENVIRON mechanism is to allow a program source to be broken into manageable sized pieces. Note that it is only necessary to parse the shared source file once, unlike a #include found in the C programming language
C (programming language)
C is a general-purpose computer programming language developed between 1969 and 1973 by Dennis Ritchie at the Bell Telephone Laboratories for use with the Unix operating system....

 where the include file needs to be parsed for each source file that includes it.

Example of ENVIRON clause

A file called mylib.a68:

BEGIN
INT dim = 3; # a constant #
INT a number := 120; # a variable #
ENVIRON EXAMPLE1;
MODE MATRIX = [dim, dim]REAL; # a type definition #
MATRIX m1;
a number := ENVIRON EXAMPLE2;
print((a number))
END

Example of USING clause

A file called usemylib.a68:

USING EXAMPLE2 FROM "mylib"
BEGIN
MATRIX m2; # example only #
print((a number)); # declared in mylib.a68 #
print((2 UPB m1)); # also declared in mylib.a68 #
ENVIRON EXAMPLE3; # ENVIRONs can be nested #
666
END

Restrictions to the language from the standard ALGOL 68

  • no algol68 FLEX and variable length arrays.
  • MODE STRING implemented without FLEX.
  • The PAR parallel clause was not implemented.
  • nonstandard transput.
  • others...


A translator/compiler for ALGOL 68C was available for the PDP-10
PDP-10
The PDP-10 was a mainframe computer family manufactured by Digital Equipment Corporation from the late 1960s on; the name stands for "Programmed Data Processor model 10". The first model was delivered in 1966...

 and System/360
System/360
The IBM System/360 was a mainframe computer system family first announced by IBM on April 7, 1964, and sold between 1964 and 1978. It was the first family of computers designed to cover the complete range of applications, from small to large, both commercial and scientific...

 as well as a number of other computers.

See also

  • ALGOL 68
    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...

  • C
    C (programming language)
    C is a general-purpose computer programming language developed between 1969 and 1973 by Dennis Ritchie at the Bell Telephone Laboratories for use with the Unix operating system....

  • C++
    C++
    C++ is a statically typed, free-form, multi-paradigm, compiled, general-purpose programming language. It is regarded as an intermediate-level language, as it comprises a combination of both high-level and low-level language features. It was developed by Bjarne Stroustrup starting in 1979 at Bell...

  • Bourne shell
    Bourne shell
    The Bourne shell, or sh, was the default Unix shell of Unix Version 7 and most Unix-like systems continue to have /bin/sh - which will be the Bourne shell, or a symbolic link or hard link to a compatible shell - even when more modern shells are used by most users.Developed by Stephen Bourne at AT&T...

  • Bash (Unix shell)

External links

The source of this article is wikipedia, the free encyclopedia.  The text of this article is licensed under the GFDL.
 
x
OK