MarketB (programming language)
Company Profile

B (programming language)

B is a programming language developed at Bell Labs circa 1969 by Ken Thompson and Dennis Ritchie.

History
Ken Thompson began developing B as a Fortran compiler for the PDP-7, but found that his initial implementation far exceeded available memory. Through several iterations of simplifying the compiler and adapting the language to his own tastes that were influenced by BCPL, he arrived at a language that expressed a subset of BCPL semantics in a distinct syntax. Thompson named the language B, which has been variously explained as an abbreviation of BCPL or Bon, another language he had developed, although he confirmed neither explanation. Thompson added "two-address assignment operators" using x =+ y syntax to add y to x (in C the operator is written +=). This syntax came from Douglas McIlroy's implementation of TMG, in which B's compiler was first implemented (and it came to TMG from ALGOL 68's x +:= y syntax). Thompson went further by inventing the increment and decrement operators (++ and --). Their prefix or postfix position determines whether the value is taken before or after alteration of the operand. This innovation was not in the earliest versions of B. According to Dennis Ritchie, people often assumed that they were created for the auto-increment and auto-decrement address modes of the DEC PDP-11, but this is historically impossible as the machine didn't exist when B was first developed. 36-bit mainframes running the operating system GCOS. The earliest PDP-7 implementations compiled to threaded code, and Ritchie wrote a compiler using TMG which produced machine code. In 1970 a PDP-11 was acquired and threaded code was used for the port; an assembler, , and the B language itself were written in B to bootstrap the computer. An early version of yacc was produced with this PDP-11 configuration. Ritchie took over maintenance during this period. and on certain embedded systems () for a variety of reasons: limited hardware in small systems, extensive libraries, tooling, licensing cost issues, and simply being good enough for the job. The highly influential AberMUD was originally written in B. == Examples ==
Examples
The following examples are from the ''Users' Reference to B'' by Ken Thompson: /* The following function will print a non-negative number, n, to the base b, where 2 /* The following program will calculate the constant e-2 to about 4000 decimal digits, and print it 50 characters to the line in groups of 5 characters. The method is simple output conver- sion of the expansion 1/2! + 1/3! + ... = .111... where the bases of the digits are 2, 3, 4, ... */ main() { extrn putchar, n, v; auto i, c, col, a; i = col = 0; while(i == References ==
tickerdossier.comtickerdossier.substack.com