B (programming language)

The programming language B has been developed by Ken Thompson and Dennis Ritchie in 1969. B is strongly influenced by BCPL and is the predecessor of the C programming language

B is especially interesting from a linguistic historical reasons, as it documents the development of BCPL to C in more detail. It was developed for the translation on a DEC PDP -7 with 8 kb RAM. It was later ported to the PDP -11 machines and Honeywell mainframes, where it was used for example for the known AberMUD by Alan Cox until the 1990s.

Due to the limited hardware resources on the target machine PDP -7 B - BCPL missing some features that would make the translation more complicated. For example, no nested function definitions are possible. Also because of the limited resources of the generated B- compiler on the PDP 7 is a simple intermediate code, which must be interpreted by an interpreter at run time.

In B, there was, as in BCPL or Forth only one type of data, whose meaning was only through the use of operators and functions. B is therefore Typeless. There have been many language features, which can be found in C. Some programs are translatable even without problems even with today's C compilers.

Code Example

Main () {    auto c;    auto d;    d = 0;    while (1 ) {      c = getchar ();      d = d c;      putchar (c);    } } This program can also be changed with today's C compilers translate ( in K & R or traditional mode). However, it is not ANSI C.

157369
de