Question

Does anyone know of a working BCPL compiler, written for a current OS (I have Windows 7 and Ubuntu readily available) with an x64 architecture? I first heard about BCPL after Dennis Ritchie's recent death, and I'm strangely fascinated by what little I've read about this language.

I've only played around with modern, high-level languages before, but I think it would be neat to dive into this bit of computing history. However, I know next to nothing about compilers, so I'm not about to write one myself. Any suggestions?

Was it helpful?

Solution

The BCPL Wikipedia article includes an URL for Martin Richards's BCPL distribution, which includes an interpreter that runs on both Linux and Windows, among others.

From the README:

It provides a machine independent interpretive version of BCPL. The interpreter in implemented in C, but for some architectures it also has a version implemented in assembly language giving improved performance.

This distribution contains versions of the system for Linux, DEC Alpha machines, Mips R2000/3000 and Mac Power PCs, Sun4s, Sun/SPARCs and 386/486/Pentium machines under MSDOS, Windows 95/98/NT/2000/XP, Windows CE2.0 (for the HP 620LX), Mac OS X or OS/2. Some implementations have not been tested recently and are rather out of date. The simplest installation is for Linux machines. Installation on other machines is described later. This distribution does include the executable: cintsys.exe that should run under most Windows systems on Pentium mased machines.

Professor Richards is also working on a 64 bit version of BCPL, though it doesn't look as well time-tested as his BCPL distribution.

OTHER TIPS

BCPL compiles to an intermediate language called OCODE, and then various second passes code generate from OCODE to some form of executable code. Martin Richards originally generated INTCODE and his book on the BCPL compiler shows how to write an interpreter for INTCODE. I have written INTCODE interpreters on a number of machines including one in FORTRAN in 1970s and one in Java more recently. The downloads on his web site are for a considerably enhanced and extended BCPL (especially the libraries) and now compile to CINTCODE, and there are numerous interpreters mostly written in C for many architectures.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top