Home Lex Fridman Episode
Lex Fridman · 2020-07-18

Brian Kernighan: UNIX, C, AWK, AMPL, and Go Programming | Lex Fridman Podcast #109

UNIX pioneer Brian Kernighan recounts Bell Labs' golden era and reflects on C, AWK, AMPL, programming languages, and the future of computing.

Brian Kernighan: UNIX, C, AWK, AMPL, and Go Programming | Lex Fridman Podcast #109
The guest

Brian Kernighan: Princeton computer science professor and Bell Labs veteran who co-authored the C programming language with Dennis Ritchie, co-created AWK and AMPL, and was a key figure in the early UNIX community.

What this episode covers

Brian Kernighan walks Lex Fridman through the birth of UNIX at Bell Labs in 1969, including Ken Thompson writing the first version in three weeks on a PDP-7. He explains the philosophy behind UNIX, the design and lasting success of C, and his work on AWK and the AMPL optimization-modeling language. The conversation traces the history of programming languages from assembly to functional languages, and Kernighan repeatedly downplays his own contributions with characteristic humility. The episode closes on broader reflections about AI, Moore's law, privacy, and how computing has reshaped human connection.

Recommended on this episode

ProductRecommended

Sam text editor

Rob Pike

“editor I use mostly Sam”
“editor I use mostly Sam which is an editor that Rob Pike wrote long ago at Bell Labs”— guest
ProductRecommended

Cygwin

Cygwin

“which is a wonderful collection”
“cygwin for example which is a wonderful collection of take all your favorite tools from UNIX and Linux and just make them work perfectly on Windows”— guest

The guest's own work

BookBy the guestISBN verified

UNIX: A History and a Memoir

Brian Kernighan

“has written a lot of books on programming computers and life including the practice of programming the goal programming language and his latest UNIX a history”— Lex Fridman
BookBy the guestISBN verified

The Practice of Programming

Brian Kernighan

“has written a lot of books on programming computers and life including the practice of programming the goal programming language and his latest UNIX a history”— Lex Fridman
BookBy the guestISBN verified

The Go Programming Language

Brian Kernighan

“has written a lot of books on programming computers and life including the practice of programming the goal programming language and his latest UNIX a history”— Lex Fridman
BookBy the guestISBN verified

The C Programming Language

Brian Kernighan and Dennis Ritchie

“you wrote a book C programming language and C is probably one of the most important languages in the history of programming languages”— Lex Fridman
BookBy the guestISBN verified

AMPL: A Modeling Language for Mathematical Programming

Robert Fourer, David Gay, Brian Kernighan

“we wrote a couple of versions of a book on which is one of the greatest books ever written I love that book”— guest

Also referenced (named, not recommended)

ProductReferenced

MacBook Air (13-inch)

Apple

“I have a at this point a 13-inch MacBook Air which I used because it's kind of a reasonable balance of the various things I need”— guest
ProductReferenced

iMac

Apple

“I have a big iMac in my office that I use from time to time as well especially when I need a big screen”— guest
BookReferenced

Computers and Thought

Edward Feigenbaum and Julian Feldman

“there's a wonderful collection of papers called computers and thought that was published and about that era and people were very optimistic”— guest

Big reveals from this episode

  • Kernighan insists he never wrote any operating system code and had nothing to do with the original UNIX kernel.
  • He calls Ken Thompson 'the singularity' among programmers, several leagues above himself or anyone else.
  • Kernighan recounts struggling with Rust for days due to rapidly changing, inconsistent documentation when he tried his test program.
  • He reveals AMPL's acclaimed book was typeset in troff, a Bell Labs formatter that predates TeX by 5 to 10 years.
  • Asked whether P equals NP, he bets no, and shares Jeff Dean's joke that it's true only if P is 0 or N is 1.
  • He says he realized early on with John Hopcroft that he 'was not cut out' for theoretical computer science, steering him toward programming and books.
  • Kernighan agrees JavaScript was once considered possibly the ugliest language yet may be taking over both back and front ends.

Worth remembering

  • Early computing meant handing a deck of punch cards over a counter and waiting hours to learn you made a mistake.
  • CTSS, arguably the first time-sharing system, ran on an IBM 7090 with just two banks of 32K words of memory.
  • Ken Thompson wrote the first UNIX in three weeks while his wife was away in California with their one-year-old son.
  • UNIX's efficiency came from being built on extremely modest hardware, forcing minimal, general mechanisms.
  • Kernighan attributes C's longevity to a sweet spot between expressiveness and efficiency, plus its bundling with UNIX.
  • He twisted Dennis Ritchie's arm to co-write the C book, and credits Ritchie's reference manual as a model of clear prose.
  • Go's standout feature is its concurrency model, based on Tony Hoare's communicating sequential processes from 40-plus years ago.
  • Kernighan laments modern programming's reliance on downloading massive opaque libraries via pip and npm with no recourse when they break.
  • About a dozen languages account for roughly 95% of all programming, while around 2000 languages remain in marginal use.
  • The episode ends with Kernighan's famous maxim: don't comment bad code, rewrite it.