The B Programming Language 

 

History

B is a descendant of the programming language of BCPL. B was first designed and implemented by D. W. Ritchie and K. L. Thompson of Bell Telephone Laboratories, Inc., Murray Hill, N.J.  S.C. Johnson did the original implementation of the run-time package, also of Bell Labs.

The development of B began in 1970 when K. L. Thompson decided that they could not pretend to offer real computing service without FORTRAN, so he sat down to write a FORTRAN in TMG. Thompson's intent to handle FORTRAN lasted about a week. What he produced instead was a new language B. An influence of B was the small space in which a compiler had to fit.

B is good for recursive, non-numeric, and machine independent applications, such as system and language work. B, compared to BCPL, is syntactically rich in expressions and syntactically poor in statements.

B was soon implemented on the PDP-11.; A few years experience with B showed that it was not satisfactory, and C was developed. During the transition from B to C there was also a short-lived language NB (new B).

There are several differences between this version of B and the Bell Laboratories versions. The switch statement has been extended. Floating-point operators and proper logical operators have also been added. Finally, the order in which operators are evaluated has been changed.

Type checking was not a part of the language B. There was only one type, the machine word. B is a "typeless" language. This means that you can perform any operation you like on the 36-bit word used as the basic unit of computation. Besides the usual arithmetic operations, B lets you perform lower level shifting as well as bitwise and complement operations. Floating point operators are available also, but the code generated for them is not particularly efficient.