Design
BCPL was designed so that small and simple compilers could be written for it; reputedly some compilers could be run in 16+
added two values together, treating them as !
indirected through a value, effectively treating it as a pointer.) In order for this to work, the implementation provided no %
).
BCPL handles bindings spanning separate $(
and $)
or and ">/code> and
/code> in place of the symbols
. The single-line //
comments of BCPL, which were not adopted by C, reappeared in C++ and later in C99.
The book ''BCPL: The language and its compiler'' describes the philosophy of BCPL as follows:
History
BCPL was first implemented by Martin Richards Martin Richards may refer to:
* Martin Richards (computer scientist)
Martin Richards (born 21 July 1940) is a British computer scientist known for his development of the BCPL programming language which is both part of early research into porta ...
of the University of Cambridge
The University of Cambridge is a Public university, public collegiate university, collegiate research university in Cambridge, England. Founded in 1209, the University of Cambridge is the List of oldest universities in continuous operation, wo ...
in 1967. BCPL was a response to difficulties with its predecessor, Cambridge Programming Language, later renamed Combined Programming Language
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 was developed initially at the Mathematical Laborato ...
(CPL), which was designed during the early 1960s. Richards created BCPL by "removing those features of the full language which make compilation difficult". The first compiler implementation, for the IBM 7094
The IBM 7090 is a second-generation transistorized version of the earlier IBM 709 vacuum tube mainframe computer that was designed for "large-scale scientific and technological applications". The 7090 is the fourth member of the IBM 700/7000 se ...
under Compatible Time-Sharing System
The Compatible Time-Sharing System (CTSS) was the first general purpose time-sharing operating system. Compatible Time Sharing referred to time sharing which was compatible with batch processing; it could offer both time sharing and batch proce ...
, was written while Richards was visiting Project MAC
Computer Science and Artificial Intelligence Laboratory (CSAIL) is a research institute at the Massachusetts Institute of Technology
The Massachusetts Institute of Technology (MIT) is a Private university, private research university in ...
at the Massachusetts Institute of Technology
The Massachusetts Institute of Technology (MIT) is a Private university, private research university in Cambridge, Massachusetts, United States. Established in 1861, MIT has played a significant role in the development of many areas of moder ...
in the spring of 1967. The language was first described in a paper presented to the 1969 Spring Joint Computer Conference The Joint Computer Conferences were a series of computer conferences in the United States held under various names between 1951 and 1987. The conferences were the venue for presentations and papers representing "cumulative work in the omputerfield ...
.
BCPL has been rumored to have originally stood for "Bootstrap Cambridge Programming Language", but CPL was never created since development stopped at BCPL, and the acronym was later reinterpreted for the BCPL book.
BCPL is the language in which the original "Hello, World!" program
A "Hello, World!" program is usually a simple computer program that emits (or displays) to the screen (often the Console application, console) a message similar to "Hello, World!". A small piece of code in most general-purpose programming languag ...
was written. The first MUD
Mud (, or Middle Dutch) is loam, silt or clay mixed with water. Mud is usually formed after rainfall or near water sources. Ancient mud deposits hardened over geological time to form sedimentary rock such as shale or mudstone (generally cal ...
was also written in BCPL (''MUD1
''Multi-User Dungeon'', or ''MUD'' (referred to as ''MUD1'', to distinguish it from its successor, ''MUD2'', and the Multi-user dungeon, MUD genre in general), is the first Multi-user dungeon, MUD.
History
MUD was created in 1978 by Roy Trub ...
'').
Several operating system
An operating system (OS) is system software that manages computer hardware and software resources, and provides common daemon (computing), services for computer programs.
Time-sharing operating systems scheduler (computing), schedule tasks for ...
s were written partially or wholly in BCPL (for example, TRIPOS
TRIPOS (''TRIvial Portable Operating System'') is a computer operating system. Development started in 1976 at the Computer Laboratory of Cambridge University and it was headed by Dr. Martin Richards. The first version appeared in January 1978 a ...
and the earliest versions of AmigaDOS
AmigaDOS is the disk operating system of the AmigaOS, which includes file systems, file and directory manipulation, the command-line interface, and file Redirection (computing), redirection.
In AmigaOS 1.x, AmigaDOS is based on a TRIPOS port by ...
). BCPL was also the initial language used in the Xerox PARC
Future Concepts division (formerly Palo Alto Research Center, PARC and Xerox PARC) is a research and development company in Palo Alto, California. It was founded in 1969 by Jacob E. "Jack" Goldman, chief scientist of Xerox Corporation, as a div ...
Alto
The musical term alto, meaning "high" in Italian (Latin: '' altus''), historically refers to the contrapuntal part higher than the tenor and its associated vocal range. In four-part voice leading alto is the second-highest part, sung in ch ...
project. Among other projects, the Bravo
Bravo(s) or The Bravo(s) may refer to:
Arts and entertainment Music Groups and labels
* Bravo (band), a Russian rock band
* Bravo (Spanish group), represented Spain at Eurovision 1984
* Bravo Music, an American concert band music publishing compa ...
document preparation system was written in BCPL.
An early compiler, bootstrapped in 1969, by starting with a paper tape of the O-code of Richards's Atlas 2 compiler, targeted the ICT 1900 series
ICT 1900 was a family of mainframe computers released by International Computers and Tabulators (ICT) and later International Computers Limited (ICL) during the 1960s and 1970s. The 1900 series was notable for being one of the few non-America ...
. The two machines had different word-lengths (48 vs 24 bits), different character encodings, and different packed string representations—and the successful bootstrapping increased confidence in the practicality of the method.
By late 1970, implementations existed for the Honeywell 635 and Honeywell 645, IBM 360, PDP-10
Digital Equipment Corporation (DEC)'s PDP-10, later marketed as the DECsystem-10, is a mainframe computer family manufactured beginning in 1966 and discontinued in 1983. 1970s models and beyond were marketed under the DECsystem-10 name, especi ...
, TX-2, CDC 6400, UNIVAC 1108
The UNIVAC 1100/2200 series is a series of compatible 36-bit computer systems, beginning with the UNIVAC 1107 in 1962, initially made by Sperry Rand. The series continues to be supported today by Unisys Corporation as the ClearPath Dorado Series ...
, PDP-9
The PDP-9, the fourth of the five 18-bit minicomputers produced by Digital Equipment Corporation, was introduced in 1966. A total of 445 PDP-9 systems were produced, of which 40 were the compact, low-cost PDP-9/L units..
History
The 18-bit PDP ...
, KDF 9 and Atlas 2. In 1974 a dialect of BCPL was implemented at BBN without using the intermediate O-code. The initial implementation was a cross-compiler
A cross compiler is a compiler capable of creating executable code for a platform other than the one on which the compiler is running. For example, a compiler that runs on a PC but generates code that runs on Android devices is a cross compil ...
hosted on BBN's TENEX PDP-10
Digital Equipment Corporation (DEC)'s PDP-10, later marketed as the DECsystem-10, is a mainframe computer family manufactured beginning in 1966 and discontinued in 1983. 1970s models and beyond were marketed under the DECsystem-10 name, especi ...
s, and directly targeted the PDP-11
The PDP–11 is a series of 16-bit minicomputers originally sold by Digital Equipment Corporation (DEC) from 1970 into the late 1990s, one of a set of products in the Programmed Data Processor (PDP) series. In total, around 600,000 PDP-11s of a ...
s used in BBN's implementation of the second generation IMPs
IMP or imp may refer to:
* Imp, a fantasy creature
Arts and entertainment
Music
* IMP (band) a Japanese boy band
Fictional characters
* Imp (She-Ra), a character in ''She-Ra: Princess of Power''
* Imp a character in ''Artemis Fowl: The Lost ...
used in the ARPANET
The Advanced Research Projects Agency Network (ARPANET) was the first wide-area packet-switched network with distributed control and one of the first computer networks to implement the TCP/IP protocol suite. Both technologies became the tec ...
.
There was also a version produced for the BBC Micro
The BBC Microcomputer System, or BBC Micro, is a family of microcomputers developed and manufactured by Acorn Computers in the early 1980s as part of the BBC's Computer Literacy Project. Launched in December 1981, it was showcased across severa ...
in the mid-1980s, by Richards Computer Products, a company started by John Richards, the brother of Martin Richards. The BBC Domesday Project made use of the language. Versions of BCPL for the Amstrad CPC
The Amstrad CPC (short for "Colour Personal Computer") is a series of 8-bit home computers produced by Amstrad between 1984 and 1990. It was designed to compete in the mid-1980s home computer market dominated by the Commodore 64 and the ZX Spec ...
and Amstrad PCW
The Amstrad PCW series is a range of personal computers produced by United Kingdom, British company Amstrad from 1985 to 1998, and also sold under licence in Europe as the "Joyce" by the German electronics company Schneider Computer Division, Schn ...
computers were also released in 1986 by UK software house Arnor Ltd. MacBCPL was released for the Apple Macintosh in 1985 by Topexpress Ltd, of Kensington, England.
Both the design and philosophy of BCPL strongly influenced B, which in turn influenced C. Programmers at the time debated whether an eventual successor to C would be called "D", the next letter in the alphabet, or "P", the next letter in the parent language name. The language most accepted as being C's successor is C++ (with ++
being C's increment operator
Increment or incremental may refer to:
*Incrementalism, a theory (also used in politics as a synonym for gradualism)
*Increment and decrement operators, the operators ++ and -- in computer programming
*Incremental computing
*Incremental backup, wh ...
), although meanwhile, a D programming language also exists.
In 1979, implementations of BCPL existed for at least 25 architectures; the language gradually fell out of favour as C became popular on non-Unix systems.
Martin Richards maintains a modern version of BCPL on his website, last updated in 2023. This can be set up to run on various systems including Linux, FreeBSD, and Mac OS X. The latest distribution includes graphics and sound libraries, and there is a comprehensive manual. He continues to program in it, including for his research on musical automated score following.
A common informal MIME type
In information and communications technology, a media type, content type or MIME type is a two-part identifier for file formats and content formats. Their purpose is comparable to filename extensions and uniform type identifiers, in that they ide ...
for BCPL is .
Examples
Hello world
Richards and Whitby-Strevens provide an example of the "Hello, World!" program
A "Hello, World!" program is usually a simple computer program that emits (or displays) to the screen (often the Console application, console) a message similar to "Hello, World!". A small piece of code in most general-purpose programming languag ...
for BCPL using a standard system header, 'LIBHDR':
GET "LIBHDR"
LET START() BE WRITES("Hello, World")
Further examples
If these programs are run using Richards' current version of Cintsys (December 2018), LIBHDR, START and WRITEF must be changed to lower case to avoid errors.
Print factorials:
GET "LIBHDR"
LET START() = VALOF $(
FOR I = 1 TO 5 DO
WRITEF("%N! = %I4*N", I, FACT(I))
RESULTIS 0
$)
AND FACT(N) = N = 0 -> 1, N * FACT(N - 1)
Count solutions to the N queens problem:
GET "LIBHDR"
GLOBAL $(
COUNT: 200
ALL: 201
$)
LET TRY(LD, ROW, RD) BE
TEST ROW = ALL THEN
COUNT := COUNT + 1
ELSE $(
LET POSS = ALL & ~(LD , ROW , RD)
UNTIL POSS = 0 DO $(
LET P = POSS & -POSS
POSS := POSS - P
TRY(LD + P << 1, ROW + P, RD + P >> 1)
$)
$)
LET START() = VALOF $(
ALL := 1
FOR I = 1 TO 12 DO $(
COUNT := 0
TRY(0, 0, 0)
WRITEF("%I2-QUEENS PROBLEM HAS %I5 SOLUTIONS*N", I, COUNT)
ALL := 2 * ALL + 1
$)
RESULTIS 0
$)
References
Further reading
* Martin Richards,
The BCPL Reference Manual
' (Memorandum M-352, Project MAC
Computer Science and Artificial Intelligence Laboratory (CSAIL) is a research institute at the Massachusetts Institute of Technology
The Massachusetts Institute of Technology (MIT) is a Private university, private research university in ...
, Cambridge, MA, USA, July, 1967)
* Martin Richards, ''BCPL - a tool for compiler writing and systems programming'' (Proceedings of the Spring Joint Computer Conference, Vol 34, pp 557–566, 1969)
* Martin Richards, Arthur Evans, Robert F. Mabee,
The BCPL Reference Manual
' (MAC TR-141, Project MAC
Computer Science and Artificial Intelligence Laboratory (CSAIL) is a research institute at the Massachusetts Institute of Technology
The Massachusetts Institute of Technology (MIT) is a Private university, private research university in ...
, Cambridge, MA, USA, 1974)
* Martin Richards, Colin Whitby-Strevens, ''BCPL, the language and its compiler'' (Cambridge University Press, 1980)
External links
Martin Richards' BCPL distribution
by Dennis M. Ritchie
BCPL entry
in the Jargon File
The Jargon File is a glossary and usage dictionary of slang used by computer programmers. The original Jargon File was a collection of terms from technical cultures such as the MIT Computer Science and Artificial Intelligence Laboratory, MIT AI Lab ...
* Nordier & Associates' x86
x86 (also known as 80x86 or the 8086 family) is a family of complex instruction set computer (CISC) instruction set architectures initially developed by Intel, based on the 8086 microprocessor and its 8-bit-external-bus variant, the 8088. Th ...
br>port
ArnorBCPL manual
(1986, Amstrad PCW
The Amstrad PCW series is a range of personal computers produced by United Kingdom, British company Amstrad from 1985 to 1998, and also sold under licence in Europe as the "Joyce" by the German electronics company Schneider Computer Division, Schn ...
/ CPC)
* How BCPL evolved from CPL, Martin Richard
Ritchie's ''The Development of the C Language''
has commentary about BCPL's influence on C
The BCPL Cintsys and Cintpos User Guide
BCPL Reference Manual, 1975 Xerox Palo Alto Research Center
{{DEFAULTSORT:Bcpl
History of computing in the United Kingdom
Procedural programming languages
Programming languages created in 1967
Structured programming languages
Systems programming languages
University of Cambridge Computer Laboratory