User guide

Chapter 2
The BCPL Language
The design of BCPL owes much to th e work done on CPL (originally Cambridge
Programming Language) which was conceived at Cambr idge to be the main lan-
guage to run on the new an d powerful Ferranti Atlas computer to be installed
in 1963. At that time there was another Atlas computer in London and it was
decided to make the development of CPL a joint project between the two Uni-
versities. As a result the name chan g ed to Combined Progra m m i n g Language. It
could reasonably be called Christopher’s Programmin g Language in recognition
of Christpher Strachey wh o se bu b bling enthusiasm and talent steered the course
of its devel o p m ent.
CPL was an ambitious language in t h e ALGOL tradition bu t with many novel
and significant extensions intended to make its area of application more general.
These included a grea t er richness in control con st r u ct s such as t h e now well known
IF, UNLESS, WHILE, UNTIL, REPEATWHILE, SWITCHON statements. It could h andle
a wide variety of data types including string and bit patterns and was one of the
first strictly typed languages to provided a structure mechanism that permitted
convenient handling of lists, trees and directed gr aphs. Work on CPL ran from
about 1961 to 1967, but was hampered by a number of factors that event ually
killed it . It was, for instance, too large and comp l i cat ed for the machines available
at the time, and the desire for elegance and mathematical cleanliness outweighed
the more pragmati c arguments for efficiency and implem entability. Much of the
implementation was done by research students who came and left during the
lifetime of the project. As soon as they knew enough to be useful they had
to transfer t h e ir attention to writing theses. Another problem (that became of
particular interest to me) was that the implementation at Cambridge had to move
from EDSAC I I to the Atlas computer about halfway through the project. The
CPL compiler thus needed to be portable. This was achieved by writing it in a
simple subset of CPL which was then hand translated into a sequence of low level
macro calls that coul d be expanded into the assembly language of either machine.
The macrogenerator used was GPM[6] designed by Strachey specificall y for this
task. A d el i ghtfully elegant work of art in its own right it is well worth study. A
11