| CPL | |
|---|---|
| Paradigm | Multi-paradigm:procedural,imperative,structured,functional |
| Designed by | Christopher Strachey et al. |
| First appeared | 1963; 62 years ago (1963) |
| Influenced by | |
| ALGOL 60 | |
| Influenced | |
| BCPL | |
CPL (Combined Programming Language) is amulti-paradigm programming language developed in the early 1960s. It is an early ancestor of theC language via theBCPL andB languages.
CPL[1] was developed initially at the Mathematical Laboratory at theUniversity of Cambridge as the "Cambridge Programming Language" and later published jointly between Cambridge and theUniversity of London Computer Unit as the "Combined Programming Language" (CPL was also nicknamed by some as "Cambridge Plus London"[2] or "Christopher's Programming Language"[3]).Christopher Strachey,David Barron and others were involved in its development. The first paper describing it was published in 1963, while it was being implemented on theTitan Computer at Cambridge and theAtlas Computer at London.
It was heavily influenced byALGOL 60, but instead of being extremely small, elegant and simple, CPL was intended for a wider application area than scientific calculations and was therefore much more complex and not as elegant as ALGOL 60. CPL was a big language for its time, and it attempted to go beyond ALGOL to include industrial process control, business data processing, and possibly some early command line games.[4] CPL was intended to allow low-level programming and high level abstractions using the same language.
However, CPL was only implemented very slowly. The first CPL compiler was probably written around 1970,[5] but the language never gained much popularity and seems to have disappeared without trace sometime in the 1970s.
BCPL (for "Basic CPL", although originally "Bootstrap CPL") was a much simpler language based on CPL, intended primarily as asystems programming language, particularly for writingcompilers;[6] it was first implemented in 1967, prior to CPL's first implementation. BCPL then led, viaB, to the popular and influentialC programming language.
The function MAX as formulated by Peter Norvig:[5]
Max(Items, ValueFunction) = value of§ (Best, BestVal) = (NIL, -∞)while Items do §(Item, Val) = (Head(Items), ValueFunction(Head(Items)))if Val > BestVal then (Best, BestVal) := (Item, Val)Items := Rest(Items) ̸§result is Best ̸§
The closing section block symbol used here (̸§) is an approximation of the original symbol, in which the cross stroke is vertical. This is available in Unicode as§⃒ but does not display correctly on many systems.
It is thought that CPL was never fully implemented in the 1960s, existing as a theoretical construct with some research work on partial implementations.[7][8]
Peter Norvig has written (for Yapps, a Pythoncompiler-compiler) a simple CPL toPython translator for modern machines.[5][9]