back to index

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


small model | large model

link |
00:00:00.000
The following is a conversation with Brian Kernighan,
link |
00:00:03.320
a professor of computer science at Princeton University.
link |
00:00:07.560
He was a key figure in the computer science community
link |
00:00:10.140
in the early Unix days, alongside Unix creators,
link |
00:00:13.760
Ken Thompson and Dennis Ritchie.
link |
00:00:16.240
He coauthored the C programming language with Dennis Ritchie,
link |
00:00:20.080
the creator of C, and has written a lot of books
link |
00:00:23.520
on programming, computers, and life,
link |
00:00:26.280
including The Practice of Programming,
link |
00:00:28.480
the Go programming language, and his latest,
link |
00:00:31.200
Unix, A History and a Memoir.
link |
00:00:34.080
He cocreated AUK, the text processing language
link |
00:00:36.920
used by Linux folks like myself.
link |
00:00:39.500
He co designed Ample, an algebraic modeling language
link |
00:00:43.800
that I personally love and have used a lot in my life
link |
00:00:47.560
for large scale optimization.
link |
00:00:49.580
I think I can keep going for a long time
link |
00:00:51.680
with his creations and accomplishments,
link |
00:00:54.240
which is funny because given all that,
link |
00:00:56.600
he's one of the most humble and kind people
link |
00:00:59.160
I've spoken to on this podcast.
link |
00:01:01.780
Quick summary of the ads, two new sponsors,
link |
00:01:04.880
the amazing self cooling 8sleep mattress
link |
00:01:10.560
and Raycon earbuds.
link |
00:01:13.260
Please consider supporting the podcast
link |
00:01:15.420
by going to 8sleep.com slash Lex
link |
00:01:19.040
and going to buyraycon.com slash Lex.
link |
00:01:23.040
Click the links, buy the stuff.
link |
00:01:25.200
It really is the best way to support this podcast
link |
00:01:27.680
and the journey I'm on.
link |
00:01:29.640
If you enjoy this thing, subscribe on YouTube,
link |
00:01:32.000
review it with 5,000 Apple podcasts,
link |
00:01:34.200
support it on Patreon,
link |
00:01:35.560
or connect with me on Twitter at Lex Friedman.
link |
00:01:39.680
As usual, I'll do a few minutes of ads now
link |
00:01:41.960
and never any ads in the middle
link |
00:01:43.300
that could break the flow of the conversation.
link |
00:01:45.880
This show is sponsored by 8sleep
link |
00:01:49.240
and it's incredible pod pro mattress
link |
00:01:51.880
that you can check out at 8sleep.com slash Lex
link |
00:01:54.720
to get $200 off.
link |
00:01:57.360
The mattress controls temperature with an app
link |
00:02:00.720
and can cool down to as low as 55 degrees.
link |
00:02:03.840
Research shows that temperature has a big impact
link |
00:02:07.000
on the quality of our sleep.
link |
00:02:09.040
Anecdotally, it's been a game changer for me.
link |
00:02:11.280
I love it.
link |
00:02:12.280
The pod pro is packed with sensors
link |
00:02:14.320
that track heart rate, heart rate variability,
link |
00:02:17.140
and respiratory rate,
link |
00:02:18.640
showing it all on their app once you wake up.
link |
00:02:21.440
Plus, if you have a partner,
link |
00:02:23.540
you can control the temperature of each side of the bed.
link |
00:02:26.600
I don't happen to have one,
link |
00:02:28.260
but the 8sleep app reminds me
link |
00:02:30.080
that I should probably get on that.
link |
00:02:32.040
So ladies, if a temperature controlled mattress
link |
00:02:34.860
isn't a good reason to apply,
link |
00:02:36.760
I don't know what is.
link |
00:02:38.920
The app's health metrics are amazing,
link |
00:02:41.160
but the cooling alone is honestly worth the money.
link |
00:02:44.480
As some of you know, I don't always sleep,
link |
00:02:47.280
but when I do, I choose the 8sleep pod pro mattress.
link |
00:02:51.700
Check it out at 8sleep.com slash Lex
link |
00:02:54.680
to get $200 off.
link |
00:02:57.520
This show is also sponsored by Raycon earbuds.
link |
00:03:01.620
Get them at buyraycon.com slash lex.
link |
00:03:06.040
They've quickly become my main method
link |
00:03:07.760
of listening to podcasts, audio books,
link |
00:03:09.680
and music when I run,
link |
00:03:11.600
do the pushups and pullups
link |
00:03:13.960
that I've begun to hate at this point,
link |
00:03:15.940
or just living life.
link |
00:03:17.560
In fact, I often listen to brown noise with these
link |
00:03:20.320
when I'm thinking deeply about something.
link |
00:03:22.320
It helps me focus the mind.
link |
00:03:24.320
They're super comfortable, pair easily,
link |
00:03:26.500
great sound, great bass, six hours of playtime.
link |
00:03:30.200
In fact, for fun, I have one of the earbuds in now
link |
00:03:33.520
and I'm listening to Europa by Santana,
link |
00:03:36.360
probably one of my favorite guitar songs.
link |
00:03:39.160
It kind of makes me feel like I'm in a music video.
link |
00:03:41.560
So they told me to say that a bunch of celebrities
link |
00:03:44.840
use these like Snoop Dogg, Melissa Etheridge, and Cardi B.
link |
00:03:50.480
I don't even know who Cardi B is,
link |
00:03:52.720
but her earbud game is on point.
link |
00:03:55.600
To mention celebrities I actually care about,
link |
00:03:58.320
I'm sure if Richard Feynman was still with us,
link |
00:04:01.160
he'd be listening to the Joe Rogan Experience
link |
00:04:03.840
with Raycon earbuds.
link |
00:04:06.020
Get them at buyraycon.com slash lex.
link |
00:04:09.360
It's how they know I sent you
link |
00:04:11.040
and increases the chance that he'll support
link |
00:04:12.920
this podcast in the future.
link |
00:04:14.640
So for all of the sponsors, click all of the links.
link |
00:04:17.560
It really helps this podcast.
link |
00:04:19.940
And now, here's my conversation with Brian Kernighan.
link |
00:04:25.040
Unix started being developed 50 years ago.
link |
00:04:28.520
It'd be more than 50 years ago.
link |
00:04:30.520
Can you tell the story like you describe in your new book
link |
00:04:33.520
of how Unix was created?
link |
00:04:35.700
Ha, if I can remember that far back,
link |
00:04:38.280
it was some while ago.
link |
00:04:40.440
So I think the gist of it is that at Bell Labs,
link |
00:04:44.440
in 1969, there were a group of people
link |
00:04:46.760
who had just finished working on the Multics project,
link |
00:04:49.920
which was itself a follow on to CTSS.
link |
00:04:54.320
So we can go back sort of an infinite regress in time,
link |
00:04:57.040
but the CTSS was a very, very, very nice time sharing system.
link |
00:05:01.040
It was very nice to use.
link |
00:05:02.080
I actually used it that summer I spent in Cambridge in 1966.
link |
00:05:06.920
What was the hardware there?
link |
00:05:08.520
So what's the operating system, what's the hardware there?
link |
00:05:10.360
What's the CTSS look like?
link |
00:05:12.160
So CTSS looked like kind of like
link |
00:05:14.840
a standard time sharing system.
link |
00:05:17.040
Certainly at the time, it was the only time sharing.
link |
00:05:19.400
Let's go back to the basics.
link |
00:05:20.800
What's a time sharing system?
link |
00:05:22.360
Okay, in the beginning was the word
link |
00:05:23.760
and the word was the system.
link |
00:05:24.600
And then there was time sharing systems.
link |
00:05:27.040
Yeah, if we go back into, let's call it the 1950s
link |
00:05:29.960
and early 1960s, most computing was done on very big
link |
00:05:34.280
computers, physically big, although not terribly powerful
link |
00:05:36.960
by today's standards, that were maintained
link |
00:05:39.840
in very large rooms and you use things like punch cards
link |
00:05:45.760
to write your programs on and talk to them.
link |
00:05:47.440
So you would take a deck of cards,
link |
00:05:49.320
write your program on it, send it over a counter,
link |
00:05:51.920
hand it to an operator and some while later
link |
00:05:54.520
back would come something that said,
link |
00:05:55.680
oh, you made a mistake and then you'd recycle.
link |
00:05:58.040
And so it was very, very slow.
link |
00:05:59.480
So the idea of time sharing was that you take
link |
00:06:02.320
basically that same computer, but connect to it
link |
00:06:06.240
with something that looked like an electric typewriter.
link |
00:06:09.440
They could be a long distance away, it could be close,
link |
00:06:11.960
but fundamentally what the operating system did
link |
00:06:14.960
was to give each person who was connected to it
link |
00:06:18.080
and wanting to do something a small slice of time
link |
00:06:23.680
to do a particular job.
link |
00:06:24.880
So I might be editing a file, so I would be typing
link |
00:06:28.200
and every time I hit a keystroke,
link |
00:06:29.480
the operating system would wake up and said,
link |
00:06:31.000
oh, he typed character, let me remember that.
link |
00:06:33.440
Then it'd go back to doing something else.
link |
00:06:35.000
So it'd be going around and around a group of people
link |
00:06:38.040
who were trying to get something done, giving each
link |
00:06:40.200
a small slice of time and giving them each the illusion
link |
00:06:45.200
that they pretty much had the whole machine to themselves
link |
00:06:47.600
and hence time sharing, that is sharing the computing time
link |
00:06:51.360
resource of the computer among a number of people
link |
00:06:54.240
who were doing it.
link |
00:06:55.080
Without the individual people being aware
link |
00:06:56.920
that there's others in a sense, the illusion,
link |
00:06:59.320
the feelings that the machine is your own.
link |
00:07:02.560
Pretty much that was the idea.
link |
00:07:04.040
Yes, if it were well done and if it were fast enough
link |
00:07:08.080
and other people weren't doing too much,
link |
00:07:09.840
you did have the illusion that you had the whole machine
link |
00:07:12.320
to yourself and it was very much better
link |
00:07:14.880
than the punch card model.
link |
00:07:16.480
And so CTSS, the compatible time sharing system
link |
00:07:19.840
was I think arguably the first of these.
link |
00:07:22.480
It was done I guess technically in 64 or something like that.
link |
00:07:26.440
It ran on an IBM 7094, slightly modified
link |
00:07:30.080
to have twice as much memory as the norm.
link |
00:07:32.840
It had two banks of 32K words instead of one.
link |
00:07:37.520
So.
link |
00:07:38.920
32K words, yeah.
link |
00:07:40.800
Each word was 36 bits, so call it
link |
00:07:42.960
about 150 kilobytes times two.
link |
00:07:46.440
So by today's standards, that's down in the noise.
link |
00:07:49.640
But at the time, that was a lot of memory
link |
00:07:51.520
and memory was expensive.
link |
00:07:53.280
So CTSS was just a wonderful environment to work on.
link |
00:07:56.920
It was done by the people at MIT,
link |
00:07:58.720
led by Fernando Corbato, Corby who died just earlier
link |
00:08:03.600
this year, and a bunch of other folks.
link |
00:08:06.840
So I spent the summer of 66 working on that,
link |
00:08:09.520
had a great time, met a lot of really nice people
link |
00:08:12.640
and indirectly knew of people at Bell Labs
link |
00:08:17.640
who were also working on a follow on to CTSS
link |
00:08:22.480
that was called Multics.
link |
00:08:24.080
So Multics was meant to be the system
link |
00:08:26.000
that would do everything that CTSS did
link |
00:08:27.720
but do it better for a larger population.
link |
00:08:30.760
All the usual stuff.
link |
00:08:31.720
Now the actual time sharing, the scheduling,
link |
00:08:36.560
what's the algorithm that performs the scheduling?
link |
00:08:39.040
What's that look like?
link |
00:08:39.880
How much magic is there?
link |
00:08:40.980
What are the metrics?
link |
00:08:42.720
How does it all work in the beginning?
link |
00:08:44.920
So the answer is I don't have a clue.
link |
00:08:46.200
I think the basic idea was nothing more
link |
00:08:48.280
than who all wants to get something done.
link |
00:08:50.600
Suppose that things are very quiet
link |
00:08:52.040
in the middle of the night,
link |
00:08:53.660
then I get all the time that I want.
link |
00:08:55.760
Suppose that you and I are contending at high noon
link |
00:08:58.080
for something like that,
link |
00:08:59.880
then probably the simplest algorithm is a round robin one
link |
00:09:02.600
that gives you a bit of time, gives me a bit of time.
link |
00:09:05.080
And then we could adapt to that.
link |
00:09:07.080
Like what are you trying to do?
link |
00:09:08.680
Are you text editing or are you compiling or something?
link |
00:09:12.000
And then we might adjust the scheduler
link |
00:09:13.600
according to things like that.
link |
00:09:15.040
So okay, so Multics was trying to just do some of the,
link |
00:09:19.000
clean it up a little bit.
link |
00:09:20.280
Well, it was meant to be much more than that.
link |
00:09:22.280
So Multics was the multiplexed information
link |
00:09:24.320
and computing service and it was meant to be
link |
00:09:27.000
a very large thing that would provide computing utility.
link |
00:09:29.980
Something that where you could actually think of it
link |
00:09:32.940
as just a plug in the wall service.
link |
00:09:35.080
Sort of like cloud computing today.
link |
00:09:37.140
Same idea, but 50 odd years earlier.
link |
00:09:40.680
And so what Multics offered
link |
00:09:43.800
was a richer operating system environment,
link |
00:09:46.520
a piece of hardware that was better designed
link |
00:09:48.880
for doing the kind of sharing of resources.
link |
00:09:53.160
And presumably lots of other things.
link |
00:09:55.920
Do you think people at that time had the dream
link |
00:09:58.520
of what cloud computing is starting to become now,
link |
00:10:01.080
which is computing is everywhere.
link |
00:10:03.120
That you can just plug in almost,
link |
00:10:06.440
and you never know how the magic works.
link |
00:10:09.000
You just kind of plug in, add your little computation
link |
00:10:11.720
that you need to perform and it does it.
link |
00:10:13.640
Was that the dream?
link |
00:10:14.880
I don't know where that was the dream.
link |
00:10:16.000
I wasn't part of it at that point.
link |
00:10:17.360
I remember I was an intern for summer.
link |
00:10:19.360
But my sense is given that it was over 50 years ago,
link |
00:10:23.240
yeah, they had that idea that it was an information utility.
link |
00:10:26.240
That it was something where if you had a computing task to do,
link |
00:10:29.800
you could just go and do it.
link |
00:10:31.660
Now I'm betting that they didn't have the same view
link |
00:10:35.880
of computing for the masses, let's call it.
link |
00:10:38.840
The idea that your grandmother would be shopping on Amazon.
link |
00:10:43.200
I don't think that was part of it.
link |
00:10:45.000
But if your grandmother were a programmer,
link |
00:10:47.160
it might be very easy for her to go and use
link |
00:10:49.920
this kind of utility.
link |
00:10:51.520
What was your dream of computers at that time?
link |
00:10:53.680
What did you see as the future of computers?
link |
00:10:55.680
Because you have predicted what computers are today.
link |
00:10:59.600
Oh, short answer, absolutely not.
link |
00:11:01.740
I have no clue.
link |
00:11:02.580
I'm not sure I had a dream.
link |
00:11:03.840
It was a dream job in the sense that I really enjoyed
link |
00:11:06.640
what I was doing.
link |
00:11:07.480
I was surrounded by really, really nice people.
link |
00:11:10.020
Cambridge is a very fine city to live in in the summer,
link |
00:11:12.880
less so in the winter when it snows.
link |
00:11:14.300
But in the summer, it was a delightful time.
link |
00:11:16.880
And so I really enjoyed all of that stuff.
link |
00:11:19.240
And I learned things.
link |
00:11:20.400
And I think the good fortune of being there for summer
link |
00:11:25.000
led me then to get a summer job at Bell Labs
link |
00:11:27.220
the following summer.
link |
00:11:28.520
And that was quite useful for the future.
link |
00:11:31.760
So Bell Labs is this magical, legendary place.
link |
00:11:35.960
So first of all, where is Bell Labs?
link |
00:11:39.060
And can you start talking about that journey
link |
00:11:44.200
towards Unix at Bell Labs?
link |
00:11:46.600
Yeah, so Bell Labs is physically scattered around,
link |
00:11:50.160
at the time, scattered around New Jersey.
link |
00:11:52.320
The primary location is in a town called Murray Hill,
link |
00:11:54.960
or a location called Murray Hill is actually
link |
00:11:57.880
across the boundary between two small towns in New Jersey
link |
00:12:00.840
called New Providence and Berkeley Heights.
link |
00:12:03.440
Think of it as about 15, 20 miles straight west
link |
00:12:05.440
of New York City, and therefore about an hour north
link |
00:12:08.920
of here in Princeton.
link |
00:12:11.520
And at that time, it had, make up a number,
link |
00:12:15.080
three or 4,000 people there, many of whom had PhDs
link |
00:12:18.000
and mostly doing physical sciences,
link |
00:12:20.840
chemistry, physics, materials kinds of things,
link |
00:12:24.480
but very strong math and rapidly growing interest
link |
00:12:29.120
in computing as people realized you could do things
link |
00:12:31.240
with computers that you might not have been able
link |
00:12:34.000
to do before.
link |
00:12:35.040
You could replace labs with computers
link |
00:12:37.520
that had worked on models of what was going on.
link |
00:12:41.360
So that was the essence of Bell Labs.
link |
00:12:44.160
And again, I wasn't a permanent employee there.
link |
00:12:46.600
That was another internship.
link |
00:12:47.960
I got lucky in internships.
link |
00:12:50.480
I mean, if you could just linger on it a little bit,
link |
00:12:52.560
what was the, what was in the air there?
link |
00:12:55.520
Because some of the, the number of Nobel Prizes,
link |
00:12:57.800
the number of Turing Awards and just legendary
link |
00:13:00.020
computer scientists that come from their inventions,
link |
00:13:03.000
including developments, including Unix,
link |
00:13:05.920
it's just, it's unbelievable.
link |
00:13:07.900
So was there something special about that place?
link |
00:13:11.600
Oh, I think there was very definitely something special.
link |
00:13:14.640
I mentioned the number of people,
link |
00:13:15.800
it's a very large number of people, very highly skilled
link |
00:13:19.120
and working in an environment
link |
00:13:20.680
where there was always something interesting to work on
link |
00:13:23.120
because the goal of Bell Labs,
link |
00:13:25.120
which was a small part of AT&T,
link |
00:13:27.280
which provided basically the country's phone service.
link |
00:13:30.160
The goal of AT&T was to provide service for everybody.
link |
00:13:33.440
And the goal of Bell Labs was to try and make that service
link |
00:13:36.940
keep getting better, so improving service.
link |
00:13:39.520
And that meant doing research on a lot of different things,
link |
00:13:43.920
physical devices, like the transistor
link |
00:13:46.400
or fiber optical cables or microwave systems,
link |
00:13:50.860
all of these things the labs worked on.
link |
00:13:53.240
And it was kind of just the beginning of real boom times
link |
00:13:56.580
in computing as well.
link |
00:13:58.040
Because when I was there, I went there first in 66.
link |
00:14:01.160
So computing was at that point fairly young.
link |
00:14:04.560
And so people were discovering
link |
00:14:06.000
that you could do lots of things with computers.
link |
00:14:08.720
So how was Unix born?
link |
00:14:10.840
So Multics, in spite of having an enormous number
link |
00:14:14.600
of really good ideas and lots of good people working on it,
link |
00:14:16.840
fundamentally didn't live up, at least in the short run,
link |
00:14:20.040
and I think ultimately really ever,
link |
00:14:22.160
to its goal of being this information utility.
link |
00:14:25.560
It was too expensive and certainly what was promised
link |
00:14:29.200
was delivered much too late.
link |
00:14:31.280
And so in roughly the beginning of 1969,
link |
00:14:34.600
Bell Labs pulled out of the project.
link |
00:14:37.200
The project at that point had included MIT, Bell Labs,
link |
00:14:42.520
and General Electric, General Electric made computers.
link |
00:14:45.480
So General Electric was the hardware operation.
link |
00:14:48.320
So Bell Labs, realizing this wasn't going anywhere
link |
00:14:50.880
on a timescale they cared about, pulled out of the project.
link |
00:14:54.160
And this left several people with an acquired taste
link |
00:14:59.160
for really, really nice computing environments,
link |
00:15:01.660
but no computing environment.
link |
00:15:03.520
And so they started thinking about what could you do
link |
00:15:06.820
if you were going to design a new operating system
link |
00:15:09.480
that would provide the same kind of comfortable computing
link |
00:15:12.920
as CTSS had, but also the facilities of something
link |
00:15:16.040
like Multics sort of brought forward.
link |
00:15:19.440
And so they did a lot of paper design stuff.
link |
00:15:21.720
And at the same time, Ken Thompson found
link |
00:15:23.920
what is characterized as a little used PDP 7,
link |
00:15:27.300
where he started to do experiments with file systems,
link |
00:15:31.080
just how do you store information on a computer
link |
00:15:33.620
in a efficient way, and then this famous story
link |
00:15:36.380
that his wife went away to California for three weeks,
link |
00:15:39.160
taking their one year old son, and three weeks,
link |
00:15:43.280
and he sat down and wrote an operating system,
link |
00:15:45.640
which ultimately became Unix.
link |
00:15:47.500
So software productivity was good in those days.
link |
00:15:50.360
So PDP, what's a PDP 7?
link |
00:15:52.060
So it's a piece of hardware.
link |
00:15:53.400
Yeah, it's a piece of hardware.
link |
00:15:54.560
It was one of early machines made
link |
00:15:56.760
by Digital Equipment Corporation, DEC,
link |
00:15:59.880
and it was a mini computer, so called.
link |
00:16:03.460
It had, I would have to look up the numbers exactly,
link |
00:16:07.480
but it had a very small amount of memory,
link |
00:16:09.360
maybe 16K, 16 bit words, or something like that,
link |
00:16:13.320
relatively slow, probably not super expensive.
link |
00:16:17.120
Maybe, again, making this up, I'd have to look it up,
link |
00:16:19.720
$100,000 or something like that.
link |
00:16:21.840
Which is not super expensive in those days, right?
link |
00:16:24.360
It was expensive.
link |
00:16:25.400
It was enough that you and I probably
link |
00:16:26.840
wouldn't be able to buy one,
link |
00:16:27.680
but a modest group of people could get together.
link |
00:16:30.880
But in any case, it came out, if I recall, in 1964.
link |
00:16:34.880
So by 1969, it was getting a little obsolete,
link |
00:16:38.640
and that's why it was little used.
link |
00:16:41.500
If you can sort of comment,
link |
00:16:42.800
what do you think it's like
link |
00:16:43.800
to write an operating system like that?
link |
00:16:45.680
So that process that Ken went through in three weeks,
link |
00:16:49.600
because you were, I mean, you're a part of that process.
link |
00:16:52.800
You contributed a lot to Unix's early development.
link |
00:16:57.600
So what do you think it takes to do that first step,
link |
00:17:01.360
that first kind of, from design to reality on the PDP?
link |
00:17:05.460
Well, let me correct one thing.
link |
00:17:07.160
I had nothing to do with it.
link |
00:17:08.860
So I did not write it.
link |
00:17:10.440
I have never written operating system code.
link |
00:17:13.440
And so I don't know.
link |
00:17:16.400
Now an operating system is simply code.
link |
00:17:18.980
And this first one wasn't very big,
link |
00:17:21.400
but it's something that lets you run processes,
link |
00:17:24.600
lets you execute some kind of code that has been written.
link |
00:17:27.320
It lets you store information for periods of time
link |
00:17:30.800
so that it doesn't go away when you turn the power off
link |
00:17:33.160
or reboot or something like that.
link |
00:17:36.180
And there's kind of a core set of tools
link |
00:17:38.560
that are technically not part of an operating system,
link |
00:17:40.920
but you probably need them.
link |
00:17:42.380
In this case, Ken wrote an assembler
link |
00:17:44.980
for the PDP 7 that worked.
link |
00:17:46.680
He needed a text editor
link |
00:17:47.820
so that he could actually create text.
link |
00:17:49.840
He had the file system stuff that he had been working on,
link |
00:17:52.120
and then the rest of it was just a way
link |
00:17:53.640
to load things, executable code from the file system
link |
00:17:57.840
into the memory, give it control,
link |
00:18:00.040
and then recover control when it was finished
link |
00:18:02.800
or in some other way quit.
link |
00:18:04.840
What was the code written in,
link |
00:18:06.600
primarily the programming language?
link |
00:18:08.160
Was it in assembly?
link |
00:18:09.200
Yeah, PDP 7 assembler that Ken created.
link |
00:18:13.680
These things were assembly language
link |
00:18:15.200
until probably the, call it 1973 or 74, something like that.
link |
00:18:21.440
Forgive me if it's a dumb question,
link |
00:18:23.000
but it feels like a daunting task
link |
00:18:25.200
to write any kind of complex system in assembly.
link |
00:18:28.780
Absolutely.
link |
00:18:31.280
It feels like impossible to do any kind
link |
00:18:32.860
of what we think of as software engineering with assembly,
link |
00:18:36.160
because to work on a big picture sort of.
link |
00:18:40.080
I think it's hard.
link |
00:18:41.480
It's been a long time since I wrote assembly language.
link |
00:18:43.760
It is absolutely true that in assembly language,
link |
00:18:45.600
if you make a mistake, nobody tells you.
link |
00:18:47.160
There are no training wheels whatsoever.
link |
00:18:49.640
And so stuff doesn't work.
link |
00:18:51.120
Now what?
link |
00:18:51.960
There's no debuggers.
link |
00:18:53.400
Well, there could be debuggers,
link |
00:18:54.460
but that's the same problem, right?
link |
00:18:56.800
How do you actually get something
link |
00:18:58.920
that will help you debug it?
link |
00:19:00.400
So part of it is an ability to see the big picture.
link |
00:19:05.640
Now these systems were not big in the sense
link |
00:19:07.760
that today's pictures are.
link |
00:19:08.680
So the big picture was in some sense more manageable.
link |
00:19:11.840
I mean, then realistically,
link |
00:19:13.560
there's an enormous variation
link |
00:19:15.240
in the capabilities of programmers.
link |
00:19:17.520
And Ken Thompson, who did that first one,
link |
00:19:20.200
is kind of the singularity, in my experience, of programmers.
link |
00:19:25.480
With no disrespect to you or even to me,
link |
00:19:27.760
he's in several leagues removed.
link |
00:19:31.000
I know there's levels.
link |
00:19:33.080
It's a fascinating thing that there are unique stars
link |
00:19:37.200
in particular in the programming space
link |
00:19:39.800
and at a particular time.
link |
00:19:40.880
You know, the time matters too,
link |
00:19:42.160
the timing of when that person comes along.
link |
00:19:44.440
And a wife does have to leave.
link |
00:19:47.800
There's this weird timing that happens
link |
00:19:49.760
and then all of a sudden something beautiful is created.
link |
00:19:52.240
I mean, how does it make you feel
link |
00:19:53.400
that there's a system that was created in three weeks
link |
00:19:58.280
or maybe you can even say on a whim,
link |
00:20:01.160
but not really, but of course, quickly,
link |
00:20:03.600
that is now, you could think of most of the computers
link |
00:20:07.080
in the world run on a Unix like system?
link |
00:20:10.560
Right.
link |
00:20:12.800
How do you interpret, like,
link |
00:20:14.240
if you kind of zoom from the alien perspective,
link |
00:20:16.480
if you were just observing Earth,
link |
00:20:18.360
and all of a sudden these computers took over the world
link |
00:20:20.960
and they started from this little initial seed of Unix,
link |
00:20:24.800
how does that make you feel?
link |
00:20:26.600
It's quite surprising.
link |
00:20:27.640
And you asked earlier about prediction.
link |
00:20:30.280
The answer is no.
link |
00:20:31.120
There's no way you could predict that kind of evolution.
link |
00:20:33.960
And I don't know whether it was inevitable
link |
00:20:37.120
or just a whole sequence of blind luck.
link |
00:20:39.080
I suspect more of the latter.
link |
00:20:40.920
And so I look at it and think, gee, that's kind of neat.
link |
00:20:45.320
I think the real question is what does Ken think about that?
link |
00:20:49.000
Because he's the guy arguably from whom it really came.
link |
00:20:53.000
You know, tremendous contributions from Dennis Ritchie
link |
00:20:55.240
and then others around in that Bell Labs environment.
link |
00:20:58.200
But, you know, if you had to pick a single person,
link |
00:21:01.160
that would be Ken.
link |
00:21:02.560
So you've written a new book,
link |
00:21:04.320
Unix, a history and a memoir.
link |
00:21:06.320
Are there some memorable human stories,
link |
00:21:08.960
funny or profound from that time
link |
00:21:10.680
that just kind of stand out?
link |
00:21:12.160
Oh, there's a lot of them in his book.
link |
00:21:14.000
Oh, there's a lot of them in a sense.
link |
00:21:15.680
And again, it's a question of can you resurrect them
link |
00:21:18.160
in real time?
link |
00:21:19.000
Never.
link |
00:21:19.840
His memory fails.
link |
00:21:21.720
But I think part of it was that Bell Labs at the time
link |
00:21:25.040
was a very special kind of place to work
link |
00:21:27.040
because there were a lot of interesting people
link |
00:21:28.960
and the environment was very, very open and free.
link |
00:21:31.720
It was a very cooperative environment,
link |
00:21:33.280
very friendly environment.
link |
00:21:34.360
And so if you had an interesting problem,
link |
00:21:35.960
you go and talk to somebody
link |
00:21:37.160
and they might help you with the solution.
link |
00:21:40.600
And it was a kind of a fun environment too,
link |
00:21:43.800
in which people did strange things
link |
00:21:46.680
and often tweaking the bureaucracy in one way or another.
link |
00:21:52.440
So rebellious in certain kinds of ways.
link |
00:21:54.960
In some ways, yeah, absolutely.
link |
00:21:56.720
I think most people didn't take too kindly
link |
00:21:58.880
to the bureaucracy and I'm sure the bureaucracy
link |
00:22:01.560
put up with an enormous amount
link |
00:22:03.840
that they didn't really want to.
link |
00:22:06.000
So maybe to linger on it a little bit,
link |
00:22:09.520
do you have a sense of what the philosophy
link |
00:22:11.840
that characterizes Unix is, the design?
link |
00:22:15.320
Not just the initial, but just carry through the years,
link |
00:22:18.880
just being there, being around it.
link |
00:22:20.640
What's the fundamental philosophy behind the system?
link |
00:22:23.320
I think one aspect of fundamental philosophy
link |
00:22:25.600
was to provide an environment that made it easy to write
link |
00:22:29.120
or easier, productive to write programs.
link |
00:22:31.960
So it was meant as a programmer environment.
link |
00:22:33.720
It wasn't meant specifically as something
link |
00:22:36.080
to do some other kind of job.
link |
00:22:38.400
For example, it was used extensively for word processing,
link |
00:22:41.400
but it wasn't designed as a word processing system.
link |
00:22:43.720
It was used extensively for lab control,
link |
00:22:45.800
but it wasn't designed for that.
link |
00:22:47.320
It was used extensively as a front end
link |
00:22:49.480
for big other systems, big dumb systems,
link |
00:22:52.440
but it wasn't designed for that.
link |
00:22:53.800
It was meant to be an environment
link |
00:22:55.640
where it was really easy to write programs.
link |
00:22:57.960
So the programmers could be highly productive.
link |
00:23:00.680
And part of that was to be a community.
link |
00:23:03.120
And there's some observation from Dennis Ritchie,
link |
00:23:05.760
I think at the end of the book,
link |
00:23:06.840
that says that from his standpoint,
link |
00:23:09.720
the real goal was to create a community
link |
00:23:11.920
where people could work as programmers on a system.
link |
00:23:17.160
And I think in that sense, certainly for many, many years,
link |
00:23:19.600
it succeeded quite well at that.
link |
00:23:22.520
And part of that is the technical aspects
link |
00:23:25.040
of because it made it really easy to write programs,
link |
00:23:27.600
people did write interesting programs.
link |
00:23:29.520
Those programs tended to be used by other programmers.
link |
00:23:32.000
And so it was kind of a virtuous circle
link |
00:23:34.600
of more and more stuff coming up
link |
00:23:36.560
that was really good for programmers.
link |
00:23:39.360
And you were part of that community of programmers.
link |
00:23:41.800
So what was it like writing programs in that early Unix?
link |
00:23:45.760
It was a blast.
link |
00:23:46.600
It really was.
link |
00:23:50.000
You know, I like to program.
link |
00:23:51.120
I'm not a terribly good programmer,
link |
00:23:52.800
but it was a lot of fun to write code.
link |
00:23:55.260
And in the early days, there was an enormous amount
link |
00:23:57.520
of what you would today, I suppose,
link |
00:23:59.000
called low hanging fruit.
link |
00:24:00.100
People hadn't done things before.
link |
00:24:02.520
And this was this new environment
link |
00:24:04.320
and the whole combination of nice tools
link |
00:24:07.640
and very responsive system and tremendous colleagues
link |
00:24:11.560
made it possible to write code.
link |
00:24:13.640
You could have an idea in the morning.
link |
00:24:16.440
You could do an experiment with it.
link |
00:24:19.080
You could have something limping along that night
link |
00:24:21.320
or the next day and people would react to it.
link |
00:24:23.600
And they would say, oh, that's wonderful,
link |
00:24:25.920
but you're really screwed up here.
link |
00:24:27.800
And the feedback loop was then very, very short and tight.
link |
00:24:31.680
And so a lot of things got developed fairly quickly
link |
00:24:34.960
that in many cases still exist today.
link |
00:24:39.920
And I think that was part of what made it fun
link |
00:24:43.240
because programming itself is fun.
link |
00:24:44.680
It's puzzle solving in a variety of ways,
link |
00:24:46.900
but I think it's even more fun when you do something
link |
00:24:50.000
that somebody else then uses.
link |
00:24:52.320
Even if they whine about it not working,
link |
00:24:54.600
the fact that they used it is part of the reward mechanism.
link |
00:24:58.560
And what was the method of interaction,
link |
00:25:00.480
the communication, that feedback loop?
link |
00:25:03.640
I mean, this is before the internet.
link |
00:25:05.440
Certainly before the internet.
link |
00:25:07.520
It was mostly physical right there.
link |
00:25:11.640
Somebody would come into your office and say something.
link |
00:25:13.680
So these places are all close by,
link |
00:25:15.280
like offices are nearby, so really lively interaction.
link |
00:25:18.960
Yeah, yeah.
link |
00:25:19.800
Bell Labs was fundamentally one giant building
link |
00:25:22.040
and most of the people were involved in this unique stuff.
link |
00:25:24.400
We're in two or three quarters and there was a room.
link |
00:25:27.640
Oh, how big was it?
link |
00:25:29.400
Probably call it 50 feet by 50 feet.
link |
00:25:33.480
Make up a number of that which had some access
link |
00:25:37.320
to computers there as well as in offices
link |
00:25:39.980
and people hung out there and it had a coffee machine.
link |
00:25:42.920
And so it was mostly very physical.
link |
00:25:46.340
We did use email, of course.
link |
00:25:49.440
But it was fundamentally, for a long time,
link |
00:25:52.720
all on one machine.
link |
00:25:54.120
So there was no need for internet.
link |
00:25:56.520
It's fascinating to think about what computing
link |
00:25:58.660
would be today without Bell Labs.
link |
00:26:00.920
It seems so many, the people being in the vicinity
link |
00:26:05.000
of each other, sort of getting that quick feedback,
link |
00:26:08.480
working together, so many brilliant people.
link |
00:26:11.440
I don't know where else that could have existed
link |
00:26:13.200
in the world given how that came together.
link |
00:26:18.000
Yeah, how does that make you feel
link |
00:26:19.720
that little element of history?
link |
00:26:23.200
Well, I think that's very nice,
link |
00:26:24.600
but in a sense it's survivor bias
link |
00:26:26.760
and if it hadn't happened at Bell Labs,
link |
00:26:29.240
there were other places that were doing
link |
00:26:31.000
really interesting work as well.
link |
00:26:32.880
Xerox PARC is perhaps the most obvious one.
link |
00:26:35.040
Xerox PARC contributed an enormous amount
link |
00:26:36.760
of good material and many of the things
link |
00:26:39.120
we take for granted today in the same way
link |
00:26:41.520
came from Xerox PARC experience.
link |
00:26:43.360
I don't think they capitalized in the long run as much.
link |
00:26:46.440
Their parent company was perhaps not as lucky
link |
00:26:49.800
in capitalizing on this, who knows?
link |
00:26:52.800
But that's certainly another place
link |
00:26:55.000
where there was a tremendous amount of influence.
link |
00:26:58.060
There were a lot of good university activities.
link |
00:27:00.240
MIT was obviously no slouch in this kind of thing
link |
00:27:03.720
and others as well.
link |
00:27:07.120
So Unix turned out to be open source
link |
00:27:10.660
because of the various ways that AT&T operated
link |
00:27:13.560
and sort of it had to, the focus was on telephones.
link |
00:27:19.000
I think that's a mischaracterization in a sense.
link |
00:27:21.580
It absolutely was not open source.
link |
00:27:23.840
It was very definitely proprietary, licensed,
link |
00:27:27.840
but it was licensed freely to universities
link |
00:27:30.840
in source code form for many years.
link |
00:27:33.520
And because of that, generations of university students
link |
00:27:37.680
and their faculty people grew up knowing about Unix
link |
00:27:41.760
and there was enough expertise in the community
link |
00:27:44.720
that it then became possible for people
link |
00:27:46.640
to kind of go off in their own direction
link |
00:27:48.120
and build something that looked Unix like.
link |
00:27:51.520
The Berkeley version of Unix started with that licensed code
link |
00:27:56.520
and gradually picked up enough of its own code contributions,
link |
00:28:01.680
notably from people like Bill Joy,
link |
00:28:04.000
that eventually it was able to become completely free
link |
00:28:08.600
of any AT&T code.
link |
00:28:10.480
Now, there was an enormous amount of legal jockeying
link |
00:28:13.120
around this in the late, early to late 80s, early 90s,
link |
00:28:17.400
something like that.
link |
00:28:19.480
And then, I guess the open source movement
link |
00:28:24.480
might've started when Richard Stallman started
link |
00:28:27.600
to think about this in the late 80s.
link |
00:28:29.240
And by 1991, when Torvalds decided he was going
link |
00:28:33.200
to do a Unix like operating system,
link |
00:28:37.040
there was enough expertise in the community
link |
00:28:40.440
that first he had a target, he could see what to do
link |
00:28:44.280
because the kind of the Unix system call interface
link |
00:28:47.480
and the tools and so on were there.
link |
00:28:50.720
And so he was able to build an operating system
link |
00:28:53.440
that at this point, when you say Unix,
link |
00:28:56.160
in many cases, what you're really thinking is Linux.
link |
00:28:58.400
Linux, yeah.
link |
00:28:59.280
But it's funny that from my distant perception,
link |
00:29:02.880
I felt that Unix was open source
link |
00:29:05.720
without actually knowing it.
link |
00:29:07.440
But what you're really saying, it was just freely licensed.
link |
00:29:11.560
It was freely licensed.
link |
00:29:12.960
So it felt open source in a sense
link |
00:29:14.880
because universities are not trying to make money,
link |
00:29:16.960
so it felt open source in a sense
link |
00:29:19.000
that you can get access if you wanted.
link |
00:29:20.520
Right, and a very, very, very large number of universities
link |
00:29:23.640
had the license and they were able to talk
link |
00:29:25.240
to all the other universities who had the license.
link |
00:29:27.360
And so technically not open,
link |
00:29:30.200
technically belonging to AT&T, pragmatically pretty open.
link |
00:29:34.880
And so there's a ripple effect
link |
00:29:36.080
that all the faculty and the students then all grew up
link |
00:29:39.000
and then they went throughout the world
link |
00:29:41.840
and permeated in that kind of way.
link |
00:29:45.420
So what kind of features do you think make
link |
00:29:49.820
for a good operating system?
link |
00:29:52.560
If you take the lessons of Unix,
link |
00:29:54.920
you said make it easy for programmers.
link |
00:29:59.440
That seems to be an important one.
link |
00:30:03.840
But also Unix turned out to be exceptionally robust
link |
00:30:07.000
and efficient.
link |
00:30:08.180
Right.
link |
00:30:09.020
So is that an accident when you focus on the programmer
link |
00:30:12.120
or is that a natural outcome?
link |
00:30:14.760
I think part of the reason for efficiency
link |
00:30:17.560
was that it began on extremely modest hardware,
link |
00:30:21.160
very, very, very tiny.
link |
00:30:22.600
And so you couldn't get carried away.
link |
00:30:24.000
You couldn't do a lot of complicated things
link |
00:30:27.740
because you just didn't have the resources,
link |
00:30:30.000
either processor speed or memory.
link |
00:30:32.400
And so that enforced a certain minimality of mechanisms
link |
00:30:37.800
and maybe a search for generalizations
link |
00:30:40.080
so that you would find one mechanism
link |
00:30:41.840
that served for a lot of different things
link |
00:30:43.520
rather than having lots of different special cases.
link |
00:30:45.900
I think the file system in Unix is a good example
link |
00:30:48.800
of that file system interface in its fundamental form
link |
00:30:51.460
is extremely straightforward.
link |
00:30:53.600
And that means that you can write code
link |
00:30:56.560
very, very effectively for the file system.
link |
00:30:58.920
And then one of those ideas, one of those generalizations
link |
00:31:02.720
is that gee, that file system interface works
link |
00:31:04.840
for all kinds of other things as well.
link |
00:31:06.780
And so in particular, the idea of reading
link |
00:31:09.240
and writing to devices is the same as reading
link |
00:31:11.600
and writing to a disc that has a file system.
link |
00:31:14.480
And then that gets carried further in other parts
link |
00:31:17.880
of the world.
link |
00:31:18.700
Processes become, in effect, files in a file system.
link |
00:31:24.240
And the Plan 9 operating system, which came along,
link |
00:31:26.440
I guess, in the late 80s or something like that,
link |
00:31:29.320
took a lot of those ideas from the original Unix
link |
00:31:31.520
and tried to push the generalization even further
link |
00:31:34.720
so that in Plan 9, a lot of different resources
link |
00:31:37.180
are file systems.
link |
00:31:38.180
They all share that interface.
link |
00:31:40.040
So that would be one example where finding the right model
link |
00:31:44.360
of how to do something means that an awful lot of things
link |
00:31:46.800
become simpler, and it means, therefore,
link |
00:31:48.840
that more people can do useful, interesting things
link |
00:31:51.200
with them without having to think as hard about it.
link |
00:31:54.440
So you said you're not a very good programmer.
link |
00:31:56.960
That's true.
link |
00:31:58.480
You're the most modest human being, okay,
link |
00:32:01.400
but you'll continue saying that.
link |
00:32:03.280
I understand how this works.
link |
00:32:04.420
But you do radiate a sort of love for programming.
link |
00:32:07.760
So let me ask, do you think programming
link |
00:32:10.840
is more an art or a science?
link |
00:32:13.240
Is it creativity or kind of rigor?
link |
00:32:16.640
I think it's some of each.
link |
00:32:18.080
It's some combination.
link |
00:32:20.800
Some of the art is figuring out what it is
link |
00:32:22.680
that you really want to do.
link |
00:32:23.720
What should that program be?
link |
00:32:25.520
What would make a good program?
link |
00:32:27.560
And that's some understanding of what the task is,
link |
00:32:30.640
what the people who might use this program want.
link |
00:32:33.600
And I think that's art in many respects.
link |
00:32:37.760
The science part is trying to figure out how to do it well.
link |
00:32:40.480
And some of that is real computer sciencey stuff,
link |
00:32:45.240
like what algorithm should we use at some point?
link |
00:32:48.080
Mostly in the sense of being careful to use algorithms
link |
00:32:52.320
that will actually work properly, scale properly,
link |
00:32:56.240
avoiding quadratic algorithms
link |
00:32:58.000
when a linear algorithm should be the right thing,
link |
00:33:01.280
that kind of more formal view of it.
link |
00:33:04.080
Same thing for data structures.
link |
00:33:06.380
But also it's, I think, an engineering field as well.
link |
00:33:10.360
And engineering is not quite the same as science
link |
00:33:12.480
because engineering, you're working with constraints.
link |
00:33:15.320
You have to figure out not only what
link |
00:33:19.200
is a good algorithm for this kind of thing,
link |
00:33:21.080
but what's the most appropriate algorithm given
link |
00:33:23.240
the amount of time we have to compute,
link |
00:33:26.200
the amount of time we have to program,
link |
00:33:28.000
what's likely to happen in the future with maintenance,
link |
00:33:30.880
who's going to pick this up in the future, all
link |
00:33:33.280
of those kind of things that if you're an engineer,
link |
00:33:35.840
you get to worry about.
link |
00:33:37.240
Whereas if you think of yourself as a scientist,
link |
00:33:39.160
well, you can maybe push them over the horizon in a way.
link |
00:33:42.080
And if you're an artist, what's that?
link |
00:33:45.360
So just on your own personal level,
link |
00:33:48.600
what's your process like of writing a program?
link |
00:33:50.640
Say, a small and large sort of tinkering with stuff.
link |
00:33:55.840
Do you just start coding right away
link |
00:33:58.000
and just kind of evolve iteratively with a loose notion?
link |
00:34:03.040
Or do you plan on a sheet of paper first
link |
00:34:05.760
and then kind of design in what they teach you
link |
00:34:09.320
in the kind of software engineering courses
link |
00:34:12.040
in undergrad or something like that?
link |
00:34:13.600
What's your process like?
link |
00:34:14.880
It's certainly much more the informal incremental.
link |
00:34:17.480
First, I don't write big programs at this point.
link |
00:34:19.880
It's been a long time since I wrote a program that
link |
00:34:21.880
was more than I call it a few hundred or more lines,
link |
00:34:25.560
something like that.
link |
00:34:26.960
Many of the programs I write are experiments
link |
00:34:29.080
for either something I'm curious about
link |
00:34:31.680
or often for something that I want to talk about in a class.
link |
00:34:34.680
So those necessarily tend to be relatively small.
link |
00:34:38.920
A lot of the kind of code I write these days
link |
00:34:41.400
tends to be for sort of exploratory data analysis
link |
00:34:44.280
where I've got some collection of data
link |
00:34:46.200
and I want to try and figure out what on earth is going on in it.
link |
00:34:49.160
And for that, those programs tend to be very small.
link |
00:34:52.280
Sometimes you're not even programming.
link |
00:34:53.920
You're just using existing tools like counting things.
link |
00:34:57.720
Or sometimes you're writing OX scripts
link |
00:35:00.200
because two or three lines will tell you
link |
00:35:02.360
something about a piece of data.
link |
00:35:03.960
And then when it gets bigger, well, then I
link |
00:35:05.640
will probably write something in Python
link |
00:35:08.800
because that scales better up to call it a few hundred lines
link |
00:35:13.200
or something like that.
link |
00:35:14.240
And it's been a long time since I wrote programs
link |
00:35:16.320
that were much more than that.
link |
00:35:18.600
Speaking of data exploration and OX, first, what is OX?
link |
00:35:23.680
So OX is a scripting language that
link |
00:35:25.680
was done by myself, Al Aho, and Peter Weinberger.
link |
00:35:30.280
We did that originally in the late 70s.
link |
00:35:32.240
It was a language that was meant to make it really easy
link |
00:35:34.800
to do quick and dirty tasks like counting things
link |
00:35:39.360
or selecting interesting information from basically
link |
00:35:43.680
all text files, rearranging it in some way or summarizing it.
link |
00:35:47.640
It runs a command on each line of a file.
link |
00:35:51.480
I mean, it's still exceptionally widely used today.
link |
00:35:55.480
Oh, absolutely.
link |
00:35:56.280
Yeah.
link |
00:35:56.800
It's so simple and elegant, sort of the way to explore data.
link |
00:36:01.480
Turns out you can just write a script that
link |
00:36:03.320
does something seemingly trivial in a single line,
link |
00:36:07.120
and giving you that slice of the data
link |
00:36:09.880
somehow reveals something fundamental about the data.
link |
00:36:13.200
And that seems to work still.
link |
00:36:17.040
Yeah, it's very good for that kind of thing.
link |
00:36:19.640
That's sort of what it was meant for.
link |
00:36:21.200
I think what we didn't appreciate
link |
00:36:22.600
was that the model was actually quite good for a lot of data
link |
00:36:26.240
processing kinds of tasks and that it's
link |
00:36:29.040
kept going as long as it has because at this point,
link |
00:36:31.440
it's over 40 years old, and it's still, I think, a useful tool.
link |
00:36:35.920
And well, this is paternal interest, I guess.
link |
00:36:38.400
But I think in terms of programming languages,
link |
00:36:40.960
you get the most bang for the buck by learning AUC.
link |
00:36:44.240
And it doesn't scale the big programs,
link |
00:36:46.560
but it does pretty darn well on these little things
link |
00:36:49.920
where you just want to see all the somethings in something.
link |
00:36:53.760
So yeah, I probably write more AUC than anything else
link |
00:36:56.960
at this point.
link |
00:36:58.640
So what kind of stuff do you love about AUC?
link |
00:37:01.160
Is there, if you can comment on sort of things
link |
00:37:06.240
that give you joy when you can, in a simple program,
link |
00:37:10.200
reveal something about the data.
link |
00:37:11.560
Is there something that stands out from particular features?
link |
00:37:14.520
I think it's mostly the selection of default behaviors.
link |
00:37:19.440
You sort of hinted at it a moment ago.
link |
00:37:21.080
What AUC does is to read through a set of files,
link |
00:37:24.760
and then within each file, it writes
link |
00:37:26.640
through each of the lines.
link |
00:37:28.400
And then on each of the lines, it has a set of patterns
link |
00:37:31.760
that it looks for.
link |
00:37:33.120
That's your AUC program.
link |
00:37:34.720
And if one of the patterns matches,
link |
00:37:36.920
there is a corresponding action that you might perform.
link |
00:37:40.000
And so it's kind of a quadruply nested loop or something
link |
00:37:43.960
like that.
link |
00:37:45.160
And that's all completely automatic.
link |
00:37:46.620
You don't have to say anything about it.
link |
00:37:48.280
You just write the pattern and the action,
link |
00:37:49.960
and then run the data by it.
link |
00:37:52.120
And so that paradigm for programming
link |
00:37:54.240
is a very natural and effective one.
link |
00:37:56.880
And I think we captured that reasonably well in AUC.
link |
00:38:00.160
And it does other things for free as well.
link |
00:38:01.960
It splits the data into fields so that on each line,
link |
00:38:05.320
there is fields separated by white space or something.
link |
00:38:07.640
And so it does that for free.
link |
00:38:08.840
You don't have to say anything about it.
link |
00:38:11.200
And it collects information as it goes along,
link |
00:38:13.840
like what line are we on?
link |
00:38:15.360
How many fields are there on this line?
link |
00:38:18.040
So lots of things that just make it so that a program which
link |
00:38:21.160
in another language, let's say Python,
link |
00:38:24.080
would be five, 10, 20 lines in AUC is one or two lines.
link |
00:38:28.040
And so because it's one or two lines,
link |
00:38:29.600
you can do it on the shell.
link |
00:38:31.840
You don't have to open up another whole thing.
link |
00:38:33.720
You can just do it right there in the interaction
link |
00:38:35.920
with the operatives directly.
link |
00:38:38.920
Is there other shell commands that you love over the years
link |
00:38:44.880
like you really enjoy using?
link |
00:38:46.320
Oh, grep.
link |
00:38:47.360
Grep?
link |
00:38:47.920
Grep's the only one.
link |
00:38:49.720
Yeah, grep does everything.
link |
00:38:51.440
So grep is a simpler version of AUC, I would say?
link |
00:38:55.360
In some sense, yeah, right.
link |
00:38:58.000
What is grep?
link |
00:38:58.880
So grep basically searches the input
link |
00:39:01.840
for particular patterns, regular expressions,
link |
00:39:04.000
technically, of a certain class.
link |
00:39:06.160
And it has that same paradigm that AUC does.
link |
00:39:08.640
It's a pattern action thing.
link |
00:39:10.080
It reads through all the files and then
link |
00:39:12.080
all the lines in each file.
link |
00:39:13.480
But it has a single pattern, which
link |
00:39:15.200
is the regular expression you're looking for,
link |
00:39:17.040
and a single action printed if it matches.
link |
00:39:20.240
So in that sense, it's a much simpler version.
link |
00:39:22.600
And you could write grep in AUC as a one liner.
link |
00:39:26.800
And I use grep probably more than anything else
link |
00:39:30.440
at this point just because it's so convenient and natural.
link |
00:39:35.000
Why do you think it's such a powerful tool, grep and AUC?
link |
00:39:38.640
Why do you think operating systems like Windows,
link |
00:39:41.280
for example, don't have it?
link |
00:39:45.240
You can, of course, I use, which is amazing now,
link |
00:39:48.240
there's Windows for Linux.
link |
00:39:50.120
So which you could basically use all the fun stuff
link |
00:39:54.880
like AUC and grep inside of Windows.
link |
00:39:57.320
But Windows naturally, as part of the graphical interface,
link |
00:40:00.800
the simplicity of grep, searching
link |
00:40:03.200
through a bunch of files and just popping up naturally.
link |
00:40:06.560
Why do you think that's unique to the Linux environment?
link |
00:40:11.560
I don't know.
link |
00:40:12.400
It's not strictly unique, but it's certainly focused there.
link |
00:40:16.400
And I think some of it's the weight of history
link |
00:40:19.080
that Windows came from MS DOS.
link |
00:40:22.040
MS DOS was a pretty pathetic operating system,
link |
00:40:24.520
although common on an unboundedly large number
link |
00:40:27.760
of machines.
link |
00:40:28.960
But somewhere in roughly the 90s,
link |
00:40:32.840
Windows became a graphical system.
link |
00:40:34.680
And I think Microsoft spent a lot of their energy
link |
00:40:37.960
on making that graphical interface what it is.
link |
00:40:41.600
And that's a different model of computing.
link |
00:40:44.160
It's a model of computing where you point and click
link |
00:40:47.120
and sort of experiment with menus.
link |
00:40:49.480
It's a model of computing works rather well for people
link |
00:40:53.160
who are not programmers and just want to get something done,
link |
00:40:56.080
whereas teaching something like the command line
link |
00:40:59.080
to nonprogrammers turns out to sometimes be
link |
00:41:01.760
an uphill struggle.
link |
00:41:02.720
And so I think Microsoft probably
link |
00:41:04.400
was right in what they did.
link |
00:41:06.240
Now you mentioned Whistle or whatever
link |
00:41:07.920
it's called, the Winix, Linux.
link |
00:41:09.520
Whistle.
link |
00:41:10.040
I wonder what it's pronounced.
link |
00:41:11.480
WSL is what I've never actually pronounced.
link |
00:41:13.120
Whistle, I like it.
link |
00:41:13.920
I have no idea.
link |
00:41:15.880
But there have been things like that for longest.
link |
00:41:17.880
Cygwin, for example, which is a wonderful collection of take
link |
00:41:21.320
all your favorite tools from Unix and Linux
link |
00:41:23.320
and just make them work perfectly on Windows.
link |
00:41:25.440
And so that's something that's been going on
link |
00:41:27.320
for at least 20 years, if not longer.
link |
00:41:29.920
And I use that on my one remaining Windows machine
link |
00:41:34.600
routinely because if you're doing something that
link |
00:41:37.960
is batch computing, suitable for command line,
link |
00:41:41.360
that's the right way to do it.
link |
00:41:42.700
Because the Windows equivalents are, if nothing else,
link |
00:41:45.160
not familiar to me.
link |
00:41:47.760
But I would definitely recommend to people
link |
00:41:50.200
if they don't use Cygwin to try Whistle.
link |
00:41:52.440
Yes.
link |
00:41:54.240
I've been so excited that I could write scripts quickly
link |
00:41:59.600
in Windows.
link |
00:42:00.560
It's changed my life.
link |
00:42:03.160
OK, what's your perfect programming setup?
link |
00:42:06.400
What computer, what operating system, what keyboard,
link |
00:42:09.080
what editor?
link |
00:42:10.440
Yeah, perfect is too strong a word.
link |
00:42:13.320
It's way too strong a word.
link |
00:42:15.280
What I use by default, I have, at this point,
link |
00:42:18.880
a 13 inch MacBook Air, which I use
link |
00:42:22.000
because it's kind of a reasonable balance
link |
00:42:24.240
of the various things I need.
link |
00:42:25.400
I can carry it around.
link |
00:42:26.600
It's got enough computing, horsepower, screen's
link |
00:42:28.400
big enough, keyboard's OK.
link |
00:42:31.080
And so I basically do most of my computing on that.
link |
00:42:34.640
I have a big iMac in my office that I use from time to time
link |
00:42:38.840
as well, especially when I need a big screen,
link |
00:42:41.020
but otherwise, it tends not to be used that much.
link |
00:42:47.080
Editor.
link |
00:42:48.320
I use mostly SAM, which is an editor that Rob Pike wrote
link |
00:42:52.600
long ago at Bell Labs.
link |
00:42:56.080
Sorry to interrupt.
link |
00:42:56.960
Does that precede VI?
link |
00:42:58.680
Does that precede iMac?
link |
00:43:00.040
It post dates both VI and iMacs.
link |
00:43:04.000
It is derived from Rob's experience with ED and VI.
link |
00:43:11.120
What's ED?
link |
00:43:12.760
That's the original Unix editor.
link |
00:43:14.600
Oh, wow.
link |
00:43:16.520
Dated probably before you were born.
link |
00:43:19.600
So actually, what's the history of editors?
link |
00:43:23.480
Can you briefly, because it's such a fact.
link |
00:43:26.680
I use Emacs, I'm sorry to say.
link |
00:43:28.840
Sorry to come out with that.
link |
00:43:30.280
But what's the kind of interplay there?
link |
00:43:33.640
So in ancient times, call it the first time sharing systems,
link |
00:43:39.280
going back to what we were talking about.
link |
00:43:41.800
There was an editor on CTSS that I don't even
link |
00:43:44.560
remember what it was called.
link |
00:43:45.760
It might have been edit, where you could type text, program
link |
00:43:50.280
text, and it would do something, or document text.
link |
00:43:53.760
You could save the text.
link |
00:43:54.960
And save it.
link |
00:43:55.560
You could edit it.
link |
00:43:57.240
The usual thing that you would get in an editor.
link |
00:44:00.200
And Ken Thompson wrote an editor called QED, which
link |
00:44:04.080
was very, very powerful.
link |
00:44:05.960
But these were all totally A, command based.
link |
00:44:08.680
They were not mouse or cursor based,
link |
00:44:10.760
because it was before mice and even before cursors,
link |
00:44:13.720
because they were running on terminals that printed on paper.
link |
00:44:17.000
No CRT type displays, let alone LEDs.
link |
00:44:21.280
And so then when Unix came along, Ken took QED
link |
00:44:26.080
and stripped it way, way, way, way down.
link |
00:44:28.680
And that became an editor that he called ED.
link |
00:44:30.960
And it was very simple.
link |
00:44:31.960
But it was a line oriented editor.
link |
00:44:33.800
And so you could load a file.
link |
00:44:36.080
And then you could talk about the lines one
link |
00:44:38.120
through the last line.
link |
00:44:39.240
And you could print ranges of lines.
link |
00:44:41.600
You could add text.
link |
00:44:43.080
You could delete text.
link |
00:44:44.000
You could change text.
link |
00:44:44.880
Or you could do a substitute command
link |
00:44:46.440
that would change things within a line or within groups
link |
00:44:48.800
of lines.
link |
00:44:49.280
So you can work on parts of a file, essentially.
link |
00:44:51.320
Yeah.
link |
00:44:51.480
You can work on any part of it, the whole thing or whatever.
link |
00:44:54.000
But it was entirely command line based.
link |
00:44:57.320
And it was entirely on paper.
link |
00:45:00.800
Paper.
link |
00:45:01.560
And that meant that you changed it.
link |
00:45:02.960
Yeah, right.
link |
00:45:03.480
Real paper.
link |
00:45:04.080
And so if you changed a line, you
link |
00:45:06.240
had to print that line using up another line of paper
link |
00:45:09.120
to see what the change caused.
link |
00:45:12.920
So when CRT displays came along, then you
link |
00:45:18.320
could start to use cursor control.
link |
00:45:19.760
And you could sort of move where you were on the screen.
link |
00:45:24.200
Without reprinting every time.
link |
00:45:26.080
Without reprinting.
link |
00:45:27.000
And there were a number of editors there.
link |
00:45:29.880
The one that I was most familiar with and still use
link |
00:45:32.720
is VI, which was done by Bill Choi.
link |
00:45:35.160
And so that dates from probably the late 70s, as I guess.
link |
00:45:40.760
And it took full advantage of the cursor controls.
link |
00:45:45.200
I suspect that Emacs was roughly at the same time.
link |
00:45:48.360
But I don't know.
link |
00:45:49.040
I've never internalized Emacs.
link |
00:45:51.760
So at this point, I stopped using ED, although I still can.
link |
00:45:56.320
I use VI sometimes, and I use SAM when I can.
link |
00:46:00.120
And SAM is available on most systems?
link |
00:46:02.480
It is available.
link |
00:46:04.320
You have to download it yourself from, typically,
link |
00:46:06.360
the Plan 9 operating system distribution.
link |
00:46:08.520
It's been maintained by people there.
link |
00:46:11.800
And so I'll get home tonight.
link |
00:46:13.600
I'll try it.
link |
00:46:14.280
It's cool.
link |
00:46:14.800
It sounds fascinating.
link |
00:46:17.800
Although my love is with Lisp and Emacs,
link |
00:46:20.600
I've went into that hippie world of.
link |
00:46:25.120
I think it's a lot of things.
link |
00:46:26.280
Religion, where you're brought up with.
link |
00:46:27.760
Yeah, that's true.
link |
00:46:28.760
That's true.
link |
00:46:29.280
Most of the actual programming I do is C, C++, and Python.
link |
00:46:34.080
But my weird sort of, yeah, my religious upbringing is in Lisp.
link |
00:46:38.160
So can you take on the impossible task
link |
00:46:41.840
and give a brief history of programming languages
link |
00:46:44.760
from your perspective?
link |
00:46:46.440
So I guess you could say programming languages started
link |
00:46:48.800
probably in, what, the late 40s or something like that.
link |
00:46:52.000
People used to program computers by basically putting
link |
00:46:55.200
in zeros and ones.
link |
00:46:56.240
Using something like switches on a console.
link |
00:46:59.760
And then, or maybe holes in paper tapes.
link |
00:47:03.560
Something like that.
link |
00:47:04.920
So extremely tedious, awful, whatever.
link |
00:47:08.040
And so I think the first programming languages
link |
00:47:10.280
were relatively crude assembly languages,
link |
00:47:14.560
where people would basically write
link |
00:47:17.840
a program that would convert mnemonics like add ADD
link |
00:47:22.360
into whatever the bit pattern was
link |
00:47:24.920
that corresponded to an ADD instruction.
link |
00:47:26.800
And they would do the clerical work of figuring out
link |
00:47:28.960
where things were.
link |
00:47:30.080
So you could put a name on a location in a program,
link |
00:47:32.840
and the assembler would figure out
link |
00:47:34.920
where that corresponded to when the thing was all put together
link |
00:47:37.920
and dropped into memory.
link |
00:47:40.760
And early on, and this would be the late 40s and very early
link |
00:47:46.280
50s, there were assemblers written for the various machines
link |
00:47:50.040
that people used.
link |
00:47:51.040
You may have seen in the paper just a couple of days ago,
link |
00:47:53.460
Tony Berker died.
link |
00:47:54.240
He did this thing in Manchester called AutoCode, a language
link |
00:47:58.720
which I knew only by name.
link |
00:48:01.000
But it sounds like it was a flavor of assembly language,
link |
00:48:04.400
sort of a little higher in some ways.
link |
00:48:06.680
And it replaced a language that Alan Turing wrote,
link |
00:48:09.040
which you put in zeros and ones.
link |
00:48:10.840
But you put it in backwards order,
link |
00:48:12.480
because that was a hardware word.
link |
00:48:14.400
Very strange.
link |
00:48:14.920
That's right.
link |
00:48:15.480
Yeah, yeah, that's right.
link |
00:48:16.520
Backwards.
link |
00:48:17.880
So assembly languages, let's call that the early 1950s.
link |
00:48:22.320
And so every different flavor of computer
link |
00:48:24.280
has its own assembly language.
link |
00:48:25.800
So the EDSAC had its, and the Manchester had its,
link |
00:48:28.920
and the IBM whatever, 790 or 704, or whatever had its,
link |
00:48:33.640
and so on.
link |
00:48:34.240
So everybody had their own assembly language.
link |
00:48:36.080
And assembly languages have a few commands, additions,
link |
00:48:38.760
subtraction, then branching of some kind,
link |
00:48:41.160
if then type of situation.
link |
00:48:42.920
Right, they have exactly, in their simplest form at least,
link |
00:48:46.720
one instruction per, or one assembly language instruction
link |
00:48:50.000
per instruction in the machine's repertoire.
link |
00:48:52.880
And so you have to know the machine intimately
link |
00:48:54.920
to be able to write programs in it.
link |
00:48:56.760
And if you write an assembly language program
link |
00:48:58.640
for one kind of machine, and then you say,
link |
00:49:00.440
gee, it's nice, I'd like a different machine, start over.
link |
00:49:03.920
OK, so very bad.
link |
00:49:06.160
And so what happened in the late 50s
link |
00:49:08.680
was people realized you could play this game again,
link |
00:49:10.960
and you could move up a level in writing or creating languages
link |
00:49:15.480
that were closer to the way that real people might think
link |
00:49:18.000
about how to write code.
link |
00:49:20.680
And there were, I guess, arguably three or four
link |
00:49:24.080
at that time period.
link |
00:49:25.600
There was FORTRAN, which came from IBM,
link |
00:49:28.080
which was formula translation, meant
link |
00:49:29.960
to make it easy to do scientific and engineering
link |
00:49:32.240
computations.
link |
00:49:32.840
I didn't know that, formula translation, that's wow.
link |
00:49:34.920
That's what I stood for.
link |
00:49:35.680
There was COBOL, which is the Common Business Oriented
link |
00:49:37.880
Language that Grace Hopper and others worked on,
link |
00:49:40.920
which was aimed at business kinds of tasks.
link |
00:49:44.200
There was ALGOL, which was mostly
link |
00:49:45.680
meant to describe algorithmic computations.
link |
00:49:49.280
I guess you could argue BASIC was in there somewhere.
link |
00:49:51.440
I think it's just a little later.
link |
00:49:54.400
And so all of those moved the level up,
link |
00:49:56.360
and so they were closer to what you and I might think of
link |
00:49:59.920
as we were trying to write a program.
link |
00:50:02.520
And they were focused on different domains, FORTRAN
link |
00:50:06.400
for formula translation, engineering computations,
link |
00:50:09.160
let's say COBOL for business, that kind of thing.
link |
00:50:11.640
And still used today, at least FORTRAN probably.
link |
00:50:14.520
Oh, yeah, COBOL, too.
link |
00:50:16.760
But the deal was that once you moved up that level,
link |
00:50:19.440
then you, let's call it FORTRAN, you
link |
00:50:21.120
had a language that was not tied to a particular kind
link |
00:50:24.640
of hardware, because a different compiler would compile
link |
00:50:26.840
for a different kind of hardware.
link |
00:50:28.180
And that meant two things.
link |
00:50:30.080
It meant you only had to write the program once, which
link |
00:50:32.360
is very important.
link |
00:50:33.920
And it meant that you could, in fact,
link |
00:50:35.960
if you were a random engineer, physicist, whatever,
link |
00:50:38.240
you could write that program yourself.
link |
00:50:39.800
You didn't have to hire a programmer to do it for you.
link |
00:50:42.240
It might not be as good as you'd get with a real programmer,
link |
00:50:44.500
but it was pretty good.
link |
00:50:45.840
And so it democratized and made much more broadly available
link |
00:50:49.640
the ability to write code.
link |
00:50:51.440
So it puts the power of programming
link |
00:50:53.080
into the hands of people like you.
link |
00:50:54.600
Yeah, anybody who is willing to invest some time in learning
link |
00:50:58.480
a programming language and is not then tied
link |
00:51:00.720
to a particular kind of computer.
link |
00:51:03.520
And then in the 70s, you get system programming languages,
link |
00:51:06.280
of which C is the survivor.
link |
00:51:08.480
And what does system programming language mean?
link |
00:51:11.840
Programs that, programming languages
link |
00:51:14.920
that would take on the kinds of things
link |
00:51:16.560
that were necessary to write so called system programs.
link |
00:51:19.360
Things like text editors, or assemblers, or compilers,
link |
00:51:22.720
or operating systems themselves.
link |
00:51:24.920
Those kinds of things.
link |
00:51:26.600
And Fortran.
link |
00:51:28.000
They have to be feature rich.
link |
00:51:29.160
They have to be able to do a lot of stuff.
link |
00:51:30.960
A lot of memory management, access processes,
link |
00:51:33.640
and all that kind of stuff.
link |
00:51:35.600
It's a different flavor of what they're doing.
link |
00:51:37.560
They're much more in touch with the actual machine,
link |
00:51:41.200
but in a positive way.
link |
00:51:42.360
That is, you can talk about memory in a more controlled
link |
00:51:44.760
way.
link |
00:51:45.880
You can talk about the different data types
link |
00:51:48.000
that the machine supports, and more ways
link |
00:51:52.760
to structure and organize data.
link |
00:51:54.840
And so the system programming languages,
link |
00:51:57.360
there was a lot of effort in that in the,
link |
00:51:59.720
call it the late 60s, early 70s.
link |
00:52:02.120
C is, I think, the only real survivor of that.
link |
00:52:06.240
And then what happens after that?
link |
00:52:09.000
You get things like object oriented programming languages.
link |
00:52:12.080
Because as you write programs in a language like C,
link |
00:52:14.880
at some point scale gets to you.
link |
00:52:16.520
And it's too hard to keep track of the pieces.
link |
00:52:18.440
And there's no guardrails, or training wheels,
link |
00:52:21.040
or something like that to prevent you
link |
00:52:22.480
from doing bad things.
link |
00:52:24.320
So C++ comes out of that tradition.
link |
00:52:28.200
And then it took off from there.
link |
00:52:29.560
I mean, there's also a parallel, slightly parallel track
link |
00:52:32.160
with a little bit of functional stuff with Lisp and so on.
link |
00:52:35.080
But I guess from that point, it's
link |
00:52:37.080
just an explosion of languages.
link |
00:52:38.920
There's the Java story.
link |
00:52:40.040
There's the JavaScript.
link |
00:52:41.880
There's all the stuff that the cool kids these days
link |
00:52:44.960
are doing with Rust and all that.
link |
00:52:48.320
So what's to you?
link |
00:52:50.120
You wrote a book, C Programming Language.
link |
00:52:53.080
And C is probably one of the most important languages
link |
00:52:56.920
in the history of programming languages,
link |
00:52:58.840
if you kind of look at impact.
link |
00:53:01.080
What do you think is the most elegant or powerful part of C?
link |
00:53:06.240
Why did it survive?
link |
00:53:07.560
Why did it have such a long lasting impact?
link |
00:53:11.280
I think it found a sweet spot of expressiveness,
link |
00:53:16.280
so that you could rewrite things in a pretty natural way,
link |
00:53:19.080
and efficiency, which was particularly important when
link |
00:53:22.400
computers were not nearly as powerful as they are today.
link |
00:53:25.160
You've got to put yourself back 50 years,
link |
00:53:28.880
almost, in terms of what computers could do.
link |
00:53:31.240
And that's roughly four or five generations,
link |
00:53:35.000
decades of Moore's law, right?
link |
00:53:37.520
So expressiveness and efficiency and, I don't know,
link |
00:53:42.960
perhaps the environment that it came with as well,
link |
00:53:45.040
which was Unix.
link |
00:53:46.360
So it meant if you wrote a program,
link |
00:53:47.920
it could be used on all those computers that ran Unix.
link |
00:53:50.520
And that was all of those computers,
link |
00:53:51.960
because they were all written in C.
link |
00:53:53.440
And that was Unix, the operating system itself,
link |
00:53:56.560
was portable, as were all the tools.
link |
00:53:58.640
So it all worked together, again,
link |
00:54:00.720
in one of these things where things
link |
00:54:02.720
fit on each other in a positive cycle.
link |
00:54:05.920
What did it take to write sort of a definitive book,
link |
00:54:10.000
probably definitive book on all of program,
link |
00:54:11.960
like it's more definitive to a particular language
link |
00:54:14.480
than any other book on any other language,
link |
00:54:16.640
and did two really powerful things,
link |
00:54:19.000
which is popularized the language,
link |
00:54:22.720
at least from my perspective, maybe you can correct me.
link |
00:54:24.880
And second is created a standard of how, you know,
link |
00:54:29.880
how this language is supposed to be used and applied.
link |
00:54:33.640
So what did it take?
link |
00:54:34.960
Did you have those kinds of ambitions in mind
link |
00:54:37.400
when working on that?
link |
00:54:38.240
Is this some kind of joke?
link |
00:54:39.640
No, of course not.
link |
00:54:42.840
So it's an accident of timing, skill, and just luck?
link |
00:54:48.440
A lot of it is, clearly.
link |
00:54:50.360
Timing was good.
link |
00:54:51.520
Now, Dennis and I wrote the book in 1977.
link |
00:54:54.040
Dennis Ritchie.
link |
00:54:54.880
Yeah, right.
link |
00:54:56.440
And at that point, Unix was starting to spread.
link |
00:54:58.920
I don't know how many there were,
link |
00:55:00.040
but it would be dozens to hundreds of Unix systems.
link |
00:55:03.320
And C was also available on other kinds of computers
link |
00:55:06.680
that had nothing to do with Unix.
link |
00:55:08.320
And so the language had some potential.
link |
00:55:13.520
And there were no other books on C,
link |
00:55:17.720
and Bell Labs was really the only source for it.
link |
00:55:20.360
And Dennis, of course, was authoritative
link |
00:55:22.560
because it was his language.
link |
00:55:23.920
And he had written the reference manual,
link |
00:55:26.800
which is a marvelous example
link |
00:55:28.040
of how to write a reference manual.
link |
00:55:29.480
Really, really very, very well done.
link |
00:55:31.480
So I twisted his arm until he agreed to write a book,
link |
00:55:34.240
and then we wrote a book.
link |
00:55:35.440
And the virtue or advantage, at least,
link |
00:55:38.560
I guess, of going first is that then other people
link |
00:55:40.840
have to follow you if they're gonna do anything.
link |
00:55:44.880
And I think it worked well because Dennis
link |
00:55:49.240
was a superb writer.
link |
00:55:50.400
I mean, he really, really did.
link |
00:55:51.600
And the reference manual in that book is his, period.
link |
00:55:55.080
I had nothing to do with that at all.
link |
00:55:58.760
So just crystal clear prose and very, very well expressed.
link |
00:56:02.720
And then he and I, I wrote most of the expository material.
link |
00:56:07.720
And then he and I sort of did the usual ping ponging
link |
00:56:10.320
back and forth, refining it.
link |
00:56:13.400
But I spent a lot of time trying to find examples
link |
00:56:15.600
that would sort of hang together
link |
00:56:16.840
and that would tell people what they might need
link |
00:56:18.680
to know at about the right time
link |
00:56:20.200
that they should be thinking about needing it.
link |
00:56:22.440
And I'm not sure it completely succeeded,
link |
00:56:25.520
but it mostly worked out fairly well.
link |
00:56:28.480
What do you think is the power of example?
link |
00:56:30.120
I mean, you're the creator, at least one of the first people
link |
00:56:35.960
to do the Hello World program, which is like the example.
link |
00:56:40.400
If aliens discover our civilization hundreds of years
link |
00:56:43.760
from now, it'll probably be Hello World programs,
link |
00:56:46.800
just like a half broken robot communicating with them
link |
00:56:49.560
with the Hello World.
link |
00:56:50.760
So what, and that's a representative example.
link |
00:56:53.400
So what do you find powerful about examples?
link |
00:56:57.040
I think a good example will tell you how to do something
link |
00:57:01.520
and it will be representative of,
link |
00:57:03.840
you might not want to do exactly that,
link |
00:57:05.680
but you will want to do something that's at least
link |
00:57:07.560
in that same general vein.
link |
00:57:10.720
And so a lot of the examples in the C book were picked
link |
00:57:14.000
for these very, very simple, straightforward
link |
00:57:16.200
text processing problems that were typical of Unix.
link |
00:57:19.720
I want to read input and write it out again.
link |
00:57:23.560
There's a copy command.
link |
00:57:24.560
I want to read input and do something to it
link |
00:57:27.040
and write it out again.
link |
00:57:27.960
There's a grab.
link |
00:57:28.800
And so that kind of find things that are representative
link |
00:57:33.120
of what people want to do and spell those out
link |
00:57:36.600
so that they can then take those and see the core parts
link |
00:57:42.040
and modify them to their taste.
link |
00:57:45.680
And I think that a lot of programming books that,
link |
00:57:48.760
I don't look at programming books
link |
00:57:51.120
a tremendous amount these days, but when I do,
link |
00:57:52.880
a lot of them don't do that.
link |
00:57:54.440
They don't give you examples that are both realistic
link |
00:57:59.000
and something you might want to do.
link |
00:58:01.840
Some of them are pure syntax.
link |
00:58:03.760
Here's how you add three numbers.
link |
00:58:05.280
Well, come on, I could figure that out.
link |
00:58:07.280
Tell me how I would get those three numbers
link |
00:58:09.160
into the computer and how we would do something useful
link |
00:58:11.880
with them and then how I put them back out again,
link |
00:58:14.280
neatly formatted.
link |
00:58:15.520
And especially if you follow that example,
link |
00:58:17.160
there is something magical of doing something
link |
00:58:19.440
that feels useful.
link |
00:58:21.000
Yeah, right.
link |
00:58:21.840
And I think it's the attempt,
link |
00:58:23.560
and it's absolutely not perfect,
link |
00:58:26.360
but the attempt in all cases was to get something
link |
00:58:28.760
that was going to be either directly useful
link |
00:58:31.520
or would be very representative of useful things
link |
00:58:35.560
that a programmer might want to do.
link |
00:58:37.920
But within that vein of fundamentally text processing,
link |
00:58:41.080
reading text, doing something, writing text.
link |
00:58:43.640
So you've also written a book on Go language.
link |
00:58:47.360
I have to admit, so I worked at Google for a while
link |
00:58:50.920
and I've never used Go.
link |
00:58:53.640
Well, you missed something.
link |
00:58:54.680
Well, I know I missed something for sure.
link |
00:58:56.320
I mean, so Go and Rust are two languages
link |
00:58:59.520
that I hear very, spoken very highly of
link |
00:59:04.000
and I wish I would like to, well, there's a lot of them.
link |
00:59:06.840
There's Julia, there's all these incredible modern languages.
link |
00:59:10.760
But if you can comment before,
link |
00:59:12.680
or maybe comment on what do you find,
link |
00:59:16.280
where does Go sit in this broad spectrum of languages?
link |
00:59:19.640
And also, how do you yourself feel
link |
00:59:22.320
about this wide range of powerful, interesting languages
link |
00:59:26.480
that you may never even get to try to explore
link |
00:59:30.520
because of time?
link |
00:59:31.520
So I think, so Go first comes from that same
link |
00:59:36.520
Bell Labs tradition in part, not exclusively,
link |
00:59:39.240
but two of the three creators, Ken Thompson and Rob Pike.
link |
00:59:42.480
So literally, the people.
link |
00:59:44.040
Yeah, the people.
link |
00:59:45.600
And then with this very, very useful influence
link |
00:59:49.080
from the European school in particular,
link |
00:59:51.880
the Claude Speer influence through Robert Griesemer,
link |
00:59:55.600
who was, I guess, a second generation down student at ETH.
link |
01:00:01.200
And so that's an interesting combination of things.
link |
01:00:03.240
And so some ways, Go captures the good parts of C,
link |
01:00:08.560
it looks sort of like C, it's sometimes characterized as C
link |
01:00:11.400
for the 21st century.
link |
01:00:14.280
On the surface, it looks very, very much like C.
link |
01:00:17.580
But at the same time, it has some interesting
link |
01:00:20.040
data structuring capabilities.
link |
01:00:21.880
And then I think the part that I would say
link |
01:00:25.240
is particularly useful, and again, I'm not a Go expert.
link |
01:00:29.680
In spite of coauthoring the book,
link |
01:00:31.840
about 90% of the work was done by Alan Donovan,
link |
01:00:34.840
my coauthor, who is a Go expert.
link |
01:00:36.920
But Go provides a very nice model of concurrency.
link |
01:00:40.420
It's basically the cooperating,
link |
01:00:42.740
communicating sequential processes that Tony Hoare
link |
01:00:46.460
set forth, jeez, I don't know, 40 plus years ago.
link |
01:00:50.380
And Go routines are, to my mind, a very natural way
link |
01:00:53.980
to talk about parallel computation.
link |
01:00:57.260
And in the few experiments I've done with them,
link |
01:00:59.740
they're easy to write, and typically it's gonna work,
link |
01:01:02.780
and very efficient as well.
link |
01:01:05.180
So I think that's one place where Go stands out,
link |
01:01:07.860
that that model of parallel computation
link |
01:01:10.860
is very, very easy and nice to work with.
link |
01:01:14.100
Just to comment on that, do you think C foresaw,
link |
01:01:17.500
or the early Unix days foresaw threads
link |
01:01:20.740
and massively parallel computation?
link |
01:01:23.940
I would guess not really.
link |
01:01:25.620
I mean, maybe it was seen, but not at the level
link |
01:01:28.300
where it was something you had to do anything about.
link |
01:01:31.340
For a long time, processors got faster,
link |
01:01:35.020
and then processors stopped getting faster
link |
01:01:38.300
because of things like power consumption
link |
01:01:40.820
and heat generation.
link |
01:01:43.100
And so what happened instead was that instead
link |
01:01:46.100
of processors getting faster,
link |
01:01:47.460
there started to be more of them.
link |
01:01:49.500
And that's where that parallel thread stuff comes in.
link |
01:01:53.740
So if you can comment on all the other languages,
link |
01:01:58.020
is it break your heart that you'll never get to explore them?
link |
01:02:01.500
How do you feel about the full variety?
link |
01:02:04.420
It's not break my heart,
link |
01:02:05.700
but I would love to be able to try more of these languages.
link |
01:02:10.020
The closest I've come is in a class
link |
01:02:11.940
that I often teach in the spring here.
link |
01:02:14.060
It's a programming class, and I often give,
link |
01:02:18.580
I have one sort of small example that I will write
link |
01:02:21.980
in as many languages as I possibly can.
link |
01:02:24.380
I've got it in 20 languages.
link |
01:02:26.060
At this point, and that's so I do a minimal experiment
link |
01:02:31.260
with a language just to say, okay,
link |
01:02:33.060
I have this trivial task, which I understand the task,
link |
01:02:35.580
and it takes 15 lines in awk,
link |
01:02:38.500
and not much more in a variety of other languages.
link |
01:02:41.420
So how big is it?
link |
01:02:42.260
How fast does it run?
link |
01:02:43.380
And what pain did I go through to learn how to do it?
link |
01:02:47.980
And that's like anecdotal, right?
link |
01:02:52.420
It's very, very, very, very, very, very, very,
link |
01:02:55.980
very, very narrowly focused.
link |
01:02:57.900
I think data, I like that term.
link |
01:02:59.460
So yeah, but still, it's a little sample,
link |
01:03:01.940
because you get to, I think the hardest step
link |
01:03:04.040
of the programming language is probably the first step,
link |
01:03:06.380
right, so there you're taking the first step.
link |
01:03:08.800
Yeah, and so my experience with some languages
link |
01:03:13.460
is very positive, like Lua,
link |
01:03:14.900
a scripting language I had never used,
link |
01:03:17.580
and I took my little program.
link |
01:03:19.780
The program is a trivial formatter.
link |
01:03:21.700
It just takes in lines of text of varying lengths,
link |
01:03:24.660
and it puts them out in lines
link |
01:03:26.500
that have no more than 60 characters on each line.
link |
01:03:28.940
So think of it as just kind of the flow of process
link |
01:03:31.940
in a browser or something.
link |
01:03:34.500
So it's a very short program.
link |
01:03:36.300
And in Lua, I downloaded Lua,
link |
01:03:39.340
and in an hour, I had it working,
link |
01:03:41.040
never having written Lua in my life,
link |
01:03:43.180
just going with online documentation.
link |
01:03:44.940
I did the same thing in Scala,
link |
01:03:46.180
which you can think of as a flavor of Java, equally trivial.
link |
01:03:51.020
I did it in Haskell.
link |
01:03:52.140
It took me several weeks.
link |
01:03:53.620
But it did run like a turtle.
link |
01:03:57.780
And I did it in Fortran 90, and it was painful,
link |
01:04:05.220
but it worked, and I tried it in Rust,
link |
01:04:07.980
and it took me several days to get it working
link |
01:04:10.200
because the model of memory management
link |
01:04:12.140
was just a little unfamiliar to me.
link |
01:04:13.820
And the problem I had with Rust,
link |
01:04:15.900
and it's back to what we were just talking about,
link |
01:04:18.300
I couldn't find good, consistent documentation on Rust.
link |
01:04:21.500
Now, this was several years ago,
link |
01:04:22.720
and I'm sure things have stabilized,
link |
01:04:24.180
but at the time, everything in the Rust world
link |
01:04:26.500
seemed to be changing rapidly,
link |
01:04:27.900
and so you would find what looked like a working example,
link |
01:04:30.500
and it wouldn't work with the version
link |
01:04:32.220
of the language that I had.
link |
01:04:34.820
So it took longer than it should have.
link |
01:04:37.540
Rust is a language I would like to get back to,
link |
01:04:39.620
but probably won't.
link |
01:04:41.200
I think one of the issues,
link |
01:04:42.060
you have to have something you want to do.
link |
01:04:44.060
If you don't have something that is the right combination,
link |
01:04:47.540
if I want to do it, and yet I have enough disposable time,
link |
01:04:51.980
whatever, to make it worth learning a new language
link |
01:04:55.220
at the same time, it's never gonna happen.
link |
01:04:58.120
So what do you think about another language of JavaScript?
link |
01:05:02.100
That's this...
link |
01:05:04.940
Well, let me just sort of comment on what I said.
link |
01:05:06.860
When I was brought up, sort of JavaScript was seen as
link |
01:05:12.240
probably like the ugliest language possible,
link |
01:05:15.580
and yet it's quite arguably, quite possibly taking over,
link |
01:05:18.980
not just the front end and the back end of the internet,
link |
01:05:21.640
but possibly in the future taking over everything,
link |
01:05:24.020
because they've now learned to make it very efficient.
link |
01:05:27.900
And so what do you think about this?
link |
01:05:29.700
Yeah, well, I think you've captured it in a lot of ways.
link |
01:05:32.140
When it first came out,
link |
01:05:32.980
JavaScript was deemed to be fairly irregular
link |
01:05:35.460
and an ugly language, and certainly in the academy,
link |
01:05:37.780
if you said you were working on JavaScript,
link |
01:05:39.260
people would ridicule you.
link |
01:05:40.460
It was just not fit for academics to work on.
link |
01:05:43.780
I think a lot of that has evolved.
link |
01:05:45.460
The language itself has evolved,
link |
01:05:47.540
and certainly the technology of compiling it
link |
01:05:50.660
is fantastically better than it was.
link |
01:05:53.660
And so in that sense,
link |
01:05:54.780
it's absolutely a viable solution on back ends,
link |
01:05:58.820
as well as the front ends.
link |
01:06:01.140
Used well, I think it's a pretty good language.
link |
01:06:03.480
I've written a modest amount of it,
link |
01:06:06.340
and I've played with JavaScript translators
link |
01:06:09.140
and things like that.
link |
01:06:10.300
I'm not a real expert,
link |
01:06:12.020
and it's hard to keep up even there
link |
01:06:13.660
with the new things that come along with it.
link |
01:06:15.860
So I don't know whether it will ever take over the world.
link |
01:06:19.220
I think not, but it's certainly an important language,
link |
01:06:24.540
and worth knowing more about.
link |
01:06:27.100
There's, maybe to get your comment on something,
link |
01:06:30.260
which JavaScript, and actually most languages,
link |
01:06:33.220
sort of Python, such a big part of the experience
link |
01:06:37.420
of programming with those languages includes libraries,
link |
01:06:40.660
sort of using, building on top of the code
link |
01:06:42.500
that other people have built.
link |
01:06:43.780
I think that's probably different from the experience
link |
01:06:45.980
that we just talked about from Unix and C days,
link |
01:06:49.700
when you're building stuff from scratch.
link |
01:06:51.020
What do you think about this world
link |
01:06:53.020
of essentially leveraging, building up libraries
link |
01:06:55.460
on top of each other and leveraging them?
link |
01:06:57.180
Yeah, no, that's a very perceptive kind of question.
link |
01:07:01.780
One of the reasons programming was fun in the old days
link |
01:07:04.060
was that you were really building it all yourself.
link |
01:07:06.860
The number of libraries you had to deal with
link |
01:07:08.780
was quite small.
link |
01:07:09.620
Maybe it was printf, or the standard library,
link |
01:07:11.980
or something like that, and that is not the case today.
link |
01:07:15.780
And if you want to do something in,
link |
01:07:18.060
you mentioned Python and JavaScript,
link |
01:07:20.460
and those are the two fine examples,
link |
01:07:22.220
you have to typically download a boatload of other stuff,
link |
01:07:25.740
and you have no idea what you're getting,
link |
01:07:27.660
absolutely nothing.
link |
01:07:29.220
I've been doing some playing with machine learning
link |
01:07:31.540
over the last couple of days,
link |
01:07:33.540
and geez, something doesn't work.
link |
01:07:36.420
Well, you pip install this, okay,
link |
01:07:38.900
and down comes another one,
link |
01:07:40.460
okay, and down comes another gazillion megabytes of something
link |
01:07:44.340
and you have no idea what it was.
link |
01:07:46.300
And if you're lucky, it works.
link |
01:07:47.940
And if it doesn't work, you have no recourse.
link |
01:07:51.180
There's absolutely no way you could figure out
link |
01:07:52.740
which of these thousand different packages.
link |
01:07:55.180
And I think it's worse in the NPM environment
link |
01:07:59.540
for JavaScript.
link |
01:08:00.380
I think there's less discipline, less control there.
link |
01:08:02.980
And there's aspects of not just not understanding
link |
01:08:06.100
how it works, but there's security issues,
link |
01:08:07.900
there's robustness issues,
link |
01:08:09.020
so you don't wanna run a nuclear power plant
link |
01:08:11.740
using JavaScript, essentially.
link |
01:08:14.060
Probably not.
link |
01:08:16.100
So speaking to the variety of languages,
link |
01:08:18.820
do you think that variety is good,
link |
01:08:20.420
or do you hope, think that over time,
link |
01:08:23.540
we should converge towards one, two, three
link |
01:08:25.740
programming languages?
link |
01:08:28.140
You mentioned to the Bell Lab days
link |
01:08:29.700
when people could sort of, the community of it,
link |
01:08:32.860
and the more languages you have,
link |
01:08:34.500
the more you separate the communities.
link |
01:08:36.780
There's the Ruby community,
link |
01:08:38.140
there's the Python community,
link |
01:08:40.260
there's C++ community.
link |
01:08:42.660
Do you hope that they'll unite one day
link |
01:08:45.420
to just one or two languages?
link |
01:08:47.700
I certainly don't hope it.
link |
01:08:48.820
I'm not sure that that's right,
link |
01:08:49.940
because I honestly don't think there is one language
link |
01:08:51.940
that will suffice for all the programming needs of the world.
link |
01:08:55.340
Are there too many at this point?
link |
01:08:56.860
Well, arguably.
link |
01:08:58.540
But I think if you look at the sort of the distribution
link |
01:09:01.860
of how they are used,
link |
01:09:03.140
there's something called a dozen languages
link |
01:09:06.740
that probably account for 95% of all programming
link |
01:09:10.500
at this point, and that doesn't seem unreasonable.
link |
01:09:13.580
And then there's another, well, 2,000 languages
link |
01:09:17.220
that are still in use that nobody uses,
link |
01:09:19.940
and, or at least don't use in any quantity.
link |
01:09:23.300
But I think new languages are a good idea in many respects,
link |
01:09:25.940
because they're often a chance to explore an idea
link |
01:09:30.260
of how language might help.
link |
01:09:32.940
I think that's one of the positive things
link |
01:09:35.220
about functional languages, for example.
link |
01:09:36.940
They're a particularly good place
link |
01:09:38.660
where people have explored ideas
link |
01:09:42.500
that at the time didn't seem feasible,
link |
01:09:45.700
but ultimately have wound up
link |
01:09:47.500
as part of mainstream languages as well.
link |
01:09:50.140
I mean, just go back as early as Recursion Lisp
link |
01:09:52.700
and then follow forward functions as first class citizens
link |
01:09:57.100
and pattern based languages,
link |
01:09:59.300
and gee, I don't know, closures,
link |
01:10:02.260
and just on and on and on.
link |
01:10:04.220
Lambda's interesting ideas that showed up first
link |
01:10:07.020
in, let's call it broadly,
link |
01:10:08.860
the functional programming community,
link |
01:10:10.700
and then find their way into mainstream languages.
link |
01:10:13.340
Yeah, it's a playground for rebels.
link |
01:10:15.620
Yeah, exactly, and so I think the languages
link |
01:10:19.620
in the playground themselves are probably not going
link |
01:10:22.680
to be the mainstream, at least for some while,
link |
01:10:25.900
but the ideas that come from there are invaluable.
link |
01:10:29.940
So let's go to something that, when I found out recently,
link |
01:10:33.860
so I've known that you've done a million things,
link |
01:10:36.220
but one of the things I wasn't aware of,
link |
01:10:37.740
that you had a role in Ample,
link |
01:10:39.700
and before you interrupt me by minimizing your role in it.
link |
01:10:44.940
Ample is for minimizing functions.
link |
01:10:46.500
Yeah, minimizing functions, right, exactly.
link |
01:10:51.020
Can I just say that the elegance and abstraction power
link |
01:10:53.580
of Ample is incredible,
link |
01:10:57.380
when I first came to it about 10 years ago or so.
link |
01:11:01.360
Can you describe what is the Ample language?
link |
01:11:04.260
Sure, so Ample is a language for mathematical programming,
link |
01:11:08.180
technical term, think of it as linear programming,
link |
01:11:10.760
that is setting up systems of linear equations
link |
01:11:14.740
that are of some sort of system of constraints,
link |
01:11:18.820
so that you have a bunch of things
link |
01:11:20.580
that have to be less than this, greater than that,
link |
01:11:22.580
whatever, and you're trying to find a set of values
link |
01:11:25.640
for some decision variables that will maximize
link |
01:11:29.580
or minimize some objective function,
link |
01:11:32.220
so it's a way of solving a particular kind
link |
01:11:35.900
of optimization problem,
link |
01:11:38.000
a very formal sort of optimization problem,
link |
01:11:40.020
but one that's exceptionally useful.
link |
01:11:42.540
And it specifies, so there's objective function constraints
link |
01:11:45.820
and variables that become separate
link |
01:11:48.180
from the data it operates on.
link |
01:11:50.060
Right.
link |
01:11:50.900
So that kind of separation allows you to,
link |
01:11:56.860
put on different hats,
link |
01:11:58.020
one put the hat of an optimization person
link |
01:12:00.380
and then put another hat of a data person
link |
01:12:03.260
and dance back and forth,
link |
01:12:04.940
and also separate the actual solvers,
link |
01:12:08.820
the optimization systems that do the solving.
link |
01:12:11.980
Then you can have other people come to the table
link |
01:12:14.220
and then build their solvers,
link |
01:12:15.500
whether it's linear or nonlinear,
link |
01:12:19.480
convex, nonconvex, that kind of stuff.
link |
01:12:21.800
So what is the,
link |
01:12:25.740
to you as, maybe you can comment
link |
01:12:28.780
how you got into that world
link |
01:12:30.180
and what is the beautiful or interesting idea to you
link |
01:12:33.800
from the world of optimization?
link |
01:12:35.420
Sure.
link |
01:12:36.260
So I preface it by saying I'm absolutely not an expert
link |
01:12:39.820
on this and most of the important work in AMPL
link |
01:12:42.980
comes from my two partners in crime on that,
link |
01:12:45.360
Bob Forer, who was a professor
link |
01:12:48.740
in the Industrial Engineering
link |
01:12:50.020
and Management Science Department at Northwestern,
link |
01:12:52.500
and my colleague at Bell Labs, Dave Gay,
link |
01:12:54.820
who was a numerical analyst and optimization person.
link |
01:12:59.020
So the deal is linear programming.
link |
01:13:02.420
Preface this by saying I don't.
link |
01:13:03.860
Let's stay with linear programming.
link |
01:13:05.180
Yeah, linear programming is the simplest example of this.
link |
01:13:07.620
So linear programming, as it's taught in school,
link |
01:13:09.740
is that you have a big matrix,
link |
01:13:11.220
which is always called A,
link |
01:13:12.260
and you say AX is less than or equal to B.
link |
01:13:14.940
So B is a set of constraints,
link |
01:13:16.380
X is the decision variables,
link |
01:13:18.580
and A is how the decision variables are combined
link |
01:13:22.980
to set up the various constraints.
link |
01:13:24.500
So A is a matrix and X and B are vectors.
link |
01:13:28.180
And then there's an objective function,
link |
01:13:30.020
which is just a sum of a bunch of Xs
link |
01:13:32.000
and some coefficients on them,
link |
01:13:33.620
and that's the thing you want to optimize.
link |
01:13:37.160
The problem is that in the real world,
link |
01:13:40.020
that matrix A is a very, very, very intricate,
link |
01:13:43.460
very large and very sparse matrix
link |
01:13:45.560
where the various components of the model
link |
01:13:47.860
are distributed among the coefficients
link |
01:13:50.600
in a way that is totally unobvious to anybody.
link |
01:13:54.880
And so what you need is some way
link |
01:13:57.580
to express the original model,
link |
01:13:59.860
which you and I would write,
link |
01:14:01.100
you know, we'd write mathematics on the board,
link |
01:14:03.300
and the sum of this is greater
link |
01:14:04.580
than the sum of that kind of thing.
link |
01:14:06.460
So you need a language to write those kinds of constraints.
link |
01:14:10.300
And Bob Forer, for a long time,
link |
01:14:12.340
had been interested in modeling languages,
link |
01:14:14.420
languages that made it possible to do this.
link |
01:14:16.540
There was a modeling language around called GAMS,
link |
01:14:19.060
the General Algebraic Modeling System,
link |
01:14:21.300
but it looked very much like Fortran.
link |
01:14:22.940
It was kind of clunky.
link |
01:14:24.700
And so Bob spent a sabbatical year at Bell Labs in 1984,
link |
01:14:29.220
and he and, there's only the office across from me,
link |
01:14:32.820
and it's always geography,
link |
01:14:35.420
and he and Dave Gay and I started talking
link |
01:14:38.080
about this kind of thing,
link |
01:14:39.700
and he wanted to design a language that would make it
link |
01:14:43.780
so that you could take these algebraic specifications,
link |
01:14:46.520
you know, summation signs over sets,
link |
01:14:48.820
and that you would write on the board
link |
01:14:51.100
and convert them into basically this A matrix,
link |
01:14:55.820
and then pass that off to a solver,
link |
01:14:58.900
which is an entirely separate thing.
link |
01:15:01.620
And so we talked about the design of the language.
link |
01:15:05.140
I don't remember any of the details of this now,
link |
01:15:07.200
but it's kind of an obvious thing.
link |
01:15:08.940
You're just writing out mathematical expressions
link |
01:15:11.220
in a Fortran like, sorry,
link |
01:15:13.140
an algebraic but textual like language.
link |
01:15:15.820
And I wrote the first version of this Ample program,
link |
01:15:22.580
my first C++ program, and.
link |
01:15:26.180
It's written in C++?
link |
01:15:27.420
Yeah.
link |
01:15:28.620
And so I did that fairly quickly.
link |
01:15:30.980
We wrote, it was, you know, 3,000 lines or something,
link |
01:15:33.500
so it wasn't very big,
link |
01:15:34.340
but it sort of showed the feasibility of it
link |
01:15:36.520
that you could actually do something that was easy
link |
01:15:38.380
for people to specify models
link |
01:15:41.740
and convert it into something that a solver could work with.
link |
01:15:44.700
At the same time, as you say,
link |
01:15:45.860
the model and the data are separate things.
link |
01:15:47.900
So one model would then work with all kinds
link |
01:15:50.580
of different data in the same way
link |
01:15:51.780
that lots of programs do the same thing,
link |
01:15:53.500
but with different data.
link |
01:15:54.420
So one of the really nice things
link |
01:15:55.660
is the specification of the models,
link |
01:15:58.460
human, just kind of like, as you say, is human readable.
link |
01:16:01.980
Like I literally, I remember on stuff I worked,
link |
01:16:04.900
I would send it to colleagues
link |
01:16:07.620
that I'm pretty sure never programmed in their life,
link |
01:16:10.780
just to understand what the optimization problem is.
link |
01:16:15.780
I think, how hard is it to convert that?
link |
01:16:18.060
You said there's a first prototype in C++
link |
01:16:20.300
to convert that into something
link |
01:16:22.060
that could actually be used by the solver.
link |
01:16:24.300
It's not too bad,
link |
01:16:25.140
because most of the solvers have some mechanism
link |
01:16:27.460
that lets them import a model in a form.
link |
01:16:30.460
It might be as simple as the matrix itself
link |
01:16:32.980
in just some representation,
link |
01:16:35.040
or if you're doing things that are not linear programming,
link |
01:16:38.420
then there may be some mechanism
link |
01:16:39.820
that lets you provide things like functions to be called,
link |
01:16:43.420
or other constraints on the model.
link |
01:16:47.140
So all AMPL does is to generate that kind of thing,
link |
01:16:51.500
and then solver deals with all the hard work,
link |
01:16:54.220
and then when the solver comes back with numbers,
link |
01:16:57.380
AMPL converts those back into your original form,
link |
01:17:00.220
so you know how much of each thing you should be buying,
link |
01:17:03.140
or making, or shipping, or whatever.
link |
01:17:05.120
So we did that in 84, and I haven't had a lot to do
link |
01:17:11.160
with it since, except that we wrote a couple of versions
link |
01:17:13.560
of a book on it.
link |
01:17:14.400
Which is one of the greatest books ever written.
link |
01:17:16.520
I love that book.
link |
01:17:18.600
I don't know why.
link |
01:17:19.960
It's an excellent book.
link |
01:17:20.980
Bob Farrer wrote most of it,
link |
01:17:22.520
and so it's really, really well done.
link |
01:17:23.980
He must have been a dynamite teacher.
link |
01:17:25.640
And typeset in LaTeX.
link |
01:17:27.520
No, no, no, are you kidding?
link |
01:17:29.040
I remember liking the typography, so I don't know.
link |
01:17:32.920
We did it with DROF.
link |
01:17:34.480
I don't even know what that is.
link |
01:17:35.440
Yeah, exactly.
link |
01:17:36.280
You're too young.
link |
01:17:37.120
Uh oh, oh boy.
link |
01:17:38.360
I think of DROF as a predecessor
link |
01:17:42.160
to the tech family of things.
link |
01:17:44.240
It's a formatter that was done at Bell Labs
link |
01:17:46.160
in this same period of the very early 70s
link |
01:17:49.720
that predates tech and things like that
link |
01:17:52.440
by five to 10 years.
link |
01:17:54.920
But it was nevertheless, I'm going by memories.
link |
01:17:58.200
I remember it being beautiful.
link |
01:18:00.080
Yeah, it was nicely done.
link |
01:18:01.800
Outside of Unix, C, A, Golang,
link |
01:18:03.840
all the things we talked about.
link |
01:18:05.760
All the amazing work you've done.
link |
01:18:07.920
You've also done work in graph theory.
link |
01:18:12.500
Let me ask this crazy out there question.
link |
01:18:16.480
If you had to make a bet,
link |
01:18:17.640
and I had to force you to make a bet,
link |
01:18:19.200
do you think P equals NP?
link |
01:18:23.520
The answer is no,
link |
01:18:24.360
although I'm told that somebody asked Jeff Dean
link |
01:18:27.160
if that was, under what conditions P would equal NP,
link |
01:18:30.080
and he said either P is zero or N is one.
link |
01:18:33.840
Or vice versa, I've forgotten.
link |
01:18:35.640
This is why Jeff Dean is a lot smarter than I am.
link |
01:18:38.040
Yeah.
link |
01:18:40.040
So, but your intuition is, uh.
link |
01:18:42.440
I have no, I have no intuition,
link |
01:18:44.880
but I've got a lot of colleagues who've got intuition
link |
01:18:46.840
and their betting is no.
link |
01:18:48.160
That's the popular, that's the popular bet.
link |
01:18:51.200
Okay, so what is computational complexity theory?
link |
01:18:55.640
And do you think these kinds of complexity classes,
link |
01:18:58.280
especially as you've taught in this modern world,
link |
01:19:01.560
are still a useful way to understand
link |
01:19:04.240
the hardness of problems?
link |
01:19:06.080
I don't do that stuff.
link |
01:19:07.400
The last time I touched anything to do with that
link |
01:19:09.360
was before. Many, many years ago.
link |
01:19:10.320
Was before it was invented.
link |
01:19:12.400
Because I, it's literally true.
link |
01:19:14.680
I did my PhD thesis on graph.
link |
01:19:17.720
Before Big O notation.
link |
01:19:18.920
Oh, absolutely.
link |
01:19:19.760
Before, I did this in 1968,
link |
01:19:24.060
and I worked on graph partitioning,
link |
01:19:25.940
which is this question.
link |
01:19:26.780
You've got a graph that is a nodes and edges kind of graph,
link |
01:19:30.280
and the edges have weights,
link |
01:19:31.640
and you just want to divide the nodes into two piles
link |
01:19:34.400
of equal size so that the number of edges
link |
01:19:36.780
that goes from one side to the other
link |
01:19:38.040
is as small as possible.
link |
01:19:40.320
And we.
link |
01:19:41.560
You developed, so that problem is hard.
link |
01:19:45.880
Well, as it turns out,
link |
01:19:47.240
I worked with Shen Lin at Bell Labs on this,
link |
01:19:49.880
and we were never able to come up with anything
link |
01:19:52.640
that was guaranteed to give the right answer.
link |
01:19:54.200
We came up with heuristics that worked pretty darn well,
link |
01:19:57.920
and I peeled off some special cases for my thesis,
link |
01:20:01.060
but it was just hard.
link |
01:20:02.240
And that was just about the time that Steve Cook
link |
01:20:04.680
was showing that there were classes of problems
link |
01:20:06.500
that appeared to be really hard,
link |
01:20:08.120
of which graph partitioning was one.
link |
01:20:10.720
But this, my expertise, such as it was,
link |
01:20:13.760
totally predates that development.
link |
01:20:16.500
Oh, interesting.
link |
01:20:17.340
So the heuristic, which now,
link |
01:20:20.060
carries the two of yours names
link |
01:20:21.960
for the traveling salesman problem,
link |
01:20:23.720
and then for the graph partitioning.
link |
01:20:25.280
That was, like, how did you,
link |
01:20:27.460
you weren't even thinking in terms of classes.
link |
01:20:29.320
You were just trying to find.
link |
01:20:30.160
There was no such idea.
link |
01:20:31.120
A heuristic that kinda does the job pretty well.
link |
01:20:34.440
You were trying to find something that did the job,
link |
01:20:36.820
and there was nothing that you would call,
link |
01:20:38.680
let's say, a closed form or algorithmic thing
link |
01:20:41.760
that would give you a guaranteed right answer.
link |
01:20:44.320
I mean, compare graph partitioning to max flow min cut,
link |
01:20:48.320
or something like that.
link |
01:20:50.180
That's the same problem,
link |
01:20:51.400
except there's no constraint on the number of nodes
link |
01:20:53.920
on one side or the other of the cut.
link |
01:20:56.280
And that means it's an easy problem,
link |
01:20:58.720
at least as I understand it.
link |
01:21:00.000
Whereas the constraint that says
link |
01:21:01.480
the two have to be constrained in size
link |
01:21:03.480
makes it a hard problem.
link |
01:21:05.520
Yeah, so Robert Frost says that poem
link |
01:21:07.600
where you had to choose two paths.
link |
01:21:09.280
So why did you,
link |
01:21:12.200
is there another alternate universe
link |
01:21:13.600
in which you pursued the Don Knuth path
link |
01:21:16.600
of algorithm design, sort of?
link |
01:21:19.860
Not smart enough.
link |
01:21:21.480
Not smart enough.
link |
01:21:25.480
You're infinitely modest,
link |
01:21:27.320
but so you pursued your kind of love of programming.
link |
01:21:31.480
I mean, when you look back to those,
link |
01:21:33.640
I mean, just looking into that world,
link |
01:21:35.320
does that just seem like a distant world
link |
01:21:37.840
of theoretical computer science?
link |
01:21:40.360
Then is it fundamentally different
link |
01:21:42.080
from the world of programming?
link |
01:21:44.680
I don't know.
link |
01:21:45.520
I mean, certainly, in all seriousness,
link |
01:21:47.680
I just didn't have the talent for it.
link |
01:21:49.480
When I got here as a grad student to Princeton
link |
01:21:51.840
and I started to think about research
link |
01:21:53.520
at the end of my, I don't know,
link |
01:21:55.040
first year or something like that,
link |
01:21:56.480
I worked briefly with John Hopcroft,
link |
01:21:59.040
who is absolutely, you know,
link |
01:22:00.920
you mentioned during award winner, et cetera,
link |
01:22:02.640
a great guy, and it became crystal clear
link |
01:22:05.440
I was not cut out for this stuff, period, okay.
link |
01:22:09.280
And so I moved into things
link |
01:22:11.520
where I was more cut out for it,
link |
01:22:13.600
and that tended to be things like writing programs
link |
01:22:16.840
and then ultimately writing books.
link |
01:22:20.600
You said that in Toronto as an undergrad,
link |
01:22:22.920
you did a senior thesis or a literature survey
link |
01:22:26.360
on artificial intelligence.
link |
01:22:28.720
This was 1964.
link |
01:22:30.480
Correct.
link |
01:22:32.160
What was the AI landscape, ideas, dreams at that time?
link |
01:22:37.080
I think that was one of the,
link |
01:22:39.080
well, you've heard of AI winners.
link |
01:22:40.400
This is whatever the opposite was,
link |
01:22:41.800
AI summer or something.
link |
01:22:43.640
It was one of these things where people thought
link |
01:22:46.000
that, boy, we could do anything with computers,
link |
01:22:49.280
that all these hard problems, we could,
link |
01:22:51.520
computers will solve them.
link |
01:22:52.720
They will do machine translation.
link |
01:22:54.400
They will play games like chess.
link |
01:22:57.880
They will do, you know, prove theorems in geometry.
link |
01:23:02.160
There are all kinds of examples like that
link |
01:23:04.160
where people thought, boy,
link |
01:23:06.560
we could really do those sorts of things.
link |
01:23:09.880
And, you know, I read The Kool Aid in some sense.
link |
01:23:14.880
There's a wonderful collection of papers
link |
01:23:16.920
called Computers and Thought that was published
link |
01:23:18.760
in about that era and people were very optimistic.
link |
01:23:22.520
And then of course it turned out that
link |
01:23:24.240
what people thought was just a few years down the pike
link |
01:23:28.920
was more than a few years down the pike.
link |
01:23:31.320
And some parts of that are more or less now
link |
01:23:34.600
sort of under control.
link |
01:23:36.400
We finally do play games like Go and chess
link |
01:23:38.960
and so on better than people do,
link |
01:23:41.160
but there are others and machine translation
link |
01:23:43.600
is a lot better than it used to be,
link |
01:23:45.120
but that's, you know, 50, close to 60 years of progress
link |
01:23:49.720
and a lot of evolution in hardware
link |
01:23:51.360
and a tremendous amount more data up on which
link |
01:23:53.360
you can build systems that actually can learn
link |
01:23:57.480
from some of that data.
link |
01:23:58.960
And the infrastructure to support developers
link |
01:24:02.600
working together, like an open source movement,
link |
01:24:05.640
the internet, period, is also empowering.
link |
01:24:08.760
But what lessons do you draw from that,
link |
01:24:11.720
the opposite of winter, that optimism?
link |
01:24:14.760
Well, I guess the lesson is that in the short run
link |
01:24:19.680
it's pretty easy to be too pessimistic
link |
01:24:23.520
or maybe too optimistic and in the long run
link |
01:24:25.520
you probably shouldn't be too pessimistic.
link |
01:24:27.200
I'm not saying that very well.
link |
01:24:28.600
It reminds me of this remark from Arthur Clarke,
link |
01:24:32.600
a science fiction author, who says, you know,
link |
01:24:34.680
when some distinguished but elderly person
link |
01:24:36.560
says that something is possible, he's probably right.
link |
01:24:41.200
And if he says it's impossible, he's almost surely wrong.
link |
01:24:44.320
But you don't know what the time scale is.
link |
01:24:45.760
The time scale is critical, right.
link |
01:24:48.320
So what are your thoughts on this new summer of AI
link |
01:24:52.520
now in the work with machine learning and neural networks?
link |
01:24:55.360
You've kind of mentioned that you started to try to explore
link |
01:24:57.880
and look into this world that seems fundamentally different
link |
01:25:01.400
from the world of heuristics and algorithms like search,
link |
01:25:06.200
that it's now purely sort of trying to take
link |
01:25:08.960
huge amounts of data and learn from that data, right,
link |
01:25:12.480
programs from the data.
link |
01:25:14.040
Yeah, look, I think it's very interesting.
link |
01:25:17.000
I am incredibly far from an expert.
link |
01:25:19.800
Most of what I know I've learned from my students
link |
01:25:21.520
and they're probably disappointed
link |
01:25:24.520
in how little I've learned from them.
link |
01:25:26.360
But I think it has tremendous potential
link |
01:25:29.200
for certain kinds of things.
link |
01:25:30.560
I mean, games is one where it obviously has had an effect
link |
01:25:34.640
on some of the others as well.
link |
01:25:36.000
I think there's, and this is speaking from
link |
01:25:39.520
definitely not expertise,
link |
01:25:40.680
I think there are serious problems
link |
01:25:42.360
in certain kinds of machine learning at least
link |
01:25:45.480
because what they're learning from
link |
01:25:47.520
is the data that we give them.
link |
01:25:49.200
And if the data we give them has something wrong with it,
link |
01:25:52.080
then what they learn from it is probably wrong too.
link |
01:25:54.920
And the obvious thing is some kind of bias in the data.
link |
01:25:59.120
That the data has stuff in it like, I don't know,
link |
01:26:02.360
women aren't as good as men at something, okay.
link |
01:26:05.440
That's just flat wrong.
link |
01:26:07.360
But if it's in the data because of historical treatment,
link |
01:26:11.480
then that machine learning stuff will propagate that.
link |
01:26:15.000
And that is a serious worry.
link |
01:26:18.120
The positive part of that is what machine learning does
link |
01:26:22.680
is reveal the bias in the data
link |
01:26:24.680
and puts a mirror to our own society.
link |
01:26:27.040
And in so doing helps us remove the bias,
link |
01:26:30.920
you know, helps us work on ourselves.
link |
01:26:33.880
Puts a mirror to ourselves.
link |
01:26:35.720
Yeah, that's an optimistic point of view.
link |
01:26:37.440
And if it works that way, that would be absolutely great.
link |
01:26:40.000
And what I don't know is whether it does work that way
link |
01:26:42.560
or whether the AI mechanisms
link |
01:26:46.440
or machine learning mechanisms reinforce
link |
01:26:49.400
and amplify things that have been wrong in the past.
link |
01:26:52.640
And I don't know, but I think that's a serious thing
link |
01:26:56.000
that we have to be concerned about.
link |
01:26:58.760
Let me ask you an out there question, okay.
link |
01:27:01.200
I know nobody knows, but what do you think it takes
link |
01:27:03.920
to build a system of human level intelligence?
link |
01:27:07.400
That's been the dream from the 60s.
link |
01:27:09.880
We talk about games, about language,
link |
01:27:12.000
about image recognition, but really the dream
link |
01:27:16.360
is to create human level or superhuman level intelligence.
link |
01:27:19.600
What do you think it takes to do that?
link |
01:27:21.240
And are we close?
link |
01:27:23.080
I haven't a clue and I don't know, roughly speaking.
link |
01:27:26.200
I mean, this was Turing.
link |
01:27:27.040
I was trying to trick you into a hypothesis.
link |
01:27:30.040
Yeah, I mean, Turing talked about this
link |
01:27:31.520
in his paper on machine intelligence back in, geez,
link |
01:27:34.960
I don't know, early 50s or something like that.
link |
01:27:36.840
And he had the idea of the Turing test.
link |
01:27:38.320
And I don't know what the Turing test is.
link |
01:27:41.000
It's a good test of intelligence.
link |
01:27:41.960
I don't know.
link |
01:27:42.800
It's an interesting test.
link |
01:27:43.640
At least it's in some vague sense objective,
link |
01:27:45.800
whether you can read anything into the conclusions
link |
01:27:48.480
is a different story.
link |
01:27:50.440
Do you have worries, concerns, excitement
link |
01:27:55.160
about the future of artificial intelligence?
link |
01:27:57.000
So there's a lot of people who are worried
link |
01:27:58.920
and you can speak broadly
link |
01:28:00.320
than just artificial intelligence.
link |
01:28:01.720
It's basically computing taking over the world
link |
01:28:05.320
in various forms.
link |
01:28:06.760
Are you excited by this future,
link |
01:28:09.240
this possibility of computing being everywhere
link |
01:28:12.320
or are you worried?
link |
01:28:14.640
It's some combination of those.
link |
01:28:16.440
I think almost all technologies over the long run
link |
01:28:21.200
are for good, but there's plenty of examples
link |
01:28:24.600
where they haven't been good either over a long run
link |
01:28:27.840
for some people or over a short run.
link |
01:28:30.520
And computing is one of those.
link |
01:28:33.220
And AI within it is gonna be one of those as well,
link |
01:28:36.800
but computing broadly.
link |
01:28:37.880
I mean, for just a today example is privacy,
link |
01:28:41.600
that the use of things like social media and so on
link |
01:28:46.440
means that, and the commercial surveillance
link |
01:28:49.140
means that there's an enormous amount more known about us
link |
01:28:52.480
by people, other businesses, government, whatever,
link |
01:28:56.920
than perhaps one ought to feel comfortable with.
link |
01:28:59.560
So that's an example.
link |
01:29:04.280
So that's an example of a possible negative effect
link |
01:29:07.600
of computing being everywhere.
link |
01:29:09.700
It's an interesting one
link |
01:29:11.160
because it could also be a positive, if leveraged correctly.
link |
01:29:16.160
There's a big if there.
link |
01:29:18.160
So I have a deep interest in human psychology
link |
01:29:22.980
and humans seem to be very paranoid about this data thing
link |
01:29:27.360
that varies depending on age group.
link |
01:29:31.360
It seems like the younger folks.
link |
01:29:32.920
So it's exciting to me to see what society looks like
link |
01:29:35.940
50 years from now, that the concerns about privacy
link |
01:29:39.280
might be flipped on their head
link |
01:29:40.640
based purely on human psychology
link |
01:29:42.680
versus actual concerns or not.
link |
01:29:47.400
What do you think about Moore's Law?
link |
01:29:49.560
Well, you said a lot of stuff we've talked,
link |
01:29:52.040
you talked about programming languages in their design,
link |
01:29:55.760
in their ideas that come from the constraints
link |
01:29:58.760
in the systems they operate in.
link |
01:30:00.480
Do you think Moore's Law,
link |
01:30:04.360
the exponential improvement of systems
link |
01:30:07.160
will continue indefinitely?
link |
01:30:08.840
There's a mix of opinions on that currently,
link |
01:30:12.400
or do you think there'll be a plateau?
link |
01:30:19.260
Well, the frivolous answer is no exponential
link |
01:30:21.600
it can go on forever.
link |
01:30:24.080
You run out of something.
link |
01:30:26.120
Just as we said, timescale matters.
link |
01:30:27.760
So if it goes on long enough, that might be all we need.
link |
01:30:30.880
Yeah, right, won't matter to us.
link |
01:30:33.320
So I don't know, we've seen places
link |
01:30:34.680
where Moore's Law has changed.
link |
01:30:35.960
For example, mentioned earlier,
link |
01:30:37.480
processors don't get faster anymore,
link |
01:30:41.320
but you use that same growth of the ability
link |
01:30:46.120
to put more things in a given area
link |
01:30:48.080
to grow them horizontally instead of vertically as it were
link |
01:30:51.120
so you can get more and more processors
link |
01:30:52.960
or memory or whatever on the same chip.
link |
01:30:55.640
Is that gonna run into a limitation?
link |
01:30:57.440
Presumably, because at some point
link |
01:31:00.680
you get down to the individual atoms.
link |
01:31:03.160
And so you gotta find some way around that.
link |
01:31:05.600
Will we find some way around that?
link |
01:31:07.840
I don't know, I just said that if I say it won't,
link |
01:31:10.040
I'll be wrong, so perhaps we will.
link |
01:31:12.600
So I just talked to Jim Keller and he says,
link |
01:31:15.080
so he actually describes, he argues
link |
01:31:16.920
that the Moore's Law will continue for a long, long time
link |
01:31:19.580
because you mentioned the atom.
link |
01:31:21.840
We actually have, I think, a thousand fold increase,
link |
01:31:25.200
still decreased in size, still possible
link |
01:31:30.000
before we get to the quantum level.
link |
01:31:32.120
So there's still a lot of possibilities.
link |
01:31:34.760
He thinks he'll continue indefinitely,
link |
01:31:36.460
which is an interesting optimistic viewpoint.
link |
01:31:40.720
But how do you think the programming languages
link |
01:31:43.480
will change with this increase?
link |
01:31:45.440
Whether we hit a wall or not,
link |
01:31:47.680
what do you think, do you think there'll be
link |
01:31:50.400
a fundamental change in the way
link |
01:31:51.840
programming languages are designed?
link |
01:31:54.500
I don't know about that.
link |
01:31:55.400
I think what will happen is continuation
link |
01:31:58.600
of what we see in some areas, at least,
link |
01:32:02.040
which is that more programming will be done
link |
01:32:05.500
by programs than by people, and that more will be done
link |
01:32:11.000
by sort of declarative rather than procedural mechanisms
link |
01:32:14.960
where I'll say, I want this to happen.
link |
01:32:17.360
You figure out how.
link |
01:32:19.820
And that is, in many cases, at this point,
link |
01:32:24.240
domain of specialized languages for narrow domains,
link |
01:32:28.680
but you can imagine that broadening out.
link |
01:32:31.840
And so I don't have to say so much, in so much detail,
link |
01:32:35.660
some collection of software, let's call it languages
link |
01:32:39.360
or programs or something, will figure out
link |
01:32:42.400
how to do what I want to do.
link |
01:32:44.840
Interesting, so increased levels of abstraction.
link |
01:32:47.200
Yeah.
link |
01:32:48.920
And one day getting to the human level,
link |
01:32:51.040
where we can just use natural language.
link |
01:32:52.680
Could be possible.
link |
01:32:54.600
So you taught, so teach a course,
link |
01:32:56.800
Computers in Our World, here at Princeton,
link |
01:32:59.760
that introduces computing and programming to nonmajors.
link |
01:33:03.880
What, just from that experience,
link |
01:33:06.800
what advice do you have for people
link |
01:33:08.560
who don't know anything about programming
link |
01:33:10.600
but are kind of curious about this world,
link |
01:33:12.960
or programming seems to become more and more
link |
01:33:14.800
of a fundamental skill that people need to be
link |
01:33:17.360
at least aware of?
link |
01:33:18.440
Yeah, well, I couldn't recommend a good book.
link |
01:33:20.400
What's that?
link |
01:33:22.040
The book I wrote for the course.
link |
01:33:24.400
I think this is one of these questions of,
link |
01:33:26.840
should everybody know how to program?
link |
01:33:28.520
And I think the answer is probably not,
link |
01:33:31.300
but I think everybody should at least understand
link |
01:33:33.000
sort of what it is, so that if you say to somebody,
link |
01:33:35.700
I'm a programmer, they have a notion of what that might be,
link |
01:33:38.140
or if you say this is a program,
link |
01:33:40.160
or this was decided by a computer running a program,
link |
01:33:43.600
that they have some vague intuitive understanding
link |
01:33:47.600
and accurate understanding of what that might imply.
link |
01:33:52.600
So part of what I'm doing in this course,
link |
01:33:55.180
which is very definitely for nontechnical people,
link |
01:33:57.480
and a typical person in it is a history or English major,
link |
01:34:01.200
try and explain how computers work,
link |
01:34:03.680
how they do their thing, what programming is,
link |
01:34:06.320
how you write a program,
link |
01:34:08.880
and how computers talk to each other,
link |
01:34:11.400
and what do they do when they're talking to each other.
link |
01:34:14.320
And then I would say nobody, very rarely,
link |
01:34:19.400
and does anybody in that course go on
link |
01:34:21.920
to become a real serious programmer,
link |
01:34:24.200
but at least they've got a somewhat better idea
link |
01:34:27.160
of what all this stuff is about, not just the programming,
link |
01:34:29.600
but the technology behind computers and communications.
link |
01:34:32.640
Do they try and write a program themselves?
link |
01:34:35.720
Oh yeah, yeah, a very small amount.
link |
01:34:38.360
I introduced them to how machines work at a level below,
link |
01:34:42.200
high level languages, so we have kind of a toy machine
link |
01:34:45.240
that has a very small repertoire, a dozen instructions,
link |
01:34:47.800
and they write trivial assembly language programs for that.
link |
01:34:51.240
Wow, that's interesting.
link |
01:34:52.440
So can you just, if you were to give a flavor
link |
01:34:55.080
to people of the programming world,
link |
01:34:57.680
of the competing world,
link |
01:34:59.480
what are the examples they should go with?
link |
01:35:01.920
So a little bit of assembly to get a sense
link |
01:35:04.320
at the lowest level of what the program is really doing.
link |
01:35:08.800
Yeah, I mean, in some sense,
link |
01:35:10.720
there's no such thing as the lowest level
link |
01:35:12.480
because you can keep going down,
link |
01:35:13.600
but that's the place where I drew the line.
link |
01:35:15.560
So the idea that computers have a fairly small repertoire
link |
01:35:19.360
of very simple instructions that they can do,
link |
01:35:21.760
like add and subtract and branch and so on,
link |
01:35:25.000
as you mentioned earlier,
link |
01:35:27.560
and that you can write code at that level
link |
01:35:31.520
and it will get things done,
link |
01:35:33.240
and then you have the levels of abstraction
link |
01:35:35.520
that we get with higher level languages,
link |
01:35:37.800
like Fortran or C or whatever,
link |
01:35:39.880
and that makes it easier to write the code
link |
01:35:42.320
and less dependent on particular architectures.
link |
01:35:45.960
And then we talk about a lot of the different kinds
link |
01:35:48.040
of programs that they use all the time
link |
01:35:50.640
that they don't probably realize are programs,
link |
01:35:52.760
like they're running Mac OS on their computers
link |
01:35:57.640
or maybe Windows, and they're downloading apps
link |
01:36:00.240
on their phones, and all of those things are programs
link |
01:36:03.000
that are just what we just talked about,
link |
01:36:05.960
except at a grand scale.
link |
01:36:08.160
And it's easy to forget that they're actual programs
link |
01:36:10.520
that people program.
link |
01:36:11.840
There's engineers that wrote those things.
link |
01:36:14.080
Yeah, right.
link |
01:36:14.920
And so in a way, I'm expecting them
link |
01:36:18.920
to make an enormous conceptual leap
link |
01:36:20.600
from their five or 10 line toy assembly language thing
link |
01:36:24.560
that adds two or three numbers to something
link |
01:36:28.280
that is a browser on their phone or whatever,
link |
01:36:31.040
but it's really the same thing.
link |
01:36:34.520
So if you look in broad strokes at history,
link |
01:36:38.320
what do you think the world,
link |
01:36:39.720
how do you think the world changed because of computers?
link |
01:36:42.840
It's hard to sometimes see the big picture
link |
01:36:45.200
when you're in it, but I guess I'm asking
link |
01:36:48.040
if there's something you've noticed over the years
link |
01:36:51.520
that, like you were mentioning,
link |
01:36:54.560
the students are more distracted looking at their,
link |
01:36:56.820
now there's a device to look at.
link |
01:36:58.520
Right.
link |
01:36:59.360
I think computing has changed a tremendous amount,
link |
01:37:01.600
obviously, but I think one aspect of that
link |
01:37:03.800
is the way that people interact with each other,
link |
01:37:06.480
both locally and far away.
link |
01:37:08.880
And when I was the age of those kids,
link |
01:37:12.240
making a phone call to somewhere was a big deal
link |
01:37:15.120
because it costs serious money.
link |
01:37:17.280
And this was in the 60s, right?
link |
01:37:20.520
And today people don't make phone calls,
link |
01:37:22.920
they send texts or something like that.
link |
01:37:25.720
So there's an up and down in what people do.
link |
01:37:29.520
People think nothing of having correspondence,
link |
01:37:34.120
regular meetings, video, whatever,
link |
01:37:36.560
with friends or family or whatever
link |
01:37:38.680
in any other part of the world,
link |
01:37:40.400
and they don't think about that at all.
link |
01:37:43.100
And so that's just the communication aspect of it.
link |
01:37:49.120
Do you think that brings us closer together
link |
01:37:51.000
or does it make us,
link |
01:37:53.760
does it take us away from the closeness
link |
01:37:57.900
of human to human contact?
link |
01:37:59.140
I think it depends a lot on all kinds of things.
link |
01:38:02.820
So I trade mail with my brother and sister in Canada
link |
01:38:05.820
much more often than I used to talk to them on the phone.
link |
01:38:08.820
So probably every two or three days,
link |
01:38:10.700
I get something or send something to them.
link |
01:38:14.380
Whereas 20 years ago,
link |
01:38:16.940
I probably wouldn't have talked to them
link |
01:38:19.260
on the phone nearly as much.
link |
01:38:20.600
So in that sense, that's brought my brother and sister
link |
01:38:23.060
and I closer together.
link |
01:38:24.020
That's a good thing.
link |
01:38:25.860
I watch the kids on campus
link |
01:38:28.660
and they're mostly walking around with their heads down,
link |
01:38:30.980
fooling with their phones
link |
01:38:32.260
to the point where I have to duck them.
link |
01:38:34.900
I don't know that that has brought them closer together
link |
01:38:39.460
in some ways.
link |
01:38:40.500
There's sociological research that says people are,
link |
01:38:43.740
in fact, not as close together as they used to be.
link |
01:38:46.220
I don't know where that's really true,
link |
01:38:47.620
but I can see potential downsides
link |
01:38:50.780
and kids where you think,
link |
01:38:53.220
come on, wake up and smell the coffee or whatever.
link |
01:38:56.780
That's right.
link |
01:38:57.620
But if you look at, again, nobody can predict the future,
link |
01:39:00.380
but are you excited?
link |
01:39:02.620
Kind of touched this a little bit with AI,
link |
01:39:04.780
but are you excited by the future in the next 10, 20 years
link |
01:39:08.740
that computing will bring?
link |
01:39:11.540
You were there when there was no computers really.
link |
01:39:15.700
And now computers are everywhere all over the world
link |
01:39:19.420
and Africa and Asia and just every person,
link |
01:39:23.060
almost every person in the world has a device.
link |
01:39:25.580
So are you hopeful, optimistic about that future?
link |
01:39:30.740
It's mixed, if the truth be told.
link |
01:39:32.420
I mean, I think there are some things about that
link |
01:39:34.140
that are good.
link |
01:39:34.980
I think there's the potential for people
link |
01:39:36.740
to improve their lives all over the place
link |
01:39:39.140
and that's obviously good.
link |
01:39:40.940
And at the same time, at least in the short run,
link |
01:39:44.260
you can see lots and lots of bad
link |
01:39:45.900
as people become more tribalistic or parochial
link |
01:39:49.420
in their interests and it's an enormous amount
link |
01:39:51.780
more us than them and people are using computers
link |
01:39:54.820
in all kinds of ways to mislead or misrepresent
link |
01:39:58.060
or flat out lie about what's going on
link |
01:39:59.900
and that is affecting politics locally
link |
01:40:02.300
and I think everywhere in the world.
link |
01:40:05.580
Yeah, the long term effect on political systems
link |
01:40:08.900
and so on is who knows.
link |
01:40:10.860
Who knows indeed.
link |
01:40:11.860
The people now have a voice which is a powerful thing.
link |
01:40:18.620
People who are oppressed have a voice
link |
01:40:21.020
but also everybody has a voice
link |
01:40:24.060
and the chaos that emerges from that
link |
01:40:25.580
is fascinating to watch.
link |
01:40:26.820
Yeah, yeah, it's kind of scary.
link |
01:40:30.260
If you can go back and relive a moment in your life,
link |
01:40:33.700
one that made you truly happy outside of family
link |
01:40:37.520
or was profoundly transformative,
link |
01:40:40.060
is there a moment or moments that jump out at you
link |
01:40:44.340
from memory?
link |
01:40:46.140
I don't think specific moments.
link |
01:40:48.040
I think there were lots and lots and lots of good times
link |
01:40:50.340
at Bell Labs where you would build something
link |
01:40:52.500
and it worked.
link |
01:40:55.820
Did you say it worked?
link |
01:40:56.740
So the moment it worked.
link |
01:40:57.940
Yeah, and somebody used it and they said,
link |
01:41:00.300
gee, that's neat.
link |
01:41:01.260
Those kinds of things happened quite often
link |
01:41:04.640
in that sort of golden era in the 70s when Unix was young
link |
01:41:09.260
and there was all this low hanging fruit
link |
01:41:11.420
and interesting things to work on
link |
01:41:13.420
and a group of people who kind of,
link |
01:41:16.140
we were all together in this and if you did something,
link |
01:41:18.900
they would try it out for you.
link |
01:41:20.580
And I think that was in some sense,
link |
01:41:22.820
a really, really good time.
link |
01:41:24.500
And AUK was, was AUK an example of that?
link |
01:41:27.460
That when you built it and people used it?
link |
01:41:29.400
Yeah, absolutely.
link |
01:41:30.420
And now millions of people use it.
link |
01:41:32.700
And all your stupid mistakes are right there
link |
01:41:34.540
for them to look at, right?
link |
01:41:36.500
So it's mixed.
link |
01:41:37.460
Yeah, it's terrifying, vulnerable
link |
01:41:39.140
but it's beautiful because it does have a positive impact
link |
01:41:42.020
on so, so many people.
link |
01:41:43.840
So I think there's no better way to end it.
link |
01:41:47.220
Brian, thank you so much for talking to us, it was an honor.
link |
01:41:49.420
Okay, my pleasure.
link |
01:41:51.260
Good fun.
link |
01:41:52.080
Thank you for listening to this conversation
link |
01:41:55.340
with Brian Kernighan and thank you to our sponsors,
link |
01:41:58.500
8 Sleep Mattress and Raycon Earbuds.
link |
01:42:02.380
Please consider supporting this podcast
link |
01:42:05.100
by going to 8sleep.com slash Lex and to buyraycon.com
link |
01:42:10.820
slash Lex, click the links, buy the stuff.
link |
01:42:14.520
These both are amazing products.
link |
01:42:16.760
It really is the best way to support this podcast
link |
01:42:19.300
and the journey I'm on.
link |
01:42:21.140
It's how they know I sent you and increases the chance
link |
01:42:24.700
that they'll actually support this podcast in the future.
link |
01:42:27.660
If you enjoy this thing, subscribe on YouTube,
link |
01:42:30.260
review it with 5 Stars and Apple Podcast,
link |
01:42:32.620
support it on Patreon or connect with me on Twitter
link |
01:42:35.940
at Lex Friedman, spelled somehow miraculously
link |
01:42:40.060
without the letter E, just F R I D M A N
link |
01:42:44.100
because when we immigrated to this country,
link |
01:42:46.600
we were not so good at spelling.
link |
01:42:49.020
And now let me leave you with some words
link |
01:42:51.340
from Brian Kernighan, don't comment bad code, rewrite it.
link |
01:42:56.200
Thank you for listening and hope to see you next time.