Square Brackets and S-Expressions: How IBM Keypunch Limits Shaped Lisp

A glowing translucent sphere holding a detailed brass recursive lattice on a dark charcoal surface, illuminated by golden light against a deep blue background.

The IBM 026 keypunch machine used by students at the Massachusetts Institute of Technology in the late 1950s lacked square bracket keys on its standard keyboard layout. In the fall of 1958, computer scientist John McCarthy assigned MIT students to implement his initial design for a new artificial intelligence programming language. McCarthy had intended for programmers to write code using M-expressions, a high-level algebraic notation relying on square brackets. But because punching those missing characters required awkward workarounds on their keypunch hardware, the student implementation team abandoned M-expressions entirely and wrote their programs directly in parenthesized S-expressions.

From Dartmouth Logic to Algebraic Lists

According to Two Bit History, McCarthy began conceptualizing a list processing language during the 1956 Dartmouth Summer Research Project on Artificial Intelligence. At that conference, researchers Allen Newell and Herbert Simon presented their Information Processing Language, or IPL, which they designed to manipulate lists of symbolic expressions for generating logic proofs. While McCarthy recognized that symbolic lists were ideal for modeling automated deduction, he disliked IPL's macro-assembly style. Newell and Simon had focused on low-level machine instructions rather than mathematical notation. McCarthy sought an algebraic alternative that could combine symbolic list processing with the higher-level readability of Fortran.

Chess Programs and Symbolic Differentiation

McCarthy’s vision evolved through practical computing experiments between 1956 and 1958. In 1957, while writing routines for a chess-playing program in Fortran, he grew frustrated by Fortran's limited control structures and invented true conditional expressions. Unlike Fortran's branching statements, McCarthy's conditional returned a specific sub-expression based on a test while evaluating only the branch that succeeded. During the summer of 1958, while designing a system capable of symbolic differentiation, McCarthy realized his conditional expressions streamlined recursive operations. To handle differentiation across arbitrary sums of terms, he introduced the maplist function, which applied a specified function across every element in a list. Equipped with these ideas, McCarthy tasked his MIT students in the fall of 1958 with writing Lisp's first practical implementation.

Keypunch Constraints and the S-Expression

McCarthy had planned for S-expressions—symbolic expressions enclosed by parentheses—to serve merely as an internal representation meant for the machine. Human-facing source code was supposed to rely on M-expressions wrapped in square brackets. However, the hardware constraint of the IBM 026 keypunch machine permanently altered that syntax design. Lacking square bracket keys, the team chose to represent both data lists and function applications using parenthesized S-expressions directly. What was originally conceived as a temporary low-level syntactic compromise became Lisp's defining feature: prefix notation, uniform parenthesized tree structures, and an identical representation for code and data.

Formalizing Computation in 1960

In 1960, McCarthy published his paper, "Recursive Functions of Symbolic Expressions and Their Computation by Machine." As he and his students streamlined the language during implementation, McCarthy realized Lisp had evolved from a practical software utility into a concise mathematical system. By specifying Lisp using a small set of primitive rules and recursive functions, McCarthy presented an axiomatic formalism for studying computation that proved neater than Turing machines or conventional recursive function theory.

McCarthy's minimal syntax and axiomatic foundations allowed Lisp to become the second-oldest high-level language still in active use today, trailing only Fortran. The trade-offs forced by 1950s keypunch hardware ultimately produced a unified, minimal structure that established Lisp as a foundational symbol in programming language design.

AI-generated editorial illustration; not a documentary photograph.

Source: 0b10

0b10

How Lisp Became God's Own Programming Language

Share this article
FacebookThreadsLinkedInX

Leave a Reply

Your email address will not be published. Required fields are marked *