ArticleslgStudy

computer science

ALGOL 68C

ALGOL 68C is a computer science topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand ALGOL 68C rather than just read about it. In short: 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).

Key takeaways

  • ALGOL 68C belongs to computer science; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect ALGOL 68C to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of ALGOL 68C from memory before moving on to harder problems.

Reference excerpt

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. 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 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 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.

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, 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 No ALGOL 68 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, IBM System/360 and several other computers.

Popular culture 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. 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:

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.

References

External links Official website Cambridge ALGOL 68: on the historical roster of computer languages – includes 10+ publication references. A Transportation of ALGOL 68C – PJ Gardner, University of Essex – March 1977 (From 370 to DECsystem-10) Running ALGOL 68C on MVS - how to install ALGOL 68C on an emulated MVS system

Worked examples

Example 1 — a first encounter with ALGOL 68C

Start with the simplest possible case. Write down what ALGOL 68C claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In computer science, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to ALGOL 68C before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about ALGOL 68C ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of ALGOL 68C

In research
ALGOL 68C appears in computer science research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses ALGOL 68C in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
ALGOL 68C is common in secondary-school and first-year university syllabi. It links to neighbouring topics ALGOL 68 implementation, Virtualization software, so understanding it makes those chapters shorter.
In everyday life
Look for ALGOL 68C outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “ALGOL 68C” →

How to study ALGOL 68C in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what ALGOL 68C means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain ALGOL 68C out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is ALGOL 68C in simple terms?

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).

Why does ALGOL 68C matter?

Because it connects several computer science ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study ALGOL 68C?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on ALGOL 68C.

Tags

  • ALGOL 68 implementation
  • Virtualization software

Keep exploring