B
In 1969, in the corridors of Bell Labs, Ken Thompson and Dennis Ritchie were working on UNIX, that operating system promising to revolutionize computing. But how could they program efficiently on these resource-limited minicomputers without getting lost in the maze of assembly language?
Thompson was well-acquainted with BCPL, the language developed by Martin Richards at Cambridge. Powerful, certainly, but too heavy for the PDP-7 and PDP-11 machines available to the researchers. The idea then emerged to create a simplified, streamlined version that would preserve BCPL’s spirit while adapting to hardware constraints. Thus B was born, a name chosen by simple alphabetical contraction that would prove prescient with the later arrival of the C language.
B’s philosophy lay in its radical simplicity. Gone were the complex types and syntactic subtleties that weighed down development. In B, everything is a machine word. Variables are automatically sized according to the architecture, typically 36 bits. This approach, which might seem limiting, actually concealed formidable efficiency for systems programming. Every byte counted when resources were measured in kilobytes.
The syntax inherited from BCPL but Thompson stripped it of its embellishments. Classic control structures remained: if, while, for. Arithmetic and logical operators kept their familiar notation. One innovation left a lasting mark on the computing landscape: the use of braces to delimit code blocks. This seemingly trivial convention would span decades to appear in countless modern languages.
B supported pointers and arrays, concepts essential for manipulating memory at the lowest level. This capability proved essential for UNIX, where every processor cycle had to be optimized. Thompson and Ritchie developed a remarkably compact compiler, fitting in just a few thousand lines. Later, they added an interpreter to facilitate interactive development. This compilation-interpretation duality offered the best of both worlds: performance for production, flexibility for testing.
Entire portions of the operating system, initially coded in assembly, were rewritten in B, making UNIX its privileged testing ground. The experience revealed B’s strengths and weaknesses. On one hand, development accelerated considerably and facilitated code maintenance. On the other, certain limitations emerged, notably in string manipulation where the absence of distinction between characters and integers complicated operations.
Portability guided design choices. In a computing world fragmented among incompatible architectures, B promised to free developers from these hardware constraints. Theoretically, an application written in B could migrate from one machine to another through simple recompilation. Though reality would prove more nuanced, this forward-thinking vision would influence future languages.
The evolution of architectures toward 8 and 16 bit words made B’s model less optimal. UNIX’s growing needs progressively exceeded its capabilities. Dennis Ritchie, drawing on the experience gained, undertook to design a successor. In 1972, C was born, preserving B’s spirit while resolving its main limitations through a more sophisticated type system.
This evolution perfectly illustrates the iterative nature of computing progress. B lived only a few years, but its influence exceeded this brief existence. Every programmer who writes a for loop in Java or JavaScript uses syntax inherited from B. The braces that structure code, the familiar operators, the procedural approach—so many elements that B bequeathed to posterity.
At Bell Labs and elsewhere, B served as training for an entire generation of programmers. Its relative simplicity made it an excellent pedagogical vehicle for understanding systems programming. Many who would later contribute to the rise of UNIX and the Internet cut their teeth on this language. Brian Kernighan wrote a tutorial that established enduring standards of pedagogical quality, demonstrating that a technical language could be taught with clarity and method.
B’s philosophy—favoring simplicity over complexity, efficiency over exhaustiveness—transcends eras. This minimalist approach, where each element must justify its presence through practical utility, still characterizes languages like Go, developed by Bell Labs veterans. An entire development culture is transmitted.
This story reminds us that computing innovation rarely proceeds through abrupt ruptures. It advances through accumulation, each generation building on the achievements of the previous one while seeking to surpass its limits. B drew inspiration from BCPL, spawned C, which would give birth to countless descendants, with each link in the chain counting.