BCPL

From Computer History Wiki
Revision as of 16:04, 10 September 2017 by Jnc (talk | contribs) (Fix error in CPL institutions)
Jump to: navigation, search

BCPL is a programming language that was first developed in the late 1960's. Although little-used nowdays, it is historically important as C is derived from it. (C can be crisply, and aptly, described as 'BCPL with types and terser syntax'.)

Like ALGOL, from which is is descended, it includes modern control flow, including 'block structure'. Unlike Algol, it did not have types; the only type spported was 'word'.

It was intended by Martin Richards, its designer, mostly for systems programming (such as operating systems, compilers, etc), for which the type limitation was not severe. (The lack of any support for floating point made it a poor choice for classic computational applications.)

BCPL was also used in a number of other significant places, including much of the early work on the Xerox Alto.

History

BCPL is based on Combined Programming Language (CPL), an ambitious collaboration between Cambridge University and the University of London, by a team including Christopher Strachey. BCPL was defined in part as a interim (originally the name apparently stood for 'Bootstrap CPL'; it later became 'Basic CPL') while waiting for CPL to appear (which it never did).

BCPL retains much of the syntactic richness of CPL, but did so while considerably limiting its complexity - thereby producing a very elegant language.

It was first implemented on the CTSS operating system, while Richards was visiting MIT. A number of the early UNIX personnel from Bell Labs became familiar with it there, while working on Multics.

Portability

Portability was a significant goal of BCPL, both in the language itself, and in also in the openly available original BCPL compiler, itself written in BCPL; this compiler was ported to a large number of machines.

The compiler was structured as three phases, the third of which converted a machine-independent intermediate language called OCODE, generated by the second phase, into the target machine's object code.

Porting the compiler involved writing a new third phase; compiling that with the existing compiler on the host machine, producing a cross-compiler; and then running the compiler itself through the cross-compiler, producing a native compiler for the target machine.