CPL (programming language)

Last updated

CPL
Paradigm Multi-paradigm: procedural, imperative, structured, functional
Designed by Christopher Strachey et al.
First appeared1963;61 years ago (1963)
Influenced by
ALGOL 60
Influenced
BCPL

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.

Contents

Design

CPL [1] 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" [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 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. [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 about 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 a systems programming language, particularly for writing compilers; [6] 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: [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.

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. [7] [8]

Peter Norvig has written (for Yapps, a Python compiler-compiler) a simple CPL to Python translator for modern machines. [5] [9]

See also

Related Research Articles

<span class="mw-page-title-main">ALGOL</span> Family of programming languages

ALGOL is a family of imperative computer programming languages originally developed in 1958. ALGOL heavily influenced many other languages and was the standard method for algorithm description used by the Association for Computing Machinery (ACM) in textbooks and academic sources for more than thirty years.

BCPL is a procedural, imperative, and structured programming language. Originally intended for writing compilers for other languages, BCPL is no longer in common use. However, its influence is still felt because a stripped down and syntactically changed version of BCPL, called B, was the language on which the C programming language was based. BCPL introduced several features of many modern programming languages, including using curly braces to delimit code blocks. BCPL was first implemented by Martin Richards of the University of Cambridge in 1967.

In computing, a compiler is a computer program that translates computer code written in one programming language into another language. The name "compiler" is primarily used for programs that translate source code from a high-level programming language to a low-level programming language to create an executable program.

CLU is a programming language created at the Massachusetts Institute of Technology (MIT) by Barbara Liskov and her students starting in 1973. While it did not find extensive use, it introduced many features that are used widely now, and is seen as a step in the development of object-oriented programming (OOP).

In computer science, syntactic sugar is syntax within a programming language that is designed to make things easier to read or to express. It makes the language "sweeter" for human use: things can be expressed more clearly, more concisely, or in an alternative style that some may prefer. Syntactic sugar is usually a shorthand for a common operation that could also be expressed in an alternate, more verbose, form: The programmer has a choice of whether to use the shorter form or the longer form, but will usually use the shorter form since it is shorter and easier to type and read.

<span class="mw-page-title-main">Peter Landin</span> British computer scientist (1930–2009)

Peter John Landin was a British computer scientist. He was one of the first to realise that the lambda calculus could be used to model a programming language, an insight that is essential to the development of both functional programming and denotational semantics.

In a given programming language design, a first-class citizen is an entity which supports all the operations generally available to other entities. These operations typically include being passed as an argument, returned from a function, and assigned to a variable.

ALGOL 60 is a member of the ALGOL family of computer programming languages. It followed on from ALGOL 58 which had introduced code blocks and the begin and end pairs for delimiting them, representing a key advance in the rise of structured programming. ALGOL 60 was one of the first languages implementing function definitions. ALGOL 60 function definitions could be nested within one another, with lexical scope. It gave rise to many other languages, including CPL, PL/I, Simula, BCPL, B, Pascal, and C. Practically every computer of the era had a systems programming language based on ALGOL 60 concepts.

<span class="mw-page-title-main">History of programming languages</span> History of languages used to program computers

The history of programming languages spans from documentation of early mechanical computers to modern tools for software development. Early programming languages were highly specialized, relying on mathematical notation and similarly obscure syntax. Throughout the 20th century, research in compiler theory led to the creation of high-level programming languages, which use a more accessible syntax to communicate instructions.

<span class="mw-page-title-main">Christopher Strachey</span> British computer scientist (1916–1975)

Christopher S. Strachey was a British computer scientist. He was one of the founders of denotational semantics, and a pioneer in programming language design and computer time-sharing. He has also been credited as possibly being the first developer of a video game and for coining terms such as polymorphism and referential transparency that are still widely used by developers today. He was a member of the Strachey family, prominent in government, arts, administration, and academia.

In computer science, a programming language is said to have first-class functions if it treats functions as first-class citizens. This means the language supports passing functions as arguments to other functions, returning them as the values from other functions, and assigning them to variables or storing them in data structures. Some programming language theorists require support for anonymous functions as well. In languages with first-class functions, the names of functions do not have any special status; they are treated like ordinary variables with a function type. The term was coined by Christopher Strachey in the context of "functions as first-class citizens" in the mid-1960s.

In computer science, a relational operator is a programming language construct or operator that tests or defines some kind of relation between two entities. These include numerical equality and inequalities.

Autocode is the name of a family of "simplified coding systems", later called programming languages, devised in the 1950s and 1960s for a series of digital computers at the Universities of Manchester, Cambridge and London. Autocode was a generic term; the autocodes for different machines were not necessarily closely related as are, for example, the different versions of the single language Fortran.

Martin Richards is a British computer scientist known for his development of the BCPL programming language which is both part of early research into portable software, and the ancestor of the B programming language invented by Ken Thompson in early versions of Unix and which Dennis Ritchie in turn used as the basis of his widely used C programming language.

ALGOL 68C is an imperative computer programming language, a dialect of ALGOL 68, that was developed by Stephen R. Bourne and Michael Guy to program the Cambridge Algebra System (CAMAL). The initial compiler was written in the Princeton Syntax Compiler that was implemented by J. H. Mathewman at Cambridge.

Programming languages are used for controlling the behavior of a machine. Like natural languages, programming languages follow rules for syntax and semantics.

S-algol is a computer programming language derivative of ALGOL 60 developed at the University of St Andrews in 1979 by Ron Morrison and Tony Davie. The language is a modification of ALGOL to contain orthogonal data types that Morrison created for his PhD thesis. Morrison would go on to become professor at the university and head of the department of computer science. The S-algol language was used for teaching at the university at an undergraduate level until 1999. It was also the language taught for several years in the 1980s at a local school in St. Andrews, Madras College. The computer science text Recursive Descent Compiling describes a recursive descent compiler for S-algol, implemented in S-algol.

David William Barron FBCS was a British academic in Physics and Computer Science who was described in the Times Higher Education magazine as one of the "founding fathers" of computer science.

<span class="mw-page-title-main">David Hartley (computer scientist)</span> British computer scientist

David Fielding Hartley FBCS is a computer scientist and Fellow of Clare College, Cambridge. He was Director of the University of Cambridge Computing Service from 1970–1994, Chief Executive of United Kingdom Joint Academic Network (JANET) 1994–1997, and Executive Director of Cambridge Crystallographic Data Centre (CCDC) 1997–2002. He is now much involved with the National Museum of Computing.

References

  1. Barron, D. W.; Buxton, J. N.; Hartley, D. F.; Nixon, E.; Strachey, C. (1 August 1963). "The Main Features of CPL". The Computer Journal. 6 (2): 134–143. doi: 10.1093/comjnl/6.2.134 . ISSN   0010-4620.
  2. "Clive Feather on CPL and BCPL". Lysator.liu.se. Retrieved 18 August 2013.
  3. Jensen, Richard (9 December 2020). ""A damn stupid thing to do"—the origins of C". Ars Technica. Retrieved 10 December 2020.
  4. Yadav, P. (2005). Computer and Languages. Discovery Publishing House. ISBN   978-81-8356-041-2.
  5. 1 2 3 Norvig, Peter (23 August 2011). "Prescient but Not Perfect: A Look Back at a 1966 Scientific American Article on Systems Analysis". Scientific American Blog Network. Retrieved 10 December 2020.
  6. Mitchell, John C.; Apt, Krzysztof (2003). Concepts in Programming Languages. Cambridge University Press. ISBN   978-0-521-78098-8.
  7. Coulouris, G. F. (1 January 1968). "The London CPL1 compiler". The Computer Journal. 11: 26–30. doi: 10.1093/comjnl/11.1.26 .
  8. Coulouris, George (2013). "Computer Resurrection Issue 62 / The Compiler Compiler - Reflections of a User 50 Years On / The CPL1 Compiler". Computer Conservation Society. Retrieved 3 May 2023.
  9. Norvig, Peter. "Complete Annotated Checkers Program". norvig.com. Retrieved 11 June 2021.

Bibliography