BCPL

The Basic Combined Programming Language ( BCPL ) is a 1966 developed by Martin Richards and in the spring of 1967 at the Massachusetts Institute of Technology implemented for the first time, compiled, low-level programming language, derived from the Combined / Cambridge Programming Language CPL. It is a language of the ALGOL family.

General Description

Benefits of BCPL are ease of learning, ease of implementation and ease of portability. It is mainly intended for compiler construction, for system programming and as a "pioneer language ", ie as a first language for a new system.

A BCPL program consists of individual functions that can be defined recursively; the function is called with value parameters.

BCPL knows the data type only the word. All variables are references to a memory cell. Depending on the operator, the variable can be regarded as an integral value memory reference vector or point of entry of a function. There are only local identifier and a global vector, in which visible throughout the program identifier (ie the function name ) are summarized.

The contents of a variable is the R-Value ( may only appear on the right side of an assignment ) referred to the location as lvalue ( may appear only on the left side of an assignment. )

The lv and rv operators to interpret an L value as R- value allow, and vice versa ( ie to dereference a variable ).

BCPL itself is practically only functions for bit and word manipulation available. All other functions are summarized in additional libraries.

Ken Thompson developed in 1969, the language B, which is strongly influenced by BCPL. Since B has been developed for the interpretation on a PDP 7 8 kB RAM B is simpler than BCPL. For example, no nested function definitions are possible. From the development of the B C language was

There are BCPL implementations for virtually every operating system, the various implementations are non-source code compatible.

The BCPL philosophy is illustrated by the following quote from the book available in English only BCPL -the language and its compiler:

"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. "

" The BCPL philosophy is not that of the tyrant who knows better and adopt rules about what is allowed and what is forbidden. Instead, BCPL behaves more like the servant who offers his services as possible without a murmur, even though it apparent nonsense is applied. It is always assumed that the programmer knows what he's doing. It is therefore not constrained by petty restrictions. "

O code

Richards developed in the late 1960s, an intermediate code that should make BCPL machine independent. The BCPL compiler generates code O, the O for object, that object code is.

The O code can then be interpreted by another program either, or translated into specific machine code. This idea was and is also used in newer compilers, eg in the form of RTL ( Register Transfer Language ) intermediate code at the GCC or the P code of UCSD Pascal. Java with the Java Virtual Machine also uses its own intermediate code, however, lies somewhere between O code and machine code.

O code allows the separation of general and processor-specific translation requirements. The porting of the BCPL compiler was extremely relieved by its use, and BCPL was quickly available on various machines.

Program Example

GET " LIBHDR "   LET START ( ) BE $ ( WRITES ("Hello, world! * N ") $ ) operating Systems

Parts of AmigaOS ( the AmigaDOS component) based on TRIPOS, a multiuser operating system from the company MetaComCo, which was developed in the programming language BCPL, and thus contribute still traces of BCPL. To end example BCPL pointer in AmigaDOS data structures inevitably on 32- bit boundaries, as they are shifted by 2 bits to the right, which corresponds to a division by 4. Furthermore, in AmigaDOS strings are often used, which use a prefix length byte instead of the usual C programming zero termination.

Was also developed in BCPL operating system of the AEG ( system software department Konstanz) for its own machines AEG AEG 80-40 and 80-60 (number below 100 to 1980) was MARTOS ( Multi Access Real Time Operating System). Also for these used only in a few projects, then actually very modern machinery, was implemented in the BCPL, related with C and PL / I programming language SL3 (System Low Level Language), in which you assign the system level as in assembler individual variables fixed register, on the other hand could also be programmed with complex and nested structures.

Pictures of BCPL

107294
de