BCPL
BCPL
BCPL — Basic Combined Programming Language — is the middle link in the most important chain in systems software: CPL → BCPL → B → C. Martin Richards created it at Cambridge in 1967 by taking CPL — the elegant, unimplementable monster — and stripping it to a bootstrap compiler: something small enough to port to a new machine in 2–5 person-months, reputedly compilable in as little as 16 KB. Its purpose was never application programming: it was designed to write other compilers and operating systems, and to move easily between machines.[1]
Two design decisions made it work, and both echo today:
- One type only. BCPL is typeless — everything is a machine word, interpreted only by the operator applied (
+treats it as integer,!treats it as pointer). No type checking whatsoever. This made it portable across any word size — and, fatally, awkward on byte-addressed machines, which is exactly the problem B inherited and C fixed. - O-code. The compiler was two-part: a front end that emitted machine-independent O-code, and a back end that turned O-code into machine code — only 1/5 of the compiler needed rewriting per architecture. It's the recognizably direct ancestor of the portable-IL trick Pascal, Java, and every VM since reuses.[2]
The debt C owes
BCPL gave the C-lineage more than its structure: it introduced curly braces to delimit code blocks — the {} that every C descendant still uses started here. Its global vector — a pre-arranged shared array for bindings between compilation units — was an early form of the module/linking problem every OS still solves. And when Multics needed a systems language before PL/I existed, early work happened in BCPL's orbit; when Ken Thompson needed one small enough for the PDP-7, he made B.[3]
Where it sits
BCPL is the language that made the C-lineage portable — the moment the chain stopped being Cambridge theory and became buildable. Between CPL (the idea) and B (the squeeze), BCPL is the part that actually shipped — and through TRIPOS it ended up inside AmigaDOS, and through Coral 66 (written in it) inside British military systems.
Check your understanding
- What does BCPL stand for — and who designed it where?
- What type system did BCPL use — and what problem did that cause?
- What was O-code, and why did it matter?
- What syntax did BCPL bequeath to every C descendant?
Show answers
1 — Basic Combined Programming Language — Martin Richards, Cambridge, 1967. 2 — typeless: everything is a machine word — until machines went byte-addressed, which B inherited and C fixed. 3 — a portable intermediate code — only ~1/5 of the compiler needed rewriting per machine (2–5 person-months). 4 — curly braces {} for code blocks — plus the B→C lineage and the global-vector linking idea.
Footnotes
- ↑ BCPL and Richards's BCPL pages — the 1967 Cambridge origin, the bootstrap-compiler intent, and the 2–5 person-month port
- ↑ BCPL design — the typeless word model, the O-code two-part compiler, and the byte-addressing problem
- ↑ BCPL — the curly-brace introduction, the global vector, and the B→C lineage