ALGOL 68C

Last updated
ALGOL 68 Cambridge
Developer(s) Stephen Bourne, Michael Guy, Andrew D. Birrell, Ian Walker, Chris Cheney, et al.
Initial releasecirca 1970;51 years ago (1970)
Stable release
1.3039 / March 3, 2013;8 years ago (2013-03-03)
Written in ALGOL 68
Operating system IBM 360, 370, etc., mainframes (or emulations) running MVT or MVS
Type Compiler, translator
Website bitbucket.org/algol68c/dl

ALGOL 68C is an imperative computer programming language, a dialect of ALGOL 68, that was developed by Stephen R. Bourne and Michael Guy to program the Cambridge Algebra System (CAMAL). The initial compiler was written in the Princeton Syntax Compiler (PSYCO, by Edgar T. Irons) that was implemented by J. H. Mathewman at Cambridge.

Contents

ALGOL 68C was later used for the CHAOS OS for the capability-based security CAP computer at University of Cambridge in 1971. Other early contributors were Andrew D. Birrell [1] and Ian Walker.

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[ clarification needed ] on an emulated OS/MVT using Hercules.

The ALGOL 68C compiler generated output in ZCODE, a register-based intermediate language, which could then be either interpreted or compiled to a native executable. This ability to interpret or compile ZCODE encouraged the porting of ALGOL 68C to many different computing platforms. Aside from the CAP computer, the compiler was ported to systems including Conversational Monitor System (CMS), TOPS-10, and Zilog Z80.

A very early predecessor of this compiler was used by Guy and Bourne to write the first Game of Life programs on the PDP-7 with a DEC 340 display. [2] [3]

Various Liverpool Software Gazette issues detail the Z80 implementation. The compiler required about 120 KB of memory to run; hence the Z80's 64 KB memory is actually too small to run the compiler. So ALGOL 68C programs for the Z80 had to be cross-compiled from the larger CAP computer, or an IBM System/370 mainframe computer.

Algol 68C and Unix

Stephen Bourne subsequently reused ALGOL 68's if ~ then ~ else ~ fi, case ~ in ~ out ~ esac and for ~ while ~ do ~ od clauses in the common Unix Bourne shell, but with in's syntax changed, out removed, and od replaced with done (to avoid conflict with the od utility).

After Cambridge, Bourne spent nine years at Bell Labs with the Version 7 Unix (Seventh Edition Unix) team. As well as developing the Bourne shell, he ported ALGOL 68C to Unix on the DEC PDP-11-45 and included a special option in his Unix debugger Advanced Debugger (adb) to obtain a stack backtrace for programs written in ALGOL 68C. Here is an extract from the Unix 7th edition manual pages: [4]

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: [5]

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, or import found in Python. The purpose of the ENVIRON mechanism is to allow a program source to be broken into manageable sized pieces. It is only necessary to parse the shared source file once, unlike a #include found in the C programming language 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

A translator–compiler for ALGOL 68C was available for the PDP-10, IBM System/360 and several other computers.

Related Research Articles

ALGOL Family of programming languages

ALGOL is a family of imperative computer programming languages originally developed in 1958. ALGOL heavily influenced many other languages and was the standard method for algorithm description used by the Association for Computing Machinery (ACM) in textbooks and academic sources for more than thirty years.

BCPL is a procedural, imperative, and structured programming language. Originally intended for writing compilers for other languages, BCPL is no longer in common use. However, its influence is still felt because a stripped down and syntactically changed version of BCPL, called B, was the language on which the C programming language was based. BCPL introduced several features of many modern programming languages, including using curly braces to delimit code blocks. BCPL was first implemented by Martin Richards of the University of Cambridge in 1967.

B is a programming language developed at Bell Labs circa 1969. It was developed by Ken Thompson and Dennis Ritchie.

In computing, a compiler is a computer program that translates computer code written in one programming language into another language. The name "compiler" is primarily used for programs that translate source code from a high-level programming language to a lower level language to create an executable program.

Mesa is a programming language developed in the late 1970s at the Xerox Palo Alto Research Center in Palo Alto, California, United States. The language name was a pun based upon the programming language catchphrases of the time, because Mesa is a "high level" programming language.

Pascal (programming language) Programming language

Pascal is an imperative and procedural programming language, designed by Niklaus Wirth as a small, efficient language intended to encourage good programming practices using structured programming and data structuring. It is named in honour of the French mathematician, philosopher and physicist Blaise Pascal.

Bourne shell Command-line interpreter for operating systems

The Bourne shell (sh) is a shell command-line interpreter for computer operating systems.

Stephen R. Bourne British computer scientist

Stephen Richard "Steve" Bourne is an English computer scientist based in the United States for most of his career. He is well known as the author of the Bourne shell (sh), which is the foundation for the standard command-line interfaces to Unix.

In computer programming, standard streams are interconnected input and output communication channels between a computer program and its environment when it begins execution. The three input/output (I/O) connections are called standard input (stdin), standard output (stdout) and standard error (stderr). Originally I/O happened via a physically connected system console, but standard streams abstract this. When a command is executed via an interactive shell, the streams are typically connected to the text terminal on which the shell is running, but can be changed with redirection or a pipeline. More generally, a child process inherits the standard streams of its parent process.

This article presents a timeline of events in the history of computer operating systems from 1951 to the current day. For a narrative explaining the overall developments, see the History of operating systems.

TOPS-10 System is a discontinued operating system from Digital Equipment Corporation (DEC) for the PDP-10 mainframe computer family. Launched in 1967, TOPS-10 evolved from the earlier "Monitor" software for the PDP-6 and PDP-10 computers; this was renamed to TOPS-10 in 1970.

ALGOL 68 Programming language

ALGOL 68 is an imperative programming language that was conceived as a successor to the ALGOL 60 programming language, designed with the goal of a much wider scope of application and more rigorously defined syntax and semantics.

ALGOL 68S is a programming language designed as a subset of ALGOL 68, to allow compiling via a one-pass compiler. It was mostly for numerical analysis.

Edinburgh IMP is a development of Atlas Autocode, initially developed around 1966-1969 at the University of Edinburgh, Scotland. It is a general-purpose programming language which was used heavily for systems programming.

S-algol is a computer programming language derivative of ALGOL 60 developed at the University of St Andrews in 1979 by Ron Morrison and Tony Davie. The language is a modification of ALGOL to contain orthogonal data types that Morrison created for his PhD thesis. Morrison would go on to become professor at the university and head of the department of computer science. The S-algol language was used for teaching at the university at an undergraduate level until 1999. It was also the language taught for several years in the 1980s at a local school in St. Andrews, Madras College. The computer science text Recursive Descent Compiling describes a recursive descent compiler for S-algol, implemented in S-algol.

ALGOL 68RS is the second ALGOL 68 compiler written by I. F. Currie and J. D. Morrison, at the Royal Signals and Radar Establishment (RSRE). Unlike the earlier ALGOL 68-R, it was designed to be portable, and implemented the language of the Revised Report.

In computer programming, self-hosting is the use of a program as part of the toolchain or operating system that produces new versions of that same program—for example, a compiler that can compile its own source code. Self-hosting software is commonplace on personal computers and larger systems. Other programs that are typically self-hosting include kernels, assemblers, command-line interpreters and revision control software.

References

  1. Birrell, Andrew D. (December 1977). "System Programming in a High Level Language" (PDF). Dissertation submitted for the degree of Doctor of Philosophy. University of Cambridge. Retrieved 2007-04-22.
  2. "Item Detail: Digital Equipment Corporation Model 340". Australian Computer Museum Society (ACMS). AceWare Web Hosting. Retrieved 2020-04-17.
  3. Gardner, Martin (October 1970). "The fantastic combinations of John Conway's new solitaire game "life"" (PDF). Mathematical Games. Scientific American . No. 223. pp. 120–123. 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.
  4. "The Modular Manual Browser: Adb". UnixDev.net. Archived from the original on 2016-03-03. Retrieved 2020-04-17.
  5. Bourne, Stephen R.; Birrell, Andrew D.; Walker, Ian (1975). ALGOL 68C reference manual. Cambridge University Computer Laboratory.