CPL (programming language)
{{Short description|Computer programming language from 1960s}}
{{Use dmy dates|date=April 2022}}
{{Infobox programming language
| name = CPL
| logo =
| paradigm = Multi-paradigm:
procedural, imperative, structured, functional
| year = {{start date and age|1963}}
| designer = Christopher Strachey et al.
| developer =
| latest_release_version =
| latest_release_date =
| typing =
| implementations =
| dialects =
| influenced_by = ALGOL 60
| influenced = BCPL
| website =
}}
CPL (Combined Programming Language) is a multi-paradigm programming language developed in the early 1960s. It is an early ancestor of the C language via the BCPL and B languages.
Design
CPL{{Cite journal|last1=Barron|first1=D. W.|last2=Buxton|first2=J. N.|last3=Hartley|first3=D. F.|last4=Nixon|first4=E.|last5=Strachey|first5=C.|date=1963-08-01|title=The Main Features of CPL|journal=The Computer Journal|language=en|volume=6|issue=2|pages=134–143|doi=10.1093/comjnl/6.2.134|issn=0010-4620|doi-access=free}} was developed initially at the Mathematical Laboratory at the University of Cambridge as the "Cambridge Programming Language" and later published jointly between Cambridge and the University of London Computer Unit as the "Combined Programming Language" (CPL was also nicknamed by some as "Cambridge Plus London"{{cite web |title=Clive Feather on CPL and BCPL |url=http://www.lysator.liu.se/c/clive-on-history.html |accessdate=2013-08-18 |publisher=Lysator.liu.se}} or "Christopher's Programming Language"{{cite news |last1=Jensen |first1=Richard |date=December 9, 2020 |title="A damn stupid thing to do"—the origins of C |language=en-us |work=Ars Technica |url=https://arstechnica.com/features/2020/12/a-damn-stupid-thing-to-do-the-origins-of-c/ |access-date=December 10, 2020}}). 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 the Titan Computer at Cambridge and the Atlas Computer at London.
It was heavily influenced by ALGOL 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. CPL attempted to go beyond ALGOL to include industrial process control, business data processing and possibly some early command line games.{{Cite book|last=Yadav|first=P.|url=https://books.google.com/books?id=-aBnYOHMNjUC&q=CPL+attempted+to+go+beyond+ALGOL&pg=PA180|title=Computer and Languages|date=2005|publisher=Discovery Publishing House|isbn=978-81-8356-041-2|language=en}} 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 about 1970,{{cite news |last1=Norvig |first1=Peter |author1-link=Peter Norvig |title=Prescient but Not Perfect: A Look Back at a 1966 Scientific American Article on Systems Analysis |url=https://blogs.scientificamerican.com/at-scientific-american/systems-analysis-look-back-1966-scientific-american-article/ |access-date=December 10, 2020 |work=Scientific American Blog Network |date=August 23, 2011 |language=en}} 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 a systems programming language, particularly for writing compilers;{{Cite book|last1=Mitchell|first1=John C.|url=https://books.google.com/books?id=7Uh8XGfJbEIC&q=bcpl+programming+language&pg=PA100|title=Concepts in Programming Languages|last2=Apt|first2=Krzysztof
|author-link2=Krzysztof R. Apt
|date=2003|publisher=Cambridge University Press|isbn=978-0-521-78098-8|language=en}} it was first implemented in 1967, prior to CPL's first implementation. BCPL then led, via B, to the popular and influential C programming language.
Example
The function MAX as formulated by Peter Norvig:
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 ({{code| ̸§}}) is an approximation of the original symbol, in which the cross stroke is vertical. This is available in Unicode as {{code|§⃒}} but does not display correctly on many systems.
Implementations
It is thought that CPL was never fully implemented in the 1960s, existing as a theoretical construct with some research work on partial implementations.{{cite journal |last1=Coulouris |first1=G. F. |author-link=George Coulouris (computer scientist) |date=1 January 1968 |title=The London CPL1 compiler |journal=The Computer Journal |language=en |volume=11 |pages=26–30 |doi=10.1093/comjnl/11.1.26 |doi-access=free}}{{Cite web |last=Coulouris |first=George |author-link=George Coulouris (computer scientist) |date=2013 |title=Computer Resurrection Issue 62 / The Compiler Compiler - Reflections of a User 50 Years On / The CPL1 Compiler |url=http://www.cs.man.ac.uk/CCS/res/res62.htm#d |access-date=2023-05-03 |website=Computer Conservation Society}}
Peter Norvig has written (for Yapps, a Python compiler-compiler) a simple CPL to Python translator for modern machines.{{cite web |last1=Norvig |first1=Peter |title=Complete Annotated Checkers Program |url=http://norvig.com/sciam/checkers-complete.html |website=norvig.com |access-date=11 June 2021}}
See also
References
{{Reflist}}
Bibliography
- How BCPL evolved from CPL, Martin Richards, 2011 [https://www.cl.cam.ac.uk/~mr10/cpl2bcpl.pdf]
- Collected papers of Christopher Strachey, section pertaining to CPL, archived at the Bodleian Library, Oxford; [http://www.nationalarchives.gov.uk/a2a/records.aspx?cat=161-csac71180&cid=3-5-1#3-5-1 CSAC 71.1.80/C.136-C.184]
- D. W. Barron, J. N. Buxton, D. F. Hartley, E. Nixon, and C. Strachey. "The main features of CPL" The Computer Journal 6:2:134-143 (1963), available [http://www.math.bas.bg/~bantchev/place/cpl/features.pdf online].
- J. Buxton, J. C. Gray, and D. Park. [http://www.ancientgeek.org.uk/CPL/CPL_Elementary_Programming_Manual.pdf CPL Elementary Programming Manual, Edition II (Cambridge)] (1966).
- University of London Institute of Computer Science and The Mathematical Laboratory, Cambridge. [http://www.ancientgeek.org.uk/CPL/CPL_Working_Papers.pdf CPL Working Papers] (1966).
Category:History of computing in the United Kingdom
Category:Procedural programming languages
Category:Programming languages created in 1963