B (programming language)


B (programming language)

infobox programming language
name = B

caption =
file_ext =
paradigm =
year = 1969
designer = Ken Thompson
developer = Ken Thompson, Dennis Ritchie
latest_release_version =
latest_release_date =
latest_test_version =
latest_test_date =
turing-complete =
typing =
implementations =
dialects =
influenced_by = BCPL
influenced = C
operating_system =
license =
website =

B is a programming language that was developed at Bell Labs. It is almost extinct, as it was replaced by the C language.It was mostly the work of Ken Thompson with contributions from Dennis Ritchie, and first appeared in 1969 or near that time.

History

B was essentially the BCPL system stripped of any component that Thompson felt he could do without, in order to make it fit within the memory capacity of the minicomputers of the time. The language also included some changes made to suit Thompson's preferences (mostly along the lines of reducing the number of non-whitespace characters in a typical program).

Like BCPL and FORTH, B had only one datatype: the computer word. Most operators (e.g., +, -, *, /) treated this as an integer, but others treated it as a memory address to be dereferenced. In most other ways it looked a lot like an early version of C. A few library functions existed, including some that vaguely resemble functions from the standard I/O library in C.

Early implementations were for the DEC PDP-7 and PDP-11 minicomputers using early Unix, and Honeywell 36-bit mainframes running the operating system GCOS. The earliest PDP-7 implementations compiled to threaded code, then Ritchie wrote a compiler using TMG which produced machine code. [http://www.multicians.org/tmg.html] [http://cm.bell-labs.com/cm/cs/who/dmr/chist.html] In 1970 a PDP-11 was acquired and threaded code was used for the port. The first version of yacc was produced with this PDP-11 configuration. Ritchie took over maintenance during this period.

The typeless nature of B made sense on the Honeywell, PDP-7 and many older computers, but was a problem on the PDP-11 because it was difficult to elegantly access the character data type that the PDP-11 and most modern computers fully support. Starting in 1971 Ritchie made changes to the language while converting its compiler to produce machine code, most notably adding data typing for variables. During 1971 and 1972 B evolved into "New B" and then C, with the preprocessor being added in 1972 and early 1973 at the urging of Alan Snyder. The effort was sufficiently complete that during the summer of 1973 the Unix kernel for the PDP-11 was rewritten in C. During the 1972-73 period there was a need to port to Honeywell 635 and IBM 360/370 machines, so Mike Lesk wrote the "portable I/O package" which would become the C "standard I/O" routines.

B continued to see use as late as the 1990s on Honeywell mainframes, and on certain embedded systems for a variety of reasons, including limited hardware in the small systems; extensive libraries, tools, licensing cost issues; and simply being good enough for the job on others. The highly influential AberMUD was originally written in B.

B was greatly influenced by BCPL, and its name is most likely to be a contraction of BCPL. However it is possible that its name may be based on Bon, an earlier but unrelated, and rather different, programming language which Thompson designed for use on Multics. Fact|date=March 2007

Example

The following example is 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<=b<=10, This routine uses the fact that in the ASCII character set, the digits 0 to 9 have sequential code values. */

printn(n,b) { extrn putchar; auto a;

if(a=n/b) /* assignment, not test for equality */ printn(a, b); /* recursive */ putchar(n%b + '0');}

External links

* " [http://cm.bell-labs.com/cm/cs/who/dmr/chist.html The Development of the C Language] ", Dennis M. Ritchie. Puts B in the context of BCPL and C.
* " [http://cm.bell-labs.com/cm/cs/who/dmr/kbman.html Users' Reference to B] ", Ken Thompson. Describes the PDP-11 version.
* " [http://cm.bell-labs.com/cm/cs/who/dmr/bintro.html The Programming Language B] ", S. C. Johnson & B. W. Kernighan, Technical Report CS TR 8, Bell Labs (January 1973). The GCOS version on Honeywell equipment.

Notes

ee also

* The B-Method, a formal method with its own Abstract Machine Notation (AMN), not to be confused with the B programming language.

Another language, also called B, was a simple interactive programming language by Lambert Meertens and Steven Pemberton. This B was the predecessor of ABC.


Wikimedia Foundation. 2010.

Look at other dictionaries:

  • Programming language — lists Alphabetical Categorical Chronological Generational A programming language is an artificial language designed to communicate instructions to a machine, particularly a computer. Programming languages can be used to create programs that… …   Wikipedia

  • Programming language theory — (commonly known as PLT) is a branch of computer science that deals with the design, implementation, analysis, characterization, and classification of programming languages and programming language features. It is a multi disciplinary field, both… …   Wikipedia

  • Programming Language Design and Implementation — (PLDI) is one of the ACM SIGPLAN s most important conferences. The precursor of PLDI was the Symposium on Compiler Optimization, held July 27–28, 1970 at the University of Illinois at Urbana Champaign and chaired by Robert S. Northcote. That… …   Wikipedia

  • Programming Language for Business — or PL/B is a business oriented programming language originally called DATABUS and designed by Datapoint in the early 1970s as an alternative to COBOL because its 8 bit computers could not fit COBOL into their limited memory, and because COBOL did …   Wikipedia

  • programming language — ➔ language * * * programming language UK US noun [C] ► COMPUTER LANGUAGE(Cf. ↑computer language) …   Financial and business terms

  • programming language — Language Lan guage, n. [OE. langage, F. langage, fr. L. lingua the tongue, hence speech, language; akin to E. tongue. See {Tongue}, cf. {Lingual}.] [1913 Webster] 1. Any means of conveying or communicating ideas; specifically, human speech; the… …   The Collaborative International Dictionary of English

  • Programming Language One — Programming Language One, oft als PL/I (auch PL/1, PL1 oder PLI) abgekürzt ist eine Programmiersprache, die in den 1960er Jahren von IBM entwickelt wurde. Die Bezeichnung PL/1 ist vor allem in Deutschland gebräuchlich. Ursprünglich wurde PL/I… …   Deutsch Wikipedia

  • Programming Language 1 — noun A computer programming language which combines the best qualities of commercial and scientific oriented languages (abbrev PL/1) • • • Main Entry: ↑programme …   Useful english dictionary

  • Programming Language —   [engl.], Programmiersprache …   Universal-Lexikon

  • Programming language specification — A programming language specification is an artifact that defines a programming language so that users and implementors can agree on what programs in that language mean.A programming language specification can take several forms, including the… …   Wikipedia

  • programming language — noun (computer science) a language designed for programming computers • Syn: ↑programing language • Topics: ↑computer science, ↑computing • Hypernyms: ↑artificial language …   Useful english dictionary


Share the article and excerpts

Direct link
Do a right-click on the link above
and select “Copy Link”

We are using cookies for the best presentation of our site. Continuing to use this site, you agree with this.