The before-C languageΒΆ
Once upon a time there was a language called BCPL. Hereβs the introduction from Wikipedia:
BCPL (βBasic Combined Programming Languageβ) 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.
Iβve written quite a bit of BCPL code (in the 70βs, on PDP-11 and CDC-64001). Itβs an interesting language, due to the simplicity of the language, but also because the compiler for it was itself written in BCPL, small, and β¦ understandable.
One of the defining features of BCPL is that itβs typeless: everything is a βwordβ (which can be 16, 32, or 64 bits wide these days). The distinction of whether to treat a word as an integer or a pointer is made in the context of its use. That gives it some of the same feel as FORTH, albeit with a more high-level notation and structure, and more (by now) βtraditionalβ semantics.
Also from that era comes an operating system called TRIPOS, which illustrates the main concepts of a pre-emptive and portable O/S, as TRIPOS was (mostly) implemented in BCPL.
BCPL and TRIPOS are still available online from Martin Richardsβ home
page, in the form of a (very
portable) cintsys
interpreter which uses cintcode
as compact bytecode
format. There are (somewhat ageing) code backends to generate machine code for
various architectures. And TRIPOS lives on as cintpos
with a similar
interpreter / virtual machine. All the software is freely available for personal
and educational use (this predates todayβs licensing shenanigans).
Hereβs an example program, using BCPLβs fairly common indentation style:
GET "libhdr"
LET start() = VALOF { writef("Hello, %s!*n", "World")
RESULTIS 0
}
Iβve dabbled in BCPL a few times over the years β¦ itβs tempting to look into it again.
-
The Control Data 6400 had roughly the power of an Intel 386+387. β©