BCPL

BCPL, by Martin Richards and Colin Whitby-Strevens is an excellent book by (isbn 0-521-21965-5). As usual I'm going to quote from a few pages:
The most important feature of the idealized object machine is its store, which consists of a set of numbered storage cells arranged so that the numbers labelling adjacent cells differ by one. All storage cells are the same size (a constant of the implementation, which is usually between 16 and 36 bits).
The readability of a program largely depends on the skill and style of the programmer; however his task is simplified if he is using a language with a rich set of expressive but concise constructions.
The philosophy of BCPL is not one of the tyrant who thinks he knows best and lays down the law on what is and what is not allowed; rather BCPL acts more as a servant offering his services to the best of his ability without complaint, even when confronted with apparent nonsense. The programmer is always assumed to know what he is doing and is not hemmed in by petty restrictions.
A procedure is invoked by writing its name, followed by the list of arguments in brackets. There is no call statement as in Fortran or PL/I.
The section brackets $( and $) enclose the statements of a procedure, and are, in many respects, like begin and end in Algol.
As a matter of style, they [spaces] should be used frequently to enhance readability.
Comments are introduced by the character pair //.
The BCPL input/output system is based on the idea of a stream. A BCPL stream should be regarded as a sequence of characters.
One of the most useful features of BCPL is that one form of command is a set of statements enclosed in a $( $) pair. As a general rule in BCPL, anywhere you can write a simple command, you can use a compound command or a block. The set of statements enclosed in $( $) is called a compound command unless the statements starts with declarations, in which case the whole thing is called a block.
BCPL has been carefully designed so that function and routine calls bring little overhead.
You know know enough to write quite substantial programs, and it would be a good idea if you paused long enough to do so.

No comments:

Post a Comment