Home Lex Fridman Notes
Lex Fridman · 2020-07-18 · 1h 43m

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.

The gist

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.

Big reveals

  • 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.

Things 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.

Recommended in this episode

Books, products and media the guest or host genuinely endorsed here — with the buy link.

Affiliate link — we may earn a commission at no extra cost to you.

Guest’s ownBook

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 00:00:00
Find it on Amazon
Guest’s ownBook

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 00:00:00
Find it on Amazon
Guest’s ownBook

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 00:00:00
Find it on Amazon
Guest’s ownBook

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 00:52:16
Find it on Amazon
RecommendedProduct

Sam text editor

Rob Pike

“editor I use mostly Sam which is an editor that Rob Pike wrote long ago at Bell Labs” — guest 00:41:50
Find it on Amazon
RecommendedProduct

Cygwin

Cygwin (inferred)

“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 00:40:48
Find it on Amazon
Guest’s ownBook

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 01:16:48
Find it on Amazon