Key Moments
Brian Kernighan: UNIX, C, AWK, AMPL, and Go Programming | Lex Fridman Podcast #109
Key Moments
Brian Kernighan on UNIX, C, AWK, AMPL, Go, and the evolution of computing.
Key Insights
UNIX emerged from the failure of MULTICS, born out of a desire for a more accessible and efficient computing environment.
The C programming language, co-authored by Kernighan, found a sweet spot between expressiveness and efficiency, becoming foundational for UNIX and beyond.
AWK, a text-processing language co-created by Kernighan, remains remarkably useful for quick data exploration due to its simple, natural programming paradigm.
Bell Labs was a unique, collaborative environment that fostered innovation, with UNIX and C emerging from this fertile ground.
Programming is a blend of art and science, requiring creativity to define problems and rigor to solve them efficiently within given constraints.
Modern programming heavily relies on libraries, a shift from the earlier days of building everything from scratch, with implications for complexity and security.
THE BIRTH OF UNIX AND THE RISE OF TIME-SHARING
The conversation begins with the genesis of UNIX, tracing its roots back to the MULTICS project and the earlier era of time-sharing systems. Kernighan explains that time-sharing, which gave users the illusion of having dedicated access to a computer via terminals, was a significant improvement over the cumbersome punch-card methods. MULTICS, intended as a more ambitious information utility, ultimately proved too complex and costly. Bell Labs' withdrawal from MULTICS led to the creation of UNIX by Ken Thompson and Dennis Ritchie, aiming to provide a more manageable yet powerful computing environment.
THE ENDURING LEGACY OF THE C PROGRAMMING LANGUAGE
Kernighan, co-author of 'The C Programming Language,' discusses C's pivotal role. He highlights that C found an optimal balance between being expressive enough for natural programming and efficient enough for the hardware capabilities of its era. This efficiency was crucial given the limited resources of early computers. C's tight integration with the UNIX operating system, which was itself largely written in C, made both highly portable and adaptable, contributing to their widespread adoption and lasting impact.
AWK: A TIMELESS TOOL FOR DATA EXPLORATION
Kernighan describes AWK, a text-processing scripting language he co-created, as a tool designed for quick, 'dirty' tasks like counting, selecting, and rearranging data from text files. Its elegance lies in its simple, natural programming model, where scripts operate line by line on input files based on patterns and actions. This paradigm, combined with automatic field splitting and built-in variables, allows for concise, powerful data manipulation, making AWK still incredibly useful for data exploration over 40 years after its creation.
BELL LABS: A UNIQUE ENVIRONMENT FOR INNOVATION
Kernighan paints a picture of Bell Labs during its golden age as a unique, highly collaborative environment. It attracted top scientific and mathematical talent, fostering an open and free atmosphere where researchers could easily interact and share ideas. This environment was crucial for the development of innovations like UNIX and C, as programmers could quickly prototype, experiment, and receive immediate feedback from colleagues, creating a virtuous cycle of development and refinement.
THE ART AND SCIENCE OF PROGRAMMING
Discussing his own process and the nature of programming, Kernighan views it as a blend of art and science. The 'art' involves understanding the problem, envisioning a good program, and considering user needs. The 'science' and 'engineering' aspects involve choosing appropriate algorithms, data structures, and managing constraints like time, resources, and future maintenance. He admits to preferring an incremental, tinkerer's approach over rigid, upfront planning for his own coding.
THE EVOLUTION OF PROGRAMMING LANGUAGES AND TOOLS
Kernighan provides a historical overview of programming languages, from early assembly languages to higher-level languages like FORTRAN and COBOL, and then to system programming languages like C. He touches upon the rise of object-oriented programming and the explosion of modern languages. He notes the significant shift towards using extensive libraries in languages like Python and JavaScript, a contrast to the earlier era of building much more from scratch, which introduces both power and new complexities regarding dependencies and security.
AMPL: MODELING OPTIMIZATION PROBLEMS
Kernighan discusses AMPL, an Algebraic Modeling Language for optimization problems. He clarifies that while he contributed, the core work was done by his partners, Bob Fourer and Dave Gay. AMPL's strength lies in separating the abstract mathematical model from the data and the solver, allowing clear expression of complex optimization problems that can then be fed to specialized solvers. This separation makes models human-readable and adaptable to different datasets and solvers.
THE CHALLENGES AND PROMISE OF ARTIFICIAL INTELLIGENCE
Reflecting on his early research in AI, Kernighan contrasts the initial optimism of the 1960s with the long roads to achieving breakthroughs like advanced game playing and natural language processing. He expresses interest in current machine learning and neural networks but also notes significant concerns about bias in training data and the potential for amplifying societal inequalities. He remains uncertain about the path to human-level AI, emphasizing the complexity and the need for careful consideration.
COMPUTING'S IMPACT ON SOCIETY AND THE FUTURE
Kernighan acknowledges the profound and often mixed impact of computing on society. While it enables unprecedented global communication and potential for progress, it also introduces challenges like privacy concerns, misinformation, and increased societal divisions ('us vs. them'). He suggests that while technologies often prove beneficial in the long run, their short-term effects can be problematic, requiring careful management and critical engagement with their use and implications.
THE FUTURE OF MOORE'S LAW AND PROGRAMMING ABSTRACTION
Regarding Moore's Law, Kernighan believes that exponential growth cannot continue indefinitely but notes that innovation may shift, such as increasing the number of processors rather than their speed. He predicts that future programming will involve more automation, with programs writing programs and a greater reliance on declarative approaches. He anticipates increased levels of abstraction, potentially leading to systems that can infer user intent and execute tasks with less detailed procedural instruction.
Mentioned in This Episode
●Products
●Software & Apps
●Companies
●Organizations
●Books
●Concepts
●People Referenced
Common Questions
UNIX was born out of the discontent with the Multics project at Bell Labs in 1969. A group of engineers, including Ken Thompson, who had a taste for comfortable computing environments but lacked one, started designing a new operating system. Ken Thompson famously wrote the initial version of UNIX in assembly language on a little-used PDP-7 machine in just three weeks.
Topics
Mentioned in this video
A celebrity mentioned as using Raycon earbuds.
A celebrity mentioned as using Raycon earbuds.
Mentioned in the context of starting the open source movement in the late 1980s.
Worked on the COBOL programming language.
The lead co-author of Brian Kernighan's book on the Go programming language, referred to as the Go expert.
Cooperating Communicating Sequential Processes that Tony Hoare set forth
A renowned physicist mentioned hypothetically listening to podcasts with Raycon earbuds.
Creator of Linux, who built a UNIX-like operating system in 1991, capitalizing on the availability of UNIX expertise.
Co-creator of the Awk scripting language alongside Brian Kernighan and Peter Weinberger.
A text editor written by Rob Pike at Bell Labs, preferred by Brian Kernighan when available, and can be downloaded from Plan 9 distributions.
A professor of industrial engineering and management science at Northwestern, and one of Brian Kernighan's partners in developing AMPL.
A numerical analyst and optimization expert at Bell Labs, and another partner in the development of AMPL.
An American poet, referred to for his poem about choosing two paths.
A Turing Award winner and a colleague Brian Kernighan briefly worked with as a grad student, from whom he realized theoretical computer science was not his calling.
The creator of the C programming language and co-author of 'The C Programming Language' book with Brian Kernighan, also a key contributor to UNIX.
Created an early language using zeros and ones in backwards order, and discussed his paper on machine intelligence.
A celebrity mentioned as using Raycon earbuds.
Led the team at MIT that created CTSS, highlighting his significant contribution to early time-sharing systems.
Science fiction author whose remark about distinguishing between possible and impossible scenarios is paraphrased by Kernighan.
Professor of Computer Science at Princeton University, co-author of C programming language, co-creator of Awk and AMPL, and author of several books on programming.
A key figure in the early UNIX days and one of the creators of UNIX, who famously wrote the initial operating system in three weeks on a PDP-7.
A notable contributor to the Berkeley version of UNIX and the creator of the VI editor.
Co-creator of the Awk scripting language alongside Brian Kernighan and Al Aho.
Author of the Sam text editor and one of the three creators of the Go programming language.
Credited with creating 'AutoCode' for the Manchester computer, an early programming language.
One of the three creators of the Go programming language, influenced by the European computer science tradition (ETH Zurich).
Lex Fridman mentions an anecdote where Jeff Dean made a witty remark about P equaling NP.
Worked with Brian Kernighan at Bell Labs on graph partitioning and heuristics for the Traveling Salesman Problem.
A prominent computer scientist known for algorithm design, mentioned as an alternate path Brian Kernighan could have pursued.
Mentioned by Lex Fridman as someone who believes Moore's Law will continue indefinitely due to potential for transistor size reduction.
Showed that there were classes of problems (like graph partitioning) that appeared to be really hard, related to NP-completeness.
A mini-computer from Digital Equipment Corporation that Ken Thompson used to develop the first version of UNIX, notable for its modest memory and processing power.
A desktop computer used by Brian Kernighan in his office, especially when a larger screen is needed.
Earbuds known for comfort, easy pairing, great sound, and six hours of playtime, used for listening to podcasts, audiobooks, and music.
A self-cooling mattress with health sensors that track heart rate and respiratory rate, able to control temperature through an app for improved sleep quality.
Brian Kernighan's preferred computer setup for daily use, valued for its balance of portability, computing power, and screen size.
An early computer that had its own assembly language, part of the discussion on early programming.
A mainframe computer on which CTSS ran, noted for its modified memory configuration (two banks of 32K 36-bit words).
An operating system that further generalized UNIX ideas, treating many resources as file systems.
A command-line tool for searching text using regular expressions, described as a simpler version of Awk, used extensively by Brian Kernighan.
An editor written by Ken Thompson, later stripped down to become Ed for UNIX.
An early programming language mentioned chronologically after Fortran, COBOL, and ALGOL.
A programming language noted for its initial irregular and ugly perception, but which has evolved with fantastic compilation technology and is now viable for backends and frontends.
A functional programming language that took Brian Kernighan several weeks to use for a trivial program, and it ran slowly.
A version of UNIX that started with licensed AT&T code and gradually became free of proprietary code through contributions from people like Bill Joy.
An early operating system that Windows evolved from, described as 'pathetic' but widely used.
A Windows feature that allows users to run Linux command-line tools like Bash, Awk, and Grep directly on Windows.
A collection of UNIX and Linux tools that run perfectly on Windows, used routinely by Brian Kernighan on his Windows machine.
A cursor-based text editor created by Bill Joy in the late 1970s, which Brian Kernighan still uses sometimes.
The original UNIX line-oriented editor, developed by Ken Thompson, used on paper terminals.
An object-oriented programming language that emerged from the C tradition to manage larger codebases and prevent bad programming practices.
A modern programming language that Brian Kernighan would like to learn but found challenging due to rapidly changing documentation and an unfamiliar memory management model.
A programming language mentioned as having its own community, contributing to the separation of programming communities.
A document preparation system, mentioned in comparison to 'troff' for typesetting books.
A modern programming language, of which Brian Kernighan co-authored a book, noted for its powerful concurrency model using 'goroutines'.
A text processing language co-created by Brian Kernighan, Al Aho, and Peter Weinberger, widely used in Linux environments for quick data filtering and manipulation.
An algebraic modeling language co-designed by Brian Kernighan for large-scale optimization problems, praised for its elegance, abstraction, and separation of model from data.
The Compatible Time-Sharing System, an early and influential time-sharing system that preceded Multics, known for being a nice environment to work on.
The package manager for JavaScript, criticized for having less discipline and control, leading to security issues with many unknown packages.
An operating system discussed as having been developed over 50 years ago, originating from efforts at Bell Labs and becoming a foundational system for modern computing due to its programmer-centric design and efficiency.
An operating system used by people like Lex Fridman, where Awk is a common tool. Linux is described as a 'UNIX-like' system that became widely adopted.
A multiplexed information and computing service project that preceded UNIX, aiming to be a large-scale computing utility but ultimately failed to meet its goals due to cost and delays.
A text editor mentioned as being roughly contemporary with Vi, but Brian Kernighan has never internalized its use.
Common Business-Oriented Language, developed by Grace Hopper, for business tasks, still used today.
An early programming language meant to describe algorithmic computations.
A programming language mentioned as part of the explosion of languages after C++.
A functional programming language, representing the 'hippie world' to Lex Fridman, and mentioned as an early language exploring functional concepts like recursion.
A podcast mentioned hypothetically being listened to by Richard Feynman using Raycon earbuds.
Microsoft's graphical operating system, which evolved from MS-DOS, focusing on point-and-click interaction rather than command-line tools like Grep and Awk.
A programming language, described as a flavor of Java, which Brian Kernighan found equally trivial to use for a small task.
A version of Fortran that Brian Kernighan found painful to use for a small program, though it worked.
A programming language used by Brian Kernighan for exploratory data analysis due to its scalability for a few hundred lines of code, also mentioned as having package management issues with 'pip install'.
A modeling language that existed before AMPL, but was considered 'clunky' and very much like Fortran.
A text formatter developed at Bell Labs in the early 1970s, used for typesetting AMPL books, predating TeX.
An early high-level programming language from IBM, designed for scientific and engineering computations, still in use today.
The observation that the number of transistors in an integrated circuit doubles approximately every two years. Discussed in terms of its past impact on processor speed and future limitations.
A scripting language that Brian Kernighan learned quickly, finding it very positive for a trivial formatting task.
A major unsolved problem in theoretical computer science concerning whether every problem whose solution can be quickly verified can also be quickly solved.
A test for machine intelligence proposed by Alan Turing in the early 1950s.
A well-known optimization problem, mentioned in the context of Brian Kernighan's work on heuristics with Shen Lin.
A definitive book on the C language, co-authored by Brian Kernighan and Dennis Ritchie, credited with popularizing the language and setting a standard for its use through clear prose and representative examples.
One of Brian Kernighan's books about programming.
Brian Kernighan's latest book, which describes the history and development of UNIX.
A collection of papers that Brian Kernighan read during an 'AI summer', reflecting early optimism about AI.
Developed the Fortran programming language.
The parent company of Bell Labs, which provided the country's phone service and whose goal was to continuously improve that service through research.
A legendary research institution in New Jersey, vital for the creation of UNIX and many other innovations, characterized by its open, cooperative environment and highly skilled personnel.
The manufacturer of the PDP-7 mini-computer, which was used for early UNIX development.
The academic institution where Brian Kernighan is a professor.
Another research institution, similar to Bell Labs in its influence, contributing a tremendous amount of good material and foundational computing concepts.
The institution where CTSS was developed and a partner in the Multics project, recognized for its significant contributions to computer science.
The academic institution where Bob Fourer is a professor.
More from Lex Fridman
View all 505 summaries
154 minRick Beato: Greatest Guitarists of All Time, History & Future of Music | Lex Fridman Podcast #492
23 minKhabib vs Lex: Training with Khabib | FULL EXCLUSIVE FOOTAGE
196 minOpenClaw: The Viral AI Agent that Broke the Internet - Peter Steinberger | Lex Fridman Podcast #491
266 minState of AI in 2026: LLMs, Coding, Scaling Laws, China, Agents, GPUs, AGI | Lex Fridman Podcast #490
Found this useful? Build your knowledge library
Get AI-powered summaries of any YouTube video, podcast, or article in seconds. Save them to your personal pods and access them anytime.
Try Summify free