Doug McIlroy and Unix Pipes
Zusammenfassung
Doug McIlroy never designed an operating system or a programming language. He designed the pipe — the connecting mechanism that made Unix tools composable — and articulated the Unix philosophy that gave those tools their character. He ran the Computing Science Research Center at Bell Labs for most of the Unix era, which meant that Thompson, Ritchie, Kernighan, and the other architects of the Unix world worked under his informal intellectual influence. He also wrote the first spell checker, co-invented the diff algorithm’s foundations, and coined the concept of “software ICs” — reusable software components — in 1968, two decades before object-oriented programming frameworks made component reuse mainstream.
Mathematics, Bell Labs, and the Computing Culture
Malcolm Douglas McIlroy was born on January 10, 1932, in New York. He studied physics at Cornell (BS 1954) and applied mathematics at MIT (PhD 1959), then joined Bell Labs in 1958, where he would spend the next thirty-nine years.
McIlroy joined the Computing Science Research Center — the same department that would produce Unix — and rose to become its head. His management style was unusual: he ran the department with minimal formal structure, gave researchers enormous autonomy, and focused his own energy on the problems he found interesting rather than on administrative duties. His colleagues consistently described him as the intellectual conscience of the group — the person who asked the sharpest questions, identified the weakest arguments, and pushed for cleaner solutions.
He was not a builder of large systems. He built small, precise tools that became foundations. The pipe was the most consequential.
The Pipe: Composability as Architecture
In 1964 — five years before Unix existed — McIlroy wrote an internal Bell Labs memo proposing that programs should be connectable: the output of one program should be usable as the input of the next, without either program needing to know about the other. The programs would communicate through a common data format (text) and a common interface (standard input and standard output). Complex operations would be assembled from simple components.
This was not a description of a specific mechanism. It was a design principle: composability as architecture. The value of a system came not from the individual programs but from the combinations they enabled.
When Ken Thompson built Unix in 1969, he did not initially implement pipes. The early Unix had files and redirection but no direct program-to-program communication channel. McIlroy continued pressing for it. Thompson implemented pipes in 1972 — the | operator that fed one program’s standard output directly to another’s standard input:
# The pipe in practice
cat /var/log/syslog | grep "error" | sort | uniq -c | sort -rn | head -10
# Each program does one thing well
# | connects them without either knowing about the other
# Text is the universal interfaceThe implementation was a kernel-level mechanism: when a pipe was created, the kernel connected the file descriptors so that writes to one end appeared as reads from the other. The programs on each side were unchanged; they simply read from stdin and wrote to stdout as they always had.
McIlroy articulated what this implied as design philosophy: programs should do one thing and do it well; programs should work together; programs should use text streams as their primary interface because text is universal.
The Unix Philosophy
McIlroy’s formulation, from the Bell System Technical Journal (1978): “Write programs that do one thing and do it well. Write programs that work together. Write programs that handle text streams, because that is a universal interface.”
This was not just good advice — it was a description of what had naturally emerged from the pipe. Once you had a universal connection mechanism and a universal data format (text), the natural design for any tool was to do one thing, do it well, and hand its output to the next tool. The philosophy emerged from the mechanism, not the other way around.
Software ICs: The Component Idea
In 1968, McIlroy presented a paper at the NATO Software Engineering Conference in Garmisch, Germany — the conference that coined the term “software engineering” and diagnosed the “software crisis.” His paper proposed “Mass Produced Software Components” — the idea that software should be built from standardized, interchangeable components the way hardware was built from integrated circuits.
The concept was prescient. The software components market McIlroy envisioned in 1968 — reusable modules with defined interfaces, available in catalogs, assembled into applications — was not realized until the object-oriented era of the 1990s, and even then imperfectly. UNIX pipes were McIlroy’s partial implementation of the idea: small programs with standard interfaces that could be combined arbitrarily.
His paper is cited as one of the founding documents of software engineering and one of the earliest articulations of what would become component-based software development, service-oriented architecture, and microservices.
Spell, Diff, and the Practical Tools
McIlroy wrote the first practical Unix spell checker (spell, 1975) — a program that checked a text file against a dictionary and reported words not found in it. The technical problem was that English had too many inflected forms for a simple dictionary lookup: “running,” “ran,” “runs” all derived from “run.” McIlroy’s spell implemented a series of affix stripping rules to reduce words to stems before looking them up, dramatically reducing the dictionary size needed while maintaining coverage.
The spell program was sufficiently accurate to be genuinely useful — not a curiosity but a production tool. It was standard on Unix systems for twenty years.
McIlroy co-created diff — the program that shows the differences between two files — through his work on longest common subsequence algorithms. The Hunt–McIlroy algorithm, described in the 1976 paper “An Algorithm for Differential File Comparison” co-written with James W. Hunt (who built the initial prototype on McIlroy’s framework), was the basis for patch (Larry Wall’s tool for applying diff output) and eventually for every version control system.
Retirement and Dartmouth
McIlroy retired from Bell Labs in 1997, when it was reorganized as Lucent Technologies. He joined Dartmouth College as an adjunct professor, continuing to teach and write. He has remained intellectually active — reviewing papers, writing occasional technical pieces, and providing the same sharp criticism that characterized his Bell Labs career.
He was named a National Academy of Engineering member in 2000. He continues to be cited in discussions of software design philosophy as the most articulate formulator of the Unix approach.
Dead End: Software ICs and the Reuse Problem
McIlroy’s 1968 prediction of a mass-market in reusable software components was partially fulfilled and partially betrayed.
Why Software Components Are Hard
Unix pipes provided composability for text-processing tools. Object-oriented frameworks (COM, CORBA, JavaBeans, .NET components) attempted composability for application-level software. The results were mixed. The challenge is that software components, unlike hardware ICs, have rich interfaces — they depend on specific data types, calling conventions, error handling models, and semantic contracts. Two components designed independently rarely compose cleanly without adaptation. The Unix pipe model worked because it used the simplest possible interface (byte streams of text) that was universal enough to connect anything. Richer interfaces are more capable and harder to compose.
The microservices architecture of the 2010s — where applications are decomposed into small services communicating over HTTP — is the closest modern analogue to McIlroy’s 1968 vision. The interface (HTTP, JSON) is simple enough to be universal; the components (services) are small enough to do one thing well. The wheel turned back.
McIlroy’s contributions in their Unix context are covered in The Unix Story. The pipe’s role in the design of the Unix system is explored in Ken Thompson and Unix.
📚 Sources
- McIlroy, M. D.; Pinson, E. N. & Tague, B. A.: “Unix Time-Sharing System: Foreword” — Bell System Technical Journal, Vol. 57, No. 6 (1978)
- McIlroy, M. D.: “Mass Produced Software Components” — Proceedings of the NATO Software Engineering Conference, Garmisch, Germany (1968)
- Kernighan, Brian W. & Pike, Rob: The Unix Programming Environment (1984), Prentice-Hall — Chapter on the Unix philosophy and tools
- Salus, Peter H.: A Quarter Century of UNIX (1994), Addison-Wesley
- McIlroy, M. D.: “A Research Unix Reader: Annotated Excerpts from the Programmer’s Manual, 1971–1986” — Bell Labs CSTR 139 (1987)
- Hunt, J. W. & McIlroy, M. D.: “An Algorithm for Differential File Comparison” — Bell Labs CSTR 41 (1976)