What Earlier Language Influenced C?
The C programming language owes much of its syntax, design philosophy, and low-level system orientation to the B programming language, developed in 1969 by computer scientist Ken Thompson at Bell Labs. Created primarily to facilitate system programming and implement early iterations of the Unix operating system on constrained hardware, B served as the direct conceptual and architectural bridge between the British research language BCPL and Dennis Ritchie's eventual creation of C.
The Origins of B at Bell Labs
During the late 1960s, researchers at AT&T Bell Laboratories were involved in the ambitious Multics (Multiplexed Information and Computing Service) project. When Bell Labs withdrew from Multics in 1969, Ken Thompson and Dennis Ritchie sought to create a more practical, streamlined operating environment on a discarded Digital Equipment Corporation (DEC) PDP-7 minicomputer.
To develop system software efficiently, Thompson needed a high-level programming language suited for an operating system environment. Writing entirely in PDP-7 assembly language was tedious and non-portable. Thompson turned to BCPL (Basic Combined Programming Language), designed by Martin Richards at Cambridge University in 1967.
Because the PDP-7 possessed severe memory limitations—having only 8,192 18-bit words of core memory—Thompson heavily stripped down BCPL. He eliminated components he considered redundant, adapted the syntax to match his personal preferences, and squeezed the entire compiler and runtime into the machine's cramped memory. He called this new, condensed language B.
Key Features and Syntax of B
B retained several foundational concepts from BCPL while introducing conventions that remain staples of modern programming syntax:
- Typeless Architecture: Like BCPL, B was completely typeless. It operated exclusively on a single fundamental data type: the machine word. The meaning of a variable’s contents was determined entirely by the operators applied to it rather than any declaration. If a word was treated as an integer, arithmetic operators were used; if treated as a pointer, indirect addressing was applied.
- Compact Punctuation: Thompson replaced several of
BCPL’s wordy syntactic structures with compact punctuation. He adopted
curly braces (
{and}) to delineate statement blocks instead of BCPL's\(( ...\)), introduced the modern//comment style, and solidified the use of semicolons as statement terminators. - Compound Assignment and Increment Operators: B
pioneered the
++and--operators. Thompson introduced prefix and postfix operators to generate concise assembly instructions directly on hardware architectures that supported automatic incrementation.
Why B Transitioned into C
While B was successful for initial utilities and early versions of Unix, hardware advancements soon exposed its structural limitations.
In 1970, Bell Labs acquired a PDP-11 computer. Unlike the word-oriented architectures B had targeted, the PDP-11 natively supported byte-addressable memory and hardware floating-point operations. B's typeless model struggled in this environment. Representing a pointer in B required storing a machine word; addressing individual 8-bit character bytes required awkward shifting and masking operations, creating unacceptable performance overhead.
Dennis Ritchie began extending B to address these deficiencies:
- NB (New B): Ritchie first introduced an
intermediate evolution called "New B," which added rudimentary types
such as
intandchar. - Type System and Structs: As the compiler evolved,
Ritchie redesigned the runtime and introduced a full static type system,
multidimensional arrays, and structured types
(
struct). - Rebuilding the Unix Kernel: By 1972–1973, this evolution was complete and christened C. Ritchie and Thompson subsequently rewrote the Unix operating system kernel in C, proving that an operating system could be written in a portable, high-level language without sacrificing execution speed.
Through this lineage, Ken Thompson's B language provided the essential structural vocabulary, operators, and design minimalism that made C the foundation of modern computing infrastructure.