How 1950s Vacuum-Tube Hardware Shaped Modern Lisp
Programmers using the Lisp language manipulate lists using two basic functions: car to get the first item, and cdr to get the rest. These cryptic names have survived for over 60 years, despite having nothing to do with modern computer science. They refer to the physical architecture of the IBM 704 vacuum-tube computer, where they stood for "Contents of the Address part of Register" and "Contents of the Decrement part of Register."
The Anatomy of a 1950s Machine Word
In the late 1950s, the IBM 704 was among the most advanced scientific computing platforms available. Powered by thousands of vacuum tubes and utilizing magnetic core memory, the machine processed data in 36-bit words. The internal layout of these 36-bit words reflected the specific hardware demands of the era. The machine instructions partitioned words into specialized subfields designed to manage memory addressing, index registers, and conditional branching efficiently.
Specifically, an IBM 704 instruction word contained several distinct sections: a 3-bit prefix, a 15-bit decrement field, a 2-bit tag field, and a 15-bit address field. The 15-bit address field was designed to point directly to a memory location in the computer's magnetic core storage, which topped out at 32,768 words. The 15-bit decrement field was often used to hold counts for indexing or loop counters. Because both the address and decrement fields were 15 bits wide, each was large enough to store an independent memory address.
Mapping Lists Directly to Hardware
When John McCarthy and his team began designing and implementing Lisp for the IBM 704, they needed a physical way to represent dynamic linked lists and binary trees. They settled on a fundamental building block called a 'cons cell'—an ordered pair of pointers. Because each 15-bit address pointer fit neatly into half of a 36-bit word, a single machine word on the IBM 704 could hold an entire cons cell without wasting space.
The programmers assigned the head of the list—the first element—to the address field of the word, and the tail of the list—the pointer to the remainder—to the decrement field. To retrieve these two parts, the initial implementation used assembly routines that referenced the machine's hardware registers directly. Extracting the first element meant reading the 'Contents of the Address part of Register' (abbreviated as CAR), while retrieving the remainder meant reading the 'Contents of the Decrement part of Register' (abbreviated as CDR, traditionally pronounced 'could-er' or 'cudder').