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 Kernigan, a professor of computer science at Princeton University.
link |
00:00:07.500
He was a key figure in the computer science community in the early Unix days alongside Unix creators Ken Thompson and Dennis Ritchie.
link |
00:00:16.200
He coauthored the C programming language with Dennis Ritchie, the creator of C,
link |
00:00:21.400
and has written a lot of books on programming, computers, and life,
link |
00:00:26.300
including the practice of programming, the goal programming language, and his latest Unix history and a memoir.
link |
00:00:34.000
He co created AUK, the text processing language used by Linux folks like myself.
link |
00:00:39.500
He co designed Ample, an algebraic modeling language that I personally love and have used a lot in my life for large scale optimization.
link |
00:00:49.500
I think I can keep going for a long time with this creations and accomplishments,
link |
00:00:54.200
which is funny because given all that, he's one of the most humble and kind people I've spoken to on this podcast.
link |
00:01:01.700
Quick summary of the ads, two new sponsors, the amazing self cooling 8 sleep mattress and Raycon earbuds.
link |
00:01:13.200
Please consider supporting the podcast by going to 8sleep.com slash lex and going to buy a raycon.com slash lex.
link |
00:01:23.000
Click the links by the stuff.
link |
00:01:25.100
It really is the best way to support this podcast and the journey I'm on.
link |
00:01:29.600
If you enjoy this thing, subscribe on YouTube, review it with 5,000 Apple podcasts,
link |
00:01:34.200
support it on Patreon, or connect with me on Twitter at Lex Freedman.
link |
00:01:39.600
As usual, I'll do a few minutes of ads now and never any ads in the middle that can break the flow of the conversation.
link |
00:01:45.800
This show is sponsored by 8sleep and it's incredible pod pro mattress that you can check out at 8sleep.com slash lex to get $200 off.
link |
00:01:57.300
The mattress controls temperature with an app and can cool down to as low as 55 degrees.
link |
00:02:03.700
Research shows the temperature has a big impact on the quality of our sleep and it totally has been a game changer for me.
link |
00:02:11.200
I love it.
link |
00:02:12.200
The pod pro is packed with sensors that track heart rate, heart rate variability and respiratory rate showing it all on their app once you wake up.
link |
00:02:21.400
Plus, if you have a partner, you can control the temperature of each side of the bed.
link |
00:02:26.500
I don't happen to have one, but the 8sleep app reminds me that I should probably get on that.
link |
00:02:32.000
So ladies, if a temperature controlled mattress isn't a good reason to apply, I don't know what is.
link |
00:02:38.800
The app's health metrics are amazing, but the cooling alone is honestly worth the money.
link |
00:02:44.300
As some of you know, I don't always sleep, but when I do, I choose the 8sleep pod pro mattress.
link |
00:02:51.600
Check it out at 8sleep.com slash lex to get $200 off.
link |
00:02:57.400
This show is also sponsored by Raycon earbuds.
link |
00:03:01.500
Get them at buyraycon.com slash lex.
link |
00:03:05.900
They've quickly become my main method of listening to podcasts, audio books and music.
link |
00:03:10.400
When I run, do the pushups and pull ups that I've begun to hate at this point or just living life.
link |
00:03:17.400
In fact, I often listen to brown noise with these when I'm thinking deeply about something.
link |
00:03:22.200
It helps me focus the mind.
link |
00:03:24.200
They're super comfortable, pair easily, great sound, great bass, six hours of playtime.
link |
00:03:30.100
In fact, for fun, I have one of the earbuds in now and I'm listening to Europa by Santana,
link |
00:03:36.300
probably one of my favorite guitar songs.
link |
00:03:39.000
It kind of makes me feel like I'm in a music video.
link |
00:03:41.500
So they told me to say that a bunch of celebrities use these like Snoop Dogg, Melissa Etheridge and Cardi B.
link |
00:03:50.400
I don't even know who Cardi B is, but her earbud game is on point.
link |
00:03:55.500
To mention celebrities actually care about, I'm sure if Richard Feynman was still with us,
link |
00:04:01.100
he'd be listening to Joe Rogan's experience with Raycon earbuds.
link |
00:04:05.900
Get them at buyraycon.com slash lex.
link |
00:04:09.300
It's how they know I sent you and increases the chance that he'll support this podcast in the future.
link |
00:04:14.700
So for all of the sponsors, click all of the links.
link |
00:04:17.600
It really helps this podcast.
link |
00:04:19.900
And now here's my conversation with Brian Kernigan.
link |
00:04:25.000
UNIX started being developed 50 years ago.
link |
00:04:28.500
It'd be more than 50 years ago.
link |
00:04:30.500
Can you tell the story like you described in your new book of how UNIX was created?
link |
00:04:36.300
If I can remember that far back, it was some while ago.
link |
00:04:40.400
So I think the gist of it is that at Bell Labs in 1969, there were a group of people who had just finished
link |
00:04:48.200
working on the Multix project, which was itself a follow on to CTSS.
link |
00:04:54.200
So we can go back sort of an infinite regress in time.
link |
00:04:57.000
But the CTSS was a very, very, very nice time sharing system.
link |
00:05:01.000
It was very nice to use.
link |
00:05:02.000
I actually used it as that summer I spent in Cambridge in 1966.
link |
00:05:06.800
What was the hardware there?
link |
00:05:08.500
So what's the operating system?
link |
00:05:09.500
What's the hardware there?
link |
00:05:10.300
What's the CTSS look like?
link |
00:05:12.100
So CTSS looked like kind of like a standard time sharing system.
link |
00:05:17.000
Certainly at the time, it was the only time sharing of note.
link |
00:05:19.400
Let's go back to the basic.
link |
00:05:20.700
What's the time sharing system?
link |
00:05:22.300
Okay, in the beginning was the word and the word.
link |
00:05:24.900
And then there was time sharing systems.
link |
00:05:27.000
Yeah.
link |
00:05:27.400
If we go back into, let's call it the 1950s and early 1960s, most computing was done on very big computers,
link |
00:05:34.700
physically big, although not terribly powerful by today's standards that were maintained in very large rooms.
link |
00:05:42.100
And you use things like punch cards to write your programs on, talk to them.
link |
00:05:47.400
So you would take a deck of cards, write your program on it, send it over a counter,
link |
00:05:51.900
hand it to an operator and some while later back would come something that said,
link |
00:05:55.700
oh, you made a mistake and then you'd recycle.
link |
00:05:58.000
And so it was very, very slow.
link |
00:05:59.400
So the idea of time sharing was that you take basically that same computer,
link |
00:06:04.200
but connect to it with something that looked like an electric typewriter.
link |
00:06:09.400
That could be a long distance away.
link |
00:06:10.900
It could be closed.
link |
00:06:11.900
But fundamentally what the operating system did was to give each person who was connected to it
link |
00:06:18.100
and wanting to do something a small slice of time to do a particular job.
link |
00:06:24.900
So I might be editing a file.
link |
00:06:26.700
So I would be typing and every time I hit a keystroke,
link |
00:06:29.500
the operating system would wake up and said, oh, he typed a character.
link |
00:06:32.200
Let me remember that.
link |
00:06:33.500
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 who were trying to get something done,
link |
00:06:39.300
giving each a small slice of time and giving them each the illusion that they pretty much had the whole machine to themselves.
link |
00:06:47.600
Enhanced time sharing.
link |
00:06:49.200
That is sharing the computing time resource of the computer among a number of people who were doing it.
link |
00:06:54.900
Without the individual people being aware that there's others in a sense.
link |
00:06:58.600
The illusion, the feelings that you had, the machine is your own.
link |
00:07:02.500
Pretty much that was the idea.
link |
00:07:04.000
Yes, you had, if it were well done and if it were fast enough and other people weren't doing too much,
link |
00:07:09.800
you did have the illusion that you had the whole machine to yourself
link |
00:07:13.000
and it was very much better than the punch card model.
link |
00:07:16.600
And so CTSS, the compatible time sharing system, was I think arguably the first of these.
link |
00:07:22.500
It was done, I guess, technically in 64 or something like that.
link |
00:07:26.400
It ran on an IBM 7094, slightly modified to have twice as much memory as the norm.
link |
00:07:32.800
It had two banks of 32K words instead of one.
link |
00:07:37.500
So 32K words.
link |
00:07:40.600
Each word was 36 bits.
link |
00:07:42.200
So call it, you know, about 150 kilobytes times two.
link |
00:07:46.400
So by today's standards, that's down in the noise.
link |
00:07:49.500
But at the time, that was a lot of memory and memory was expensive.
link |
00:07:53.200
So CTSS was just a wonderful environment to work on.
link |
00:07:56.800
It was done by the people at MIT, led by Fernando Corbettove, Corby, who died just earlier this year,
link |
00:08:05.000
and a bunch of other folks.
link |
00:08:06.500
And then so I spent the summer of 66 working on that, had a great time,
link |
00:08:11.100
met a lot of really nice people, and indirectly knew of people at Bell Labs,
link |
00:08:17.600
who were also working on a follow on to CTSS that was called Multix.
link |
00:08:24.000
So Multix was meant to be the system that would do everything that CTSS did,
link |
00:08:27.600
but do it better for a larger population, all the usual stuff.
link |
00:08:31.600
Now, the actual time sharing, the scheduling, what's the algorithm that performs the scheduling?
link |
00:08:39.000
What's that look like?
link |
00:08:39.800
How much magic is there?
link |
00:08:40.900
What are the metrics?
link |
00:08:42.600
How does it all work in the beginning?
link |
00:08:44.600
So the answer is I don't have a clue.
link |
00:08:46.100
I think the basic idea was nothing more than who all wants to get something done.
link |
00:08:50.500
Suppose that things are very quiet in the middle of the night, then I get all the time that I want.
link |
00:08:55.700
Suppose that you and I are contending at high noon for something like that.
link |
00:08:59.800
Then probably the simplest algorithm is around Robin one that gives you a bit of time,
link |
00:09:03.600
gives me a bit of time, and then we could adapt to that.
link |
00:09:07.000
Like, what are you trying to do?
link |
00:09:08.600
Are you text editing or are you compiling or something?
link |
00:09:11.900
And we might adjust the scheduler according to things like that.
link |
00:09:14.900
It's okay.
link |
00:09:15.400
So Multix was trying to just do some of the, clean it up a little bit.
link |
00:09:20.200
Well, it was meant to be much more than that.
link |
00:09:22.200
So Multix was the multiplexed information and computing service,
link |
00:09:25.400
and it was meant to be a very large thing that would provide computing utility,
link |
00:09:29.900
something that where you could actually think of it as just a plug in the wall service,
link |
00:09:35.000
sort of like cloud computing today.
link |
00:09:37.100
Same idea.
link |
00:09:38.300
But 50 odd years earlier.
link |
00:09:40.700
And so what Multix offered was a richer operating system environment,
link |
00:09:47.000
piece of hardware that was better designed for doing the kind of sharing of resources,
link |
00:09:53.200
and presumably lots of other things.
link |
00:09:56.000
Do you think people at that time had the dream of what cloud computing is starting to become now,
link |
00:10:01.100
which is computing is everywhere that you can just plug in almost, you know,
link |
00:10:06.500
and you never know how the magic works.
link |
00:10:09.000
You just kind of plug in at your little computation that you need to perform and it does it.
link |
00:10:13.600
Was that the dream?
link |
00:10:14.900
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.400
I remember I was an intern for summer, but my sense is given that it was over 50 years ago.
link |
00:10:23.200
Yeah, they had that idea that it was an information utility,
link |
00:10:26.200
that it was something where if you had a computing task to do, you could just go into it.
link |
00:10:31.600
Now, I'm betting that they didn't have the same view of computing for the masses, let's call it,
link |
00:10:38.800
the idea that, you know, your grandmother would be shopping on Amazon.
link |
00:10:43.200
I don't think that was part of it.
link |
00:10:44.900
But if your grandmother were a programmer, it might be very easy for her to go and use this kind of utility.
link |
00:10:51.400
What was your dream of computers at that time?
link |
00:10:53.600
What did you see as the future of computers?
link |
00:10:55.600
Because you have predicted what computers are today, in a sense.
link |
00:10:59.500
Oh, short answer, absolutely not.
link |
00:11:01.700
I have no clue.
link |
00:11:02.600
I'm not sure I had a dream.
link |
00:11:03.800
It was a dream job in the sense that I really enjoyed what I was doing.
link |
00:11:07.400
I was surrounded by really, really nice people.
link |
00:11:10.000
Cambridge is a very fine city to live in in the summer, less so in the winter when it snows.
link |
00:11:14.200
But in the summer, it was a delightful time.
link |
00:11:16.800
And so I really enjoyed all of that stuff and I learned things.
link |
00:11:20.500
And I think the good fortune of being there for summer led me then to get a summer job at Bell Labs the following summer.
link |
00:11:28.400
And that was quite useful for the future.
link |
00:11:31.700
So this Bell Labs is this magical, legendary place.
link |
00:11:36.000
So first of all, where is Bell Labs?
link |
00:11:39.000
And can you start talking about that journey towards Unix at Bell Labs?
link |
00:11:46.500
Yeah, so Bell Labs is physically scattered around at the time, scattered around New Jersey.
link |
00:11:52.300
The primary location was in a town called Murray Hill, where a location called Murray Hill is actually that across the boundary between two small towns in New Jersey called New Providence and Berkeley Heights.
link |
00:12:03.400
Think of it as about 15, 20 miles straight west of New York City and therefore about an hour north of here in Princeton.
link |
00:12:11.600
And at that time, it had make up a number of 3,000, 4,000 people there, many of whom had PhDs and mostly doing physical sciences, chemistry,
link |
00:12:21.400
physics, materials, kinds of things, but very strong math.
link |
00:12:26.000
And it rapidly growing interest in computing as people realized you could do things with computers that you might not have been able to do before.
link |
00:12:35.300
You could replace labs with computers that had worked on models of what was going on.
link |
00:12:41.300
So that was the essence of Bell Labs.
link |
00:12:44.100
And again, I wasn't a permanent employee there.
link |
00:12:46.600
That was another internship.
link |
00:12:47.900
I got lucky in internships.
link |
00:12:50.500
I mean, if you could just linger on it a little bit.
link |
00:12:52.600
What was the, what was in the air there?
link |
00:12:55.500
Because some of this, the number of Nobel prizes, the number of touring awards and just legendary computer scientists that come from their inventions,
link |
00:13:03.000
including developments, including UNIX, it's just 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.600
I mentioned the number of people, so very large number of people, very highly skilled.
link |
00:13:19.100
And working in an environment where there was always something interesting to work on because the goal of Bell Labs,
link |
00:13:25.100
which was a small part of AT&T, which provided basically the country's phone service.
link |
00:13:30.100
The goal of AT&T was to provide service for everybody.
link |
00:13:33.400
And the goal of Bell Labs was to try and make that service keep getting better.
link |
00:13:38.000
So improving service.
link |
00:13:39.500
And that meant doing research on a lot of different things,
link |
00:13:43.900
physical devices like the transistor or fiber optical cables or microwave systems.
link |
00:13:50.800
All of these things the labs worked on.
link |
00:13:53.200
And it was kind of just the beginning of real boom times in computing as well.
link |
00:13:58.000
Because when I was there, I went there first in 66.
link |
00:14:01.100
So computing was at that point fairly young.
link |
00:14:04.500
And so people were discovering that you could do lots of things with computers.
link |
00:14:08.700
So how's UNIX born?
link |
00:14:10.800
So in spite of having an enormous number of really good ideas,
link |
00:14:15.500
lots of good people working on it fundamentally didn't live up at least in the short run.
link |
00:14:20.000
And I think ultimately really ever to its goal of being this information utility.
link |
00:14:25.500
It was too expensive and certainly what was promised was delivered much too late.
link |
00:14:31.500
And so in roughly the beginning of 1969, Bell Labs pulled out of the project.
link |
00:14:37.100
The project at that point had included MIT, Bell Labs and General Electric.
link |
00:14:44.000
General Electric made computers.
link |
00:14:45.400
So General Electric was the hardware operation.
link |
00:14:48.300
So Bell Labs realizing this wasn't going anywhere on a timescale they cared about pulled out of the project.
link |
00:14:54.100
And this left several people with an acquired taste for really, really nice computing environments,
link |
00:15:01.600
but no computing environment.
link |
00:15:03.500
And so they started thinking about what could you do if you're going to design a new operating system
link |
00:15:09.400
that would provide the same kind of comfortable computing as CTSS had,
link |
00:15:14.200
but also the facilities of something like Multics sort of brought forward.
link |
00:15:19.400
And so they did a lot of paper design stuff.
link |
00:15:21.700
And at the same time, Ken Thompson found what is characterized as a little used PDP 7
link |
00:15:27.300
where he started to do experiments with file systems, just how do you store information on a computer in a deficient way.
link |
00:15:35.000
And then this famous story that his wife went away to California for three weeks taking their one year old son
link |
00:15:41.100
and three weeks and he sat down and wrote an operating system, which ultimately became Unix.
link |
00:15:47.500
So software productivity is good in those days.
link |
00:15:50.300
So PDP, what's a PDP 7?
link |
00:15:52.100
So it's a piece of hardware.
link |
00:15:53.400
Yeah, it's a piece of hardware. It was one of early machines made by Digital Equipment Corporation, DEC.
link |
00:15:59.900
And it was a mini computer, so called it had, I would have to look up the numbers exactly,
link |
00:16:07.500
but it had a very small amount of memory, maybe 16k, 16 bit words or something like that, relatively slow.
link |
00:16:15.200
Probably not super expensive.
link |
00:16:17.100
Maybe again, making this up, I'd have to look it up $100,000 or something like that,
link |
00:16:21.800
which is not super expensive in those days, right?
link |
00:16:24.300
It was expensive. It was enough that you and I probably wouldn't be able to buy one,
link |
00:16:27.600
but a modest group of people could get together.
link |
00:16:30.800
But in any case, it came out, if I recall, in 1964.
link |
00:16:34.800
So by 1969, it was getting a little obsolete, and that's why it was little used.
link |
00:16:41.400
If you can sort of comment, what do you think it's like to write an operating system like that?
link |
00:16:45.600
So that process that Ken went through in three weeks,
link |
00:16:49.500
because you were, I mean, you're part of that process.
link |
00:16:52.700
You contributed a lot to UNIX's early development.
link |
00:16:57.500
So what do you think it takes to do that first step, that first kind of from design to reality on the PDP?
link |
00:17:05.400
Well, let me correct one thing. I had nothing to do with it.
link |
00:17:08.800
So I did not write it. I have never written operating system code.
link |
00:17:13.300
And so I don't know now an operating system is simply code. And this first one wasn't very big,
link |
00:17:21.300
but it's something that lets you run processes of some, let you execute some kind of code that has been written.
link |
00:17:27.300
It lets you store information for periods of time so that it doesn't go away when you turn the power off or reboot or something like that.
link |
00:17:36.100
And there's a kind of a core set of tools that are technically not part of an operating system,
link |
00:17:40.900
but you probably need them. In this case, Ken wrote an assembler for the PDP 7 that worked.
link |
00:17:46.700
He did a text editor so that he could actually create text.
link |
00:17:49.800
He had the file system stuff that he had been working on.
link |
00:17:52.100
And then the rest of it was just a way to load things,
link |
00:17:55.700
executable code from the file system into the memory, give it control,
link |
00:18:00.000
and then recover control when it was finished or in some other way quit.
link |
00:18:04.800
What was the code written in the primarily the programming language? Was it in assembly?
link |
00:18:09.200
Yeah, PDP 7 assembler that Ken created.
link |
00:18:13.700
These things were assembly language until probably the call it 1973 or 74, something like that.
link |
00:18:21.400
Forgive me if it's a dumb question, but it feels like a daunting task to write any kind of complex system in assembly.
link |
00:18:28.800
Absolutely.
link |
00:18:31.300
It feels like impossible to do any kind of what we think of as software engineering with assembly,
link |
00:18:36.200
to work on a big picture.
link |
00:18:40.000
I think it's hard. It's been a long time since I wrote assembly language.
link |
00:18:43.600
It is absolutely true that in assembly language, if you make a mistake, nobody tells you.
link |
00:18:47.100
There are no training wheels whatsoever. And so stuff doesn't work. Now what?
link |
00:18:51.700
There's no debuggers.
link |
00:18:53.400
Well, there could be debuggers, but that's the same problem, right?
link |
00:18:56.800
How do you actually get something 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.600
Now, these systems were not big in the sense that today's pictures are.
link |
00:19:08.600
So the big picture was, in some sense, more manageable.
link |
00:19:11.800
I mean, then realistically, there's an enormous variation in the capabilities of programmers.
link |
00:19:17.500
And Ken Thompson, who did that first one, is kind of the singularity in my experience of programmers with no disrespect to you or even to me.
link |
00:19:27.700
He's in denial.
link |
00:19:29.400
Several leagues removed.
link |
00:19:31.000
I know there's levels. It's a fascinating thing that there are unique stars in particular in the programming space and in a particular time.
link |
00:19:40.900
You know, the time matters to the timing of when that person comes along.
link |
00:19:44.400
And a wife does have to leave.
link |
00:19:47.300
There's this weird timing that happens that in an all of a sudden something beautiful is created.
link |
00:19:52.300
I mean, how does it make you feel that there's a system that was created in three weeks?
link |
00:19:58.300
Or maybe you can even say on a whim, but not really.
link |
00:20:02.000
But of course, quickly, that is now, you could think of most of the computers in the world run on a UNIX like system.
link |
00:20:10.600
Right.
link |
00:20:12.400
How do you, like, if you kind of zoom from the alien perspective, if you're just observing Earth,
link |
00:20:18.400
that all of a sudden these computers took over the world 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. And you asked earlier about prediction.
link |
00:20:30.200
The answer is no. There's no way you could predict that kind of evolution.
link |
00:20:33.900
And I don't know whether it was inevitable or just a whole sequence of blind luck.
link |
00:20:39.100
I suspect more of the latter.
link |
00:20:40.900
And so I look at it and think, gee, that's kind of neat.
link |
00:20:47.700
I think the real question is what does Ken think about that?
link |
00:20:51.000
Because he's the guy arguably from whom it really came.
link |
00:20:54.900
You know, tremendous contributions from Dennis Ritchie and then others around in that Bell Labs environment.
link |
00:21:00.200
But, you know, if you had to pick a single person, that would be Ken.
link |
00:21:04.500
So you've written a new book, UNIX, A History and a Memoir.
link |
00:21:08.300
Are there some memorable human stories, funny or profound from that time that just kind of stand out?
link |
00:21:14.100
Oh, there's a lot of them, in a sense.
link |
00:21:15.700
And again, it's a question of can you resurrect them in real time way as memory fails?
link |
00:21:21.800
But I think part of it was that Bell Labs at the time was a very special kind of place to work
link |
00:21:27.100
because there were a lot of interesting people and the environment was very, very open and free.
link |
00:21:31.700
It was a very cooperative environment, very friendly environment.
link |
00:21:34.400
And so if you had an interesting problem, you go and talk to somebody and they might help you with the solution.
link |
00:21:40.600
And it was kind of a fun environment, too, in which people did strange things
link |
00:21:46.600
and often tweaking the bureaucracy in one way or another.
link |
00:21:52.400
So rebellious in certain kinds of ways.
link |
00:21:54.900
In some ways, yeah, absolutely.
link |
00:21:56.700
I think most people didn't take too kindly to the bureaucracy.
link |
00:21:59.700
And I'm sure the bureaucracy put up with an enormous amount that they didn't really want to.
link |
00:22:05.900
So maybe to linger on it a little bit.
link |
00:22:09.500
Do you have a sense of what the philosophy that characterizes UNIX is?
link |
00:22:13.700
The design, not just the initial, but just carry through the years.
link |
00:22:18.800
Just being there, being around it.
link |
00:22:20.600
What's the fundamental philosophy behind the system?
link |
00:22:23.300
I think one aspect of fundamental philosophy was to provide an environment that made it easy to write
link |
00:22:29.100
or easier productive to write programs.
link |
00:22:31.900
So it was meant as a programmer environment.
link |
00:22:33.700
It wasn't meant specifically as something to do some other kind of job.
link |
00:22:38.300
For example, it was used extensively for word processing, but it wasn't designed as a word processing system.
link |
00:22:43.700
It was used extensively for lab control, but it wasn't designed for that.
link |
00:22:47.300
It was used extensively as a front end for big other systems, big dumb systems.
link |
00:22:52.400
But it wasn't designed for that.
link |
00:22:53.700
It was meant to be an environment where it was really easy to write programs.
link |
00:22:57.900
So the programmers could be highly productive.
link |
00:23:00.600
And part of that was to be a community.
link |
00:23:03.100
And there's some observation from Dennis Ritchie.
link |
00:23:05.500
I think at the end of the book, it says that from his standpoint, the real goal was to create a community
link |
00:23:11.800
where people could work as programmers on a system.
link |
00:23:17.100
And I think in that sense, certainly for many, many years, it succeeded quite well at that.
link |
00:23:22.600
And part of that is the technical aspects of because it made it really easy to write programs.
link |
00:23:27.500
People did write interesting programs.
link |
00:23:29.400
Those programs tended to be used by other programmers, and so it was kind of a virtuous circle of more and more stuff coming out
link |
00:23:36.500
that was really good for programmers.
link |
00:23:39.300
And you were part of that community of programmers.
link |
00:23:41.700
So what was it like writing programs on that early Unix?
link |
00:23:45.700
It was a blast.
link |
00:23:46.500
It really was.
link |
00:23:49.900
You know, I like to program.
link |
00:23:51.100
I'm not a terribly good programmer, but it was a lot of fun to write code.
link |
00:23:55.200
And in the early days, there was an enormous amount of what you would today, I suppose, call low hanging fruit.
link |
00:24:00.100
People hadn't done things before.
link |
00:24:02.500
And this was this new environment and the whole combination of nice tools and very responsive system.
link |
00:24:09.700
And tremendous colleagues made it possible to write code.
link |
00:24:13.600
You could have an idea in the morning.
link |
00:24:16.400
You could do an experiment with it.
link |
00:24:19.100
You could have something limping along that night or the next day and people would react to it.
link |
00:24:23.600
And they would say, oh, that's wonderful, 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.700
And so a lot of things got developed fairly quickly that in many cases still exist today.
link |
00:24:39.900
And I think that was part of what made it fun because programming itself is fun.
link |
00:24:44.700
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 that somebody else then uses.
link |
00:24:52.300
Even if they whine about it not working, the fact that they used it is part of the reward mechanism.
link |
00:24:58.500
And what was the method of interaction, the communication when you do that feedback loop?
link |
00:25:03.600
I mean, this is before the internet.
link |
00:25:05.400
Certainly before the internet.
link |
00:25:07.500
It was mostly physical right there.
link |
00:25:11.400
You know, somebody would come into your office and say something.
link |
00:25:13.700
So these places are all close, but like offices are nearby.
link |
00:25:16.700
So you're really lively into interaction.
link |
00:25:18.900
Yeah, yeah, Bell Labs was fundamentally one giant building and most of the people were involved
link |
00:25:23.500
in this unique stuff were in two or three quarters and there was a room.
link |
00:25:27.600
Oh, how big was it?
link |
00:25:29.400
Probably call it 50 feet by 50 feet, make up a number of that which had some access
link |
00:25:37.300
to computers there as well as in offices and people hung out there and it had a coffee machine.
link |
00:25:42.900
And so there was a, it was mostly very physical.
link |
00:25:46.300
We did use email, of course, and, but it was fundamentally all for a long time, all on one machine.
link |
00:25:54.100
So there was no need for internet.
link |
00:25:56.500
It's fascinating to think about what computing would be today without Bell Labs.
link |
00:26:00.900
It seems so many people being in the vicinity of each other.
link |
00:26:06.400
It's sort of getting that quick feedback working together.
link |
00:26:09.100
There's so many brilliant people.
link |
00:26:11.100
I don't know where else that could have existed in the world and been given how that came together.
link |
00:26:16.100
How does that make you feel that little element of history?
link |
00:26:23.300
Well, I think that's very nice, but in a sense it's survivor bias and if it hadn't happened
link |
00:26:28.500
at Bell Labs, there were other places that were doing really interesting work as well.
link |
00:26:32.900
Xerox Park is perhaps the most obvious one.
link |
00:26:35.100
Xerox Park contributed an enormous amount of good material and many of the things we
link |
00:26:39.200
take for granted today in the same way came from Xerox Park experience.
link |
00:26:43.300
I don't think they capitalized in the long run as much.
link |
00:26:46.500
Their parent company was perhaps not as lucky in capitalizing on this.
link |
00:26:51.900
Who knows?
link |
00:26:52.900
But that would, that's certainly another place where there was a tremendous amount of influence.
link |
00:26:58.100
There were a lot of good university activities.
link |
00:27:00.300
MIT was obviously no slouch in this kind of thing and others as well.
link |
00:27:07.100
So UNIX turned out to be open source because of the various ways that AT&T operated and
link |
00:27:13.600
sort of had to, the focus was on telephones.
link |
00:27:18.900
I think that's a mischaracterization in a sense.
link |
00:27:21.700
It absolutely was not open source.
link |
00:27:24.020
It was very definitely proprietary licensed, but it was licensed freely to universities
link |
00:27:30.780
in source code form for many years.
link |
00:27:33.900
And because of that, generations of university students and their faculty people grew up
link |
00:27:39.820
knowing about UNIX and that there was enough expertise in the community that it then became
link |
00:27:45.540
possible for people to kind of go off in their own direction and build something that looked
link |
00:27:49.100
UNIX like.
link |
00:27:51.620
The Berkeley version of UNIX started with that licensed code and gradually picked up
link |
00:27:58.140
enough of its own code contributions, notably from people like Bill Joy, that eventually
link |
00:28:06.500
it was able to become completely free of any AT&T code.
link |
00:28:10.340
In other words, an enormous amount of legal jockeying around this in the late early to
link |
00:28:15.980
late 80s, early 90s, something like that.
link |
00:28:19.700
And then not some, I guess the open source movement might have started when Richard Stallman
link |
00:28:27.100
started to think about this in the late 80s and by 1991, when Torvalds decided he was
link |
00:28:32.860
going to do a UNIX like operating system, there was enough expertise that in the community
link |
00:28:40.380
that first he had a target.
link |
00:28:42.140
He could see what to do because the kind of the UNIX system call interface and the tools
link |
00:28:48.100
and so on were there.
link |
00:28:50.780
And so he was able to build an operating system that at this point, when you say UNIX in many
link |
00:28:56.460
cases, what you're really thinking is Linux.
link |
00:28:58.500
Linux, yeah.
link |
00:28:59.500
But it's funny that from my distant perception, I felt that UNIX was open source without actually
link |
00:29:06.300
knowing it, but what you're really saying, it was just freely licensed.
link |
00:29:11.700
It was freely licensed.
link |
00:29:12.700
So it felt open source because universities are not trying to make money.
link |
00:29:17.020
So it felt open source in the sense that you can get access if you wanted.
link |
00:29:20.780
Right.
link |
00:29:21.780
And a very, very, very large number of universities had the license and they were able to talk
link |
00:29:25.140
to all the other universities who had the license.
link |
00:29:27.540
And so technically not open, technically belonging to AT&T pragmatically, pretty open.
link |
00:29:34.940
And so there's a ripple effect that all the faculty and the students then all grew up
link |
00:29:38.820
and then they went throughout the world and permeated in that kind of way.
link |
00:29:45.500
So what kind of features do you think make for a good operating system?
link |
00:29:52.620
If you take the lessons of UNIX, you said make it easy for programmers.
link |
00:30:00.060
That seems to be an important one.
link |
00:30:04.020
But also UNIX turned out to be exceptionally robust and efficient.
link |
00:30:08.740
So is that an accident when you focus on the programmer or is that a natural outcome?
link |
00:30:14.700
I think part of the reason for efficiency was that it began on extremely modest hardware.
link |
00:30:20.940
Very, very, very tiny and so you couldn't get carried away.
link |
00:30:24.060
You couldn't do a lot of complicated things because you just didn't have the resources,
link |
00:30:29.980
either processor, speed or memory.
link |
00:30:32.580
And so that enforced a certain minimality of mechanisms and maybe a search for generalizations
link |
00:30:39.940
so that you would find one mechanism that's served for a lot of different things rather
link |
00:30:43.660
than having lots of different special cases.
link |
00:30:45.820
I think the file system in UNIX is a good example of that file system interface and
link |
00:30:50.420
its fundamental form is extremely straightforward.
link |
00:30:53.940
And that means that you can write code very, very effectively for the file system.
link |
00:30:59.100
And then one of those idea, one of those generalizations is that gee, that file system interface works
link |
00:31:04.780
for all kinds of other things as well.
link |
00:31:06.900
And so in particular, the idea of reading and writing to devices is the same as reading
link |
00:31:11.540
and writing to a disk that has a file system.
link |
00:31:14.820
And then that gets carried further in other parts of the world, processes become in effect
link |
00:31:21.740
files in a file system.
link |
00:31:24.340
And the Plan 9 operating system, which came along, I guess in the late 80s or something
link |
00:31:27.780
like that, took a lot of those ideas from the original UNIX and tried to push the generalization
link |
00:31:33.940
even further so that in Plan 9 a lot of different resources are file systems, they all share
link |
00:31:38.740
that interface.
link |
00:31:39.740
So that would be one example where finding the right model of how to do something means
link |
00:31:45.740
that an awful lot of things become simpler.
link |
00:31:48.180
And it means therefore that more people can do useful, interesting things with them without
link |
00:31:51.980
them to think as hard about it.
link |
00:31:54.580
So you said you're not a very good programmer.
link |
00:31:57.100
True.
link |
00:31:58.100
You're the most modest human being.
link |
00:32:01.220
Okay, but you'll continue saying that.
link |
00:32:02.980
I understand how this works, but you do radiate a sort of love for programming.
link |
00:32:07.860
So let me ask, do you think programming is more an art or a science?
link |
00:32:13.260
Is it creativity or kind of rigor?
link |
00:32:16.540
I think it's some of each, it's some combination.
link |
00:32:20.980
Some of the art is figuring out what it is that you really want to do.
link |
00:32:23.860
What should that program be?
link |
00:32:26.020
What would make a good program?
link |
00:32:27.620
And that's some understanding of what the task is, what the people who might use this
link |
00:32:32.140
program want.
link |
00:32:33.140
And I think that's art in many respects.
link |
00:32:37.820
The science part is trying to figure out how to do it well.
link |
00:32:40.620
And some of that is real computer science stuff, like what algorithm should we use at
link |
00:32:47.140
some point, mostly in the sense of being careful to use algorithms that will actually work
link |
00:32:53.740
properly, scale properly, avoiding quadratic algorithms when a linear algorithm should
link |
00:32:59.340
be the right thing, that kind of more formal view of it.
link |
00:33:04.260
Same thing for data structures.
link |
00:33:06.620
But also it's, I think, an engineering field as well.
link |
00:33:10.460
And engineering is not quite the same as science because engineering, you're working with constraints.
link |
00:33:15.420
You have to figure out not only what is a good algorithm for this kind of thing, but
link |
00:33:21.100
what's the most appropriate algorithm given the amount of time we have to compute, the
link |
00:33:26.340
amount of time we have to program, what's likely to happen in the future with maintenance,
link |
00:33:31.020
who's going to pick this up in the future, all of those kind of things that if you're
link |
00:33:35.180
an engineer, you get to worry about.
link |
00:33:37.460
Whereas if you think of yourself as a scientist, well, you can maybe push them over the horizon
link |
00:33:41.500
in a way.
link |
00:33:42.500
And if you're an artist, what's that?
link |
00:33:45.500
So just on your own personal level, what's your process like of writing a program, say
link |
00:33:50.780
a small and large sort of tinkering with stuff?
link |
00:33:55.940
Do you just start coding right away and just kind of evolve iteratively with a loose notion?
link |
00:34:03.100
Or do you plan on a sheet of paper first and then kind of design in what they teach you
link |
00:34:09.260
in the kind of software engineering courses and undergrad or something like that?
link |
00:34:13.820
What's your process like?
link |
00:34:15.060
It's certainly much more the informal incremental.
link |
00:34:17.500
First, I don't write big programs at this point.
link |
00:34:20.300
It's been a long time since I wrote a program that was more than I call it a few hundred
link |
00:34:24.740
or more lines, something like that.
link |
00:34:27.260
Many of the programs I write are experiments for either something I'm curious about or
link |
00:34:31.940
often for something that I want to talk about in a class.
link |
00:34:34.660
And so those necessarily tend to be relatively small.
link |
00:34:38.980
A lot of the kind of code I write these days tends to be for sort of exploratory data analysis,
link |
00:34:44.340
where I've got some collection of data and I want to try and figure out what on earth
link |
00:34:47.420
is going on in it.
link |
00:34:49.380
And for that, those programs tend to be very small.
link |
00:34:52.780
Sometimes you're not even programming, you're just using existing tools like counting things.
link |
00:34:58.020
Or sometimes you're writing OX scripts because two or three lines will tell you something
link |
00:35:02.700
about a piece of data and then when it gets bigger, well, then I will probably write something
link |
00:35:06.880
in Python because that scales better up to call it a few hundred lines or something like
link |
00:35:13.700
that.
link |
00:35:14.700
And it's been a long time since I wrote programs that were much more than that.
link |
00:35:18.940
Speaking of data exploration in OX, first, what is OX?
link |
00:35:23.700
So OX is a scripting language that was done by myself, L Aho, and Peter Weinberger.
link |
00:35:30.340
We did that originally in the late 70s.
link |
00:35:32.820
It was a language that was meant to make it really easy to do quick and dirty tasks like
link |
00:35:38.140
counting things or selecting interesting information from basically all text files,
link |
00:35:45.220
rearranging it in some way or summarizing it.
link |
00:35:48.460
Runs a command on each line or a file.
link |
00:35:51.500
I mean, it's still exceptionally widely used today.
link |
00:35:55.420
Oh, absolutely.
link |
00:35:56.420
Yeah.
link |
00:35:57.420
It's so simple and elegant, the way to explore data turns out you can just write a script
link |
00:36:03.140
that does something seemingly trivial on a single line and that giving you that slice
link |
00:36:09.300
of the data somehow reveals something fundamental about the data and that seems to work still.
link |
00:36:16.860
Yeah, it's very good for that kind of thing.
link |
00:36:19.820
It's sort of what it was meant for.
link |
00:36:21.260
I think what we didn't appreciate was that the model was actually quite good for a lot
link |
00:36:25.860
of data processing kinds of tasks and that it's kept going as long as it has because
link |
00:36:30.900
at this point it's over 40 years old and it's still, I think, a useful tool and well, this
link |
00:36:37.100
is paternal interest, I guess, but I think in terms of programming languages, you get
link |
00:36:41.220
the most bang for the buck by learning OX and it doesn't scale to big programs, but
link |
00:36:46.860
it does pretty darn well on these little things where you just want to see all the somethings
link |
00:36:51.980
in something.
link |
00:36:52.980
Yeah, I probably write more OX than anything else at this point.
link |
00:36:58.740
So what kind of stuff do you love about OX?
link |
00:37:02.060
If you can comment on things that give you joy when you can, in a simple program, reveal
link |
00:37:10.660
something about the data, is there something that stands out from particular features?
link |
00:37:14.540
I think it's mostly the selection of default behaviors that you sort of hinted at at a
link |
00:37:20.540
moment ago.
link |
00:37:21.540
What OX does is to read through a set of files and then within each file, it reads through
link |
00:37:26.940
each of the lines and then on each of the lines, it has a set of patterns that it looks
link |
00:37:32.460
for.
link |
00:37:33.460
That's your OX program and if one of the patterns matches, there is a corresponding action that
link |
00:37:38.740
you might perform and so it's kind of a quadruply nested loop or something like that.
link |
00:37:44.500
And that's all completely automatic.
link |
00:37:46.700
You don't have to say anything about it.
link |
00:37:48.260
You just write the pattern in the action and then run the data by it.
link |
00:37:52.500
And so that paradigm for programming is a very natural and effective one.
link |
00:37:57.060
And I think we captured that reasonably well in OX and it does other things for free as
link |
00:38:01.620
well.
link |
00:38:02.620
It splits the data into fields so that on each line, there's fields separated by white space
link |
00:38:06.940
or something and so it does that for free.
link |
00:38:08.900
You don't have to say anything about it.
link |
00:38:11.540
And it collects information as it goes along, like what line are we on, how many fields
link |
00:38:15.940
are there on this line.
link |
00:38:18.140
So lots of things that just make it so that a program which in another language, let's
link |
00:38:22.940
say Python would be 5, 10, 20 lines in OX is one or two lines.
link |
00:38:28.260
So because it's one or two lines, you can do it on the shell.
link |
00:38:31.260
You don't have to open up another whole thing.
link |
00:38:33.780
You can just do it right there in the interaction with the operatives directly.
link |
00:38:39.020
Is there other shell commands that you love over the years like you really enjoy using?
link |
00:38:46.300
Oh, Grapp.
link |
00:38:47.300
Grapp?
link |
00:38:48.300
Grapp's the only one.
link |
00:38:49.300
Yeah, Grapp does everything.
link |
00:38:51.580
So Grapp is a kind of a, what is it, a simpler version of OX, I would say?
link |
00:38:55.700
In some sense, yeah, right.
link |
00:38:57.860
Because what is Grapp?
link |
00:38:59.020
So Grapp is, it basically searches the input for particular patterns, regular expressions
link |
00:39:03.900
technically of a certain class.
link |
00:39:06.300
And it has that same paradigm that OX does, it's a pattern action thing.
link |
00:39:10.140
It reads through all the files and then all the lines in each file.
link |
00:39:13.740
But it has a single pattern, which is the regular expression you're looking for, and
link |
00:39:17.180
a single action printed if it matches.
link |
00:39:20.340
So in that sense, it's a much simpler version and you could write Grapp in OX as a one liner.
link |
00:39:27.380
And I use Grapp probably more than anything else at this point, just because it's so convenient
link |
00:39:33.980
and natural.
link |
00:39:34.980
Why do you think, it's such a powerful tool, Grapp and OX.
link |
00:39:38.740
Why do you think operating systems like Windows, for example, don't have it?
link |
00:39:44.980
Sort of, you can, of course, I use, which is amazing now.
link |
00:39:48.420
There's Windows for Linux, like the, which you could basically use all the fun stuff
link |
00:39:54.780
like Ock and Grapp inside of Windows.
link |
00:39:57.540
But Windows naturally sort of, as part of the graphical interface, the simplicity of
link |
00:40:01.900
Grapp, sort of searching through a bunch of files and just popping up naturally.
link |
00:40:06.220
Why, why don't you think that, why do you think that's unique to the Unix and Linux
link |
00:40:10.860
environment?
link |
00:40:11.860
I don't know.
link |
00:40:12.860
It's not strictly unique, but it's certainly focused there.
link |
00:40:16.580
And I think some of it's the weight of history, that Windows came from MS DOS, MS DOS was
link |
00:40:22.660
a pretty pathetic operating system, although common on an, you know, unboundedly large
link |
00:40:27.420
number of machines, but somewhere in roughly the 90s, Windows became a graphical system.
link |
00:40:34.740
And I think Microsoft spent a lot of their energy on making that graphical interface
link |
00:40:39.900
what it is.
link |
00:40:41.820
And that's a different model of computing.
link |
00:40:43.780
And it's a model of computing that where you point and click and sort of experiment
link |
00:40:48.340
with menus, it's a model of computing works right rather well for people who are not programmers.
link |
00:40:54.780
Just want to get something done, whereas teaching something like the command line to non programmers
link |
00:41:00.260
turns out to sometimes be an uphill struggle.
link |
00:41:02.900
And so I think Microsoft probably was right in what they did.
link |
00:41:05.900
Now you mentioned whistle or whatever it's called the Winix Linux.
link |
00:41:09.620
What's that?
link |
00:41:10.620
I wonder what's pronounced.
link |
00:41:11.620
WSL is what never actually pronounced the whistle.
link |
00:41:13.460
I like it.
link |
00:41:14.460
I have no idea.
link |
00:41:16.020
But there have been things like that for longest.
link |
00:41:17.740
Sigwin, for example, which is a wonderful collection of take all your favorite tools
link |
00:41:22.300
from Winix and Linux and just make them work perfectly on Windows.
link |
00:41:25.500
And so that's something that's been going on for at least 20 years, if not longer.
link |
00:41:30.220
And I use that on my one remaining Windows machine routinely because if you're doing
link |
00:41:37.380
something that is batch computing, suitable for command line, that's the right way to
link |
00:41:42.380
do it because the Windows equivalents are, if nothing else, not familiar to me.
link |
00:41:46.660
But I would definitely recommend to people to, if they don't use Sigwin, to try whistle.
link |
00:41:52.460
Yes.
link |
00:41:53.460
I've been so excited that I could use batch, that would be batch, write scripts quickly
link |
00:41:59.420
in Windows.
link |
00:42:00.420
It's changed my life.
link |
00:42:02.740
Okay.
link |
00:42:03.740
What's your perfect programming setup?
link |
00:42:06.620
What computer?
link |
00:42:07.620
What operating system?
link |
00:42:08.620
What keyboard?
link |
00:42:09.620
What editor?
link |
00:42:10.620
Yeah.
link |
00:42:11.620
Perfect is too strong a word.
link |
00:42:12.620
It's way too strong a word.
link |
00:42:15.540
What I use by default, I have a, at this point, a 13 inch MacBook Air, which I use because
link |
00:42:22.420
it's kind of a reasonable balance of the various things I need.
link |
00:42:25.220
I can carry it around.
link |
00:42:26.660
It's got enough computing, horsepower, screen's big enough, keyboard's okay.
link |
00:42:31.220
And so I basically do most of my computing on that.
link |
00:42:34.620
I have a big iMac in my office that I use from time to time as well, especially when
link |
00:42:39.940
I need a big screen, but otherwise it tends not to be used that much.
link |
00:42:47.220
Editor.
link |
00:42:48.380
I use mostly SAM, which is an editor that Rob Pike wrote long ago at Bell Labs and.
link |
00:42:55.580
Did that, sorry to interrupt it.
link |
00:42:57.060
Does that precede VI?
link |
00:42:58.060
Does that precede Mac?
link |
00:43:00.220
It post dates both VI and Emacs.
link |
00:43:04.260
It is derived from Rob's experience with ED and VI.
link |
00:43:10.900
ED.
link |
00:43:11.900
That's the original Unix editor.
link |
00:43:14.460
Oh wow.
link |
00:43:15.460
Dated probably before you were born.
link |
00:43:19.700
So what's, actually, what's the history of editors?
link |
00:43:23.820
Can you briefly, because it's such a fact, I use Emacs, I'm sorry to say, sorry to come
link |
00:43:29.180
out with that.
link |
00:43:30.420
But what's the kind of interplay there?
link |
00:43:33.500
So in ancient times, like call it the first time sharing system is going back to what
link |
00:43:39.900
we were talking about.
link |
00:43:40.900
There were editors, there was an editor on CTSS that I don't even remember what it was
link |
00:43:45.140
called.
link |
00:43:46.140
It might have been edit, where you could type text, program text, and it would do something
link |
00:43:51.900
or document text.
link |
00:43:53.780
You could save the text.
link |
00:43:55.020
Save it.
link |
00:43:56.020
You could edit it.
link |
00:43:57.020
The usual thing that you would get in an editor.
link |
00:44:00.580
And Ken Thompson wrote an editor called QED, which was very, very powerful.
link |
00:44:06.140
But these were all totally a command based, they were not most or cursor based because
link |
00:44:11.020
it was before mice and even before cursors, because they were running on terminals that
link |
00:44:15.100
printed on paper.
link |
00:44:16.420
Okay.
link |
00:44:17.420
No CRT type displays, little on the LEDs.
link |
00:44:21.580
And so then when Unix came along, Ken took QED and stripped it way, way, way, way down.
link |
00:44:28.940
And that became an editor that he called ED.
link |
00:44:30.820
And it was very simple, but it was a line oriented editor.
link |
00:44:33.980
And so you could load a file and then you could talk about the lines one through the
link |
00:44:38.380
last line and you could print ranges of lines.
link |
00:44:41.660
You could add text, you could delete text, you could change text, or you could do a substitute
link |
00:44:46.060
command that would change things within a line or within groups of lines.
link |
00:44:49.220
So you could work on a part of a file essentially.
link |
00:44:51.220
Yeah.
link |
00:44:52.220
You could work on any part of it, the whole thing or whatever, but it was entirely command
link |
00:44:56.620
line based and it was entirely on paper, okay, paper.
link |
00:45:01.660
And that meant that you changed, yeah, right, real paper.
link |
00:45:04.180
And so if you changed the line, you had to print that line using up another line of paper
link |
00:45:09.020
to see what the change caused, okay.
link |
00:45:13.100
So when CRT displays came along, then you could start to use cursor control and you
link |
00:45:19.940
could sort of move where you were on the screen in a...
link |
00:45:24.500
Without reprinting.
link |
00:45:25.500
Yeah, reprinting.
link |
00:45:27.260
And there were a number of editors there.
link |
00:45:29.900
The one that I was most familiar with and still use is VI, which was done by Bill Choy.
link |
00:45:35.460
And so that dates from probably the late 70s as a guess.
link |
00:45:41.460
And it took a full advantage of the cursor controls.
link |
00:45:45.220
I suspect that Emacs was roughly at the same time, but I don't know.
link |
00:45:49.020
I've never internalized Emacs.
link |
00:45:51.900
So I use, at this point, I stopped using ED, although I still can.
link |
00:45:56.340
I use VI sometimes and I use SAM when I can.
link |
00:46:00.300
And SAM is available on most systems?
link |
00:46:02.700
It was, it is available.
link |
00:46:04.420
You have to download it yourself from typically the plan line operating system distribution.
link |
00:46:08.660
It's been maintained by people there.
link |
00:46:12.100
And so I...
link |
00:46:13.100
I'll get home tonight.
link |
00:46:14.100
I'll try it.
link |
00:46:15.100
It's cool.
link |
00:46:16.100
It sounds fascinating.
link |
00:46:18.100
So my love is with Lisp and Emacs have went into that hippie world of...
link |
00:46:23.100
I think it's a lot of things.
link |
00:46:26.140
What religion were you brought up with?
link |
00:46:27.900
Yeah, that's true.
link |
00:46:28.900
That's true.
link |
00:46:29.900
Most of the actual programming I do is CC++ and Python, but my weird sort of, yeah, my
link |
00:46:36.340
religious upbringing is in Lisp.
link |
00:46:38.260
So can you take on the impossible task and give a brief history of programming languages
link |
00:46:44.740
from your perspective?
link |
00:46:46.500
So I guess you could say programming languages started probably in what, the late 40s or
link |
00:46:51.180
something like that.
link |
00:46:52.180
People used to program computers by basically putting in zeros and ones using something
link |
00:46:56.860
like switches on a console and then, or maybe holes in paper tapes, something like that.
link |
00:47:05.100
So extremely tedious, awful, whatever.
link |
00:47:08.140
And so I think the first programming languages were relatively crude assembly languages where
link |
00:47:14.820
people would basically write a program that would convert mnemonics like add ADD into
link |
00:47:23.500
whatever the bit pattern was that corresponded to an add instruction and they would do the
link |
00:47:27.380
clerical work of figuring out where things were so you could put a name on a location
link |
00:47:32.060
in a program and the assembler would figure out where that corresponded to when the thing
link |
00:47:36.940
was all put together and dropped into memory.
link |
00:47:41.060
And then early on, and this would be the late 40s and very early 50s, there were assemblers
link |
00:47:47.620
written for the various machines that people used.
link |
00:47:51.060
You may have seen in the paper just a couple of days ago, Tony Berker died.
link |
00:47:54.260
He did this thing in Manchester called AutoCode, a language which I knew only by name.
link |
00:48:01.180
But it sounds like it was a flavor of assembly language sort of a little higher in some ways.
link |
00:48:06.860
And it replaced the language that Alan Turing wrote, which you put in zeros and ones, but
link |
00:48:11.340
you put them in backwards order because that was a hardware word.
link |
00:48:14.820
That's right.
link |
00:48:15.820
Yeah, yeah.
link |
00:48:16.820
That's right.
link |
00:48:17.820
It's backwards.
link |
00:48:18.820
So assembly language is when let's call that the early 1950s.
link |
00:48:22.380
And so every different flavor of computer has its own assembly language.
link |
00:48:25.820
So the Ed Sack had its and a Manchester had its and the IBM whatever 7090 or 704 or whatever
link |
00:48:32.980
had its and so on.
link |
00:48:33.980
So everybody had their own assembly language.
link |
00:48:35.780
And assembly languages have a few commands, additions, subtraction and branching of some
link |
00:48:40.700
kind if then type of situation.
link |
00:48:43.060
Right.
link |
00:48:44.060
They have exactly in their simplest form at least one instruction per or one assembly
link |
00:48:49.140
language instruction per instruction in the machine's repertoire.
link |
00:48:52.900
And so you have to know the machine intimately to be able to write programs in it.
link |
00:48:56.940
And if you write an assembly language program for one kind of machine and then you say,
link |
00:49:00.500
geez, it's nice.
link |
00:49:01.500
I'd like a different machine.
link |
00:49:03.100
Start over.
link |
00:49:04.100
Okay.
link |
00:49:05.100
Very bad.
link |
00:49:06.220
And so what happened in the late fifties was people realized you could play this game
link |
00:49:10.580
again and you could move up a level in writing or creating languages that were closer to
link |
00:49:16.340
the way the real people might think about how to write code.
link |
00:49:21.100
And there were, I guess, arguably three or four at that time period.
link |
00:49:25.700
There was Fortran, which came from IBM, which was formula translation meant to make it easy
link |
00:49:30.700
to do scientific and engineering computation.
link |
00:49:32.860
I just know that formula translation.
link |
00:49:34.580
That's what it stood for.
link |
00:49:35.580
There was Kobal, which is the common business oriented language that Grace Hopper and others
link |
00:49:39.500
worked on, which was aimed at business kinds of tasks.
link |
00:49:43.460
There was Algol, which was mostly meant to describe algorithmic computations.
link |
00:49:49.340
I guess you could argue basic was in there somewhere.
link |
00:49:51.300
I think it's just a little later.
link |
00:49:54.420
And so all of those moved the level up.
link |
00:49:56.540
And so they were closer to what you and I might think of as we were trying to write
link |
00:50:01.140
a program and they were focused on different domains, Fortran for formula translation,
link |
00:50:08.220
engineering computations, let's say Kobal for business, that kind of thing.
link |
00:50:11.660
I'm still used to today, at least Fortran probably.
link |
00:50:14.460
Oh yeah.
link |
00:50:15.460
Kobal too.
link |
00:50:16.460
Kobal.
link |
00:50:17.460
But the deal was that once you moved up that level, then you, let's call it Fortran, you
link |
00:50:21.060
had a language that was not tied to a particular kind of hardware because a different compiler
link |
00:50:26.260
would compile for different kind of hardware.
link |
00:50:28.060
And that meant two things.
link |
00:50:30.060
It meant you only had to write the program once, which was very important.
link |
00:50:33.940
And it meant that you could, in fact, if you were a random engineer, physicist, whatever,
link |
00:50:38.500
you could write that program yourself.
link |
00:50:39.780
You didn't have to hire a programmer to do it for you.
link |
00:50:42.380
It might not be as good as you'd get with a real programmer, but it was pretty good.
link |
00:50:45.980
And so it democratized and made much more broadly available, the ability to write code.
link |
00:50:51.540
So it puts the power of programming to the hands of people like you.
link |
00:50:54.740
Yeah.
link |
00:50:55.740
Anybody who wants, who is willing to invest some time in learning a programming language
link |
00:50:59.300
and is not then tied to a particular kind of computer.
link |
00:51:03.660
And then in the seventies, you get system programming languages of which C is the survivor.
link |
00:51:09.060
And what, what, what does system programming languages mean?
link |
00:51:12.340
Programs that programming languages that would take on the kinds of things that would necessary
link |
00:51:17.220
to write so called system programs, things like text editors or assemblers or compilers
link |
00:51:22.660
or operating systems themselves, those kinds of things.
link |
00:51:26.940
And Fortran.
link |
00:51:27.940
They have to be feature rich.
link |
00:51:29.220
They have to be able to do a lot of stuff, a lot of memory management, access processes
link |
00:51:33.540
and all that kind of stuff.
link |
00:51:34.540
They have to, it's a different flavor of what they're doing.
link |
00:51:37.260
They're much more in touch with the actual machine in a, but in a positive way.
link |
00:51:42.460
That is you can talk about memory in a more controlled way.
link |
00:51:46.020
You can talk about the different data types that the machine supports and the way they're
link |
00:51:52.220
and more ways to structure and organize data.
link |
00:51:55.060
And so the system programming languages, there was a lot of effort in that in the, call it
link |
00:52:00.140
the late sixties, early seventies.
link |
00:52:02.380
C is I think the only real survivor of that.
link |
00:52:06.420
And then what happens after that, you get things like object oriented programming languages
link |
00:52:12.100
because as you write programs in a language like C, at some point scale gets to, and it's
link |
00:52:16.780
too hard to keep track of the pieces and there's no guardrails or training wheels or something
link |
00:52:21.380
like that to prevent you from doing bad things.
link |
00:52:24.460
So C plus plus comes out of that tradition.
link |
00:52:28.260
And then it took off from there.
link |
00:52:29.620
I mean, there's also a parallel, slightly parallel track with a little bit of functional
link |
00:52:33.300
stuff with Lisbon and so on.
link |
00:52:35.340
But I guess from that point is just an explosion of languages.
link |
00:52:38.460
Yeah.
link |
00:52:39.460
There's the Java story.
link |
00:52:40.460
There's the JavaScript.
link |
00:52:42.100
There's all the stuff that the cool kids these days are doing with Rust and all that.
link |
00:52:48.420
So what's to use here?
link |
00:52:50.220
You wrote a book, C programming language and C is probably one of the most important languages
link |
00:52:56.820
in the history of programming languages.
link |
00:52:59.260
If you kind of look at impact, what do you think is the most elegant or powerful part
link |
00:53:05.140
of C?
link |
00:53:06.420
Why did it survive?
link |
00:53:07.740
Why did it have such a long lasting impact?
link |
00:53:11.300
I think it found a sweet spot that in of expressiveness that you could really write things in a pretty
link |
00:53:17.980
natural way and efficiency, which was particularly important when computers were not nearly as
link |
00:53:23.820
powerful as they are today.
link |
00:53:25.180
You've got to put yourself back 50 years almost in terms of what computers could do.
link |
00:53:31.300
And that's roughly four or five generations, decades of Moore's law, right?
link |
00:53:37.660
So expressiveness and efficiency and I don't know, perhaps the environment that it came
link |
00:53:44.220
with as well, which was Unix.
link |
00:53:46.460
So it meant if you wrote a program, it could be used on all those computers that ran Unix
link |
00:53:50.420
and that was all of those computers because they were all written in C and that was Unix,
link |
00:53:55.340
the operating system itself was portable as were all the tools.
link |
00:53:58.220
So it all worked together again in one of these things where things fit on each other
link |
00:54:03.600
in a positive cycle.
link |
00:54:06.220
What did it take to write sort of a definitive book, probably definitive book on all of
link |
00:54:11.820
them, like it's more definitive to a particular language than any other book on any other
link |
00:54:16.940
language and did two really powerful things, which is popularized the language, at least
link |
00:54:23.060
from my perspective, maybe you can correct me.
link |
00:54:25.140
And second is created a standard of how this language is supposed to be used and applied.
link |
00:54:33.740
So what did it take?
link |
00:54:35.060
Did you have those kinds of ambitions in mind when working on that?
link |
00:54:38.380
Is this some kind of joke?
link |
00:54:40.180
No, of course not.
link |
00:54:42.940
So it's an accident of timing skill and just luck.
link |
00:54:48.180
A lot of it is, clearly, timing was good.
link |
00:54:51.340
Now, Dennis and I wrote the book in 1977.
link |
00:54:53.740
Dennis Reggie.
link |
00:54:54.740
Yeah, right.
link |
00:54:56.620
And at that point, Unix was starting to spread.
link |
00:54:58.900
I don't know how many there were, but it would be dozens to hundreds of Unix systems
link |
00:55:03.780
and C was also available on other kinds of computers that had nothing to do with Unix.
link |
00:55:08.580
And so the language had some potential.
link |
00:55:13.860
And there were no other books on C. And Bell Labs was really the only source for it.
link |
00:55:20.460
And Dennis, of course, was authoritative because it was his language.
link |
00:55:24.140
And he had written the reference manual, which is a marvelous example of how to write
link |
00:55:28.420
a reference manual, really, really, very, very well done.
link |
00:55:31.540
So I twisted his arm until he agreed to write a book, and then we wrote a book.
link |
00:55:35.740
And the virtue or advantage, at least, I guess, of going first is that then other people have
link |
00:55:41.020
to follow you if they're going to do anything.
link |
00:55:45.060
And I think it worked well because Dennis was a superb writer.
link |
00:55:50.380
I mean, he really, really did.
link |
00:55:51.700
And the reference manual in that book is his period.
link |
00:55:55.020
I had nothing to do with that at all.
link |
00:55:58.820
So just crystal clear prose and very, very well expressed.
link |
00:56:02.900
And then he and I, I wrote most of the expository material.
link |
00:56:08.100
And then he and I sort of did the usual ping ponging back and forth, refining it.
link |
00:56:13.500
But I spent a lot of time trying to find examples that would sort of hang together and that
link |
00:56:17.020
would tell people what they might need to know at about the right time that they should
link |
00:56:20.540
be thinking about needing it.
link |
00:56:23.820
And I'm not sure it completely succeeded, but it mostly worked out fairly well.
link |
00:56:28.260
What do you think is the power of example?
link |
00:56:30.100
I mean, you're the creator, at least one of the first people to do the Hello World
link |
00:56:36.980
program, which is like the example.
link |
00:56:40.780
If aliens discover our civilization hundreds of years from now, it'll probably be Hello
link |
00:56:45.100
World programs just to have broken robot communicating with them with the Hello World.
link |
00:56:52.020
And that's a representative example.
link |
00:56:53.540
So what do you find powerful about examples?
link |
00:56:57.060
I think a good example will tell you how to do something.
link |
00:57:01.780
And it will be representative of, you might not want to do exactly that, but you will
link |
00:57:06.060
want to do something that's at least in that same general vein.
link |
00:57:10.860
And so a lot of the examples in the C book were picked for these very, very simple straightforward
link |
00:57:16.180
text processing problems that were typical of Unix.
link |
00:57:19.660
I want to read input and write it out again.
link |
00:57:23.740
There's a copy command.
link |
00:57:24.740
I want to read input and do something to it and write it out again.
link |
00:57:28.100
There's a grab.
link |
00:57:29.100
And so that kind of find things that are representative of what people want to do and spell those
link |
00:57:36.300
out so that they can then take those and see the core parts and modify them to their taste.
link |
00:57:46.060
And I think that a lot of programming books that I don't look at programming books a tremendous
link |
00:57:51.580
amount these days, but when I do, a lot of them don't do that.
link |
00:57:54.540
They don't give you examples that are both realistic and something you might want to
link |
00:58:00.820
do.
link |
00:58:02.060
Some of them are pure syntax.
link |
00:58:03.980
Here's how you add three numbers.
link |
00:58:05.220
Well, come on, I could figure that out.
link |
00:58:07.420
Tell me how I would get those three numbers into the computer and how I would do something
link |
00:58:11.500
useful with them and then how I put them back out again neatly formatted.
link |
00:58:15.700
And especially if you follow that example, there's something magical of doing something
link |
00:58:19.300
that feels useful.
link |
00:58:20.900
Yeah.
link |
00:58:21.900
Right.
link |
00:58:22.900
So the attempt, it's absolutely not perfect, but the attempt in all cases was to get something
link |
00:58:28.700
that was going to be either directly useful or would be very representative of useful
link |
00:58:35.100
things that a programmer might want to do.
link |
00:58:38.100
But within that vein of fundamentally text processing, reading text, doing something,
link |
00:58:42.900
writing text.
link |
00:58:43.900
So you've also written a book on Go language.
link |
00:58:47.420
I have to admit, so I worked at Google for a while and I've never used Go.
link |
00:58:53.100
Well, you missed something.
link |
00:58:54.500
Well, I know I missed something for sure.
link |
00:58:56.340
I mean, so Go and Rust are two languages that I hear very spoken very highly of and I wish
link |
00:59:05.100
I would like to try.
link |
00:59:06.100
Well, there's a lot of them.
link |
00:59:07.100
There's Julia.
link |
00:59:08.100
There's all these incredible modern languages.
link |
00:59:10.900
But if you can comment before, well, maybe comment on what do you find?
link |
00:59:16.460
Where does Go sit in this broad spectrum of languages?
link |
00:59:19.780
And also, how do you yourself feel about this wide range of powerful, interesting languages
link |
00:59:26.380
that you may never even get to try to explore because of time?
link |
00:59:31.620
So I think, so Go first comes from that same Bell Labs tradition in part, not exclusively,
link |
00:59:39.420
but two of the three creators, Ken Thompson and Rob Pike.
link |
00:59:42.500
So literally the people.
link |
00:59:44.020
Yeah, the people.
link |
00:59:45.700
And then with this very, very useful influence from the European school in particular, the
link |
00:59:51.900
Klaus Speer influence through Robert Griezmer, who was, I guess, a second generation down
link |
00:59:58.220
student at ETH.
link |
01:00:01.260
And so that's an interesting combination of things.
link |
01:00:03.300
And so some ways Go captures the good parts of C. It looks sort of like C. It's sometimes
link |
01:00:10.300
characterized as C for the 21st century.
link |
01:00:14.340
On the surface, it looks very, very much like C. But at the same time, it has some interesting
link |
01:00:19.700
data structuring capabilities.
link |
01:00:22.020
And then I think the part that I would say is particularly useful.
link |
01:00:27.460
And again, I'm not a Go expert, in spite of coauthoring the book, about 90% of the work
link |
01:00:33.100
was done by Alan Donovan, my coauthor, who is a Go expert.
link |
01:00:39.180
But Go provides a very nice model of concurrency.
link |
01:00:42.500
But basically, the cooperating, communicating sequential processes that Tony Horr set forth,
link |
01:00:48.620
I don't know, 40 plus years ago.
link |
01:00:52.740
And Go routines are, to my mind, a very natural way to talk about parallel computation.
link |
01:00:59.700
And in the few experiments I've done with them, they're easy to write and typically
link |
01:01:04.060
it's going to work and very efficient as well.
link |
01:01:07.380
So I think that's one place where Go stands out that that model of parallel computation
link |
01:01:13.060
is very, very easy and nice to work with.
link |
01:01:16.300
Just a comment on that.
link |
01:01:17.300
Do you think C for SAW or the early Unix days for SAW threads and massively parallel computation?
link |
01:01:26.020
I would guess not really.
link |
01:01:27.660
I mean, maybe it was seen but not at the level where it was something you had to do anything
link |
01:01:32.660
about.
link |
01:01:34.540
For a long time, processors got faster and then processors stopped getting faster because
link |
01:01:41.980
of things like power consumption and heat generation.
link |
01:01:46.340
And so what happened instead was that instead of processors getting faster, there started
link |
01:01:50.940
to be more of them.
link |
01:01:52.340
And that's where that parallel thread stuff comes in.
link |
01:01:57.060
So if you can comment on all the other languages, is it break your heart that you'll never
link |
01:02:02.740
get to explore them or how do you feel about the full variety?
link |
01:02:07.540
It's not break my heart, but I would love to be able to try more of these languages.
link |
01:02:13.020
The closest I've come is in class that I often teach in the spring here.
link |
01:02:17.100
It's a programming class and I often give, I have one sort of small example that I will
link |
01:02:24.540
write in as many languages as I possibly can.
link |
01:02:27.260
I've got it in 20 languages at this point.
link |
01:02:32.140
And that's so I do a minimal experiment with a language just to say, okay, I have this
link |
01:02:36.460
trivial task which I understand the task and it should, it takes 15 lines in AUK and not
link |
01:02:42.020
much more in a variety of other languages.
link |
01:02:44.500
So how big is it?
link |
01:02:45.500
How fast does it run and what pain did I go through to learn how to do it?
link |
01:02:51.540
And that's a, it's like, anecdata, right?
link |
01:02:55.580
It's very, very, very narrowly.
link |
01:02:57.700
Ethic data.
link |
01:02:58.700
I like that term.
link |
01:02:59.700
Yeah, but still it's a little sample because you get the, I think the hardest step with
link |
01:03:04.100
the programming language is probably the first step, right?
link |
01:03:06.860
So there you're taking the first step.
link |
01:03:08.860
Yeah.
link |
01:03:09.860
And so my experience with some languages is very positive.
link |
01:03:14.300
Like Lua, a scripting language I had never used and I took my little program, the program
link |
01:03:20.140
is a trivial format or it just takes in lines of text of varying lengths and it puts them
link |
01:03:25.180
out in lines that have no more than 60 characters on each line.
link |
01:03:28.980
So think of it as just kind of the flow of process in a browser or something.
link |
01:03:34.620
So it's a very short program and in Lua, I downloaded Lua and in an hour I had it working,
link |
01:03:41.220
never having written Lua in my life, just going with online documentation.
link |
01:03:44.900
I did the same thing in Scala, which you can think of as a flavor of Java, equally trivial.
link |
01:03:50.980
I did it in Haskell.
link |
01:03:52.180
It took me several weeks, but it did run like a turtle.
link |
01:03:58.260
And I did it in Fortran 90 and it was painful, but it worked.
link |
01:04:06.580
And I tried it in Rust and it took me several days to get it working because the model of
link |
01:04:11.220
memory management was just a little unfamiliar to me.
link |
01:04:14.140
And the problem I had with Rust, and it's back to what we were just talking about, I
link |
01:04:18.580
couldn't find good consistent documentation on Rust.
link |
01:04:21.540
Now this was several years ago and I'm sure things have stabilized, but at the time everything
link |
01:04:25.740
in the Rust world seemed to be changing rapidly and so you would find what looked like a working
link |
01:04:29.780
example and it wouldn't work with the version of the language that I had.
link |
01:04:34.900
So it took longer than it should have.
link |
01:04:37.780
Rust is a language I would like to get back to, but probably won't.
link |
01:04:41.180
I think one of the issues, you have to have something you want to do and if you don't
link |
01:04:44.500
have something that is the right combination of I want to do it and yet I have enough disposable
link |
01:04:50.940
time, whatever, to make it worth learning a new language at the same time, it's never
link |
01:04:56.660
going to happen.
link |
01:04:58.180
So what do you think about another language of JavaScript?
link |
01:05:02.380
That's this, well let me just sort of comment on what I said, when I was brought up, sort
link |
01:05:08.300
of JavaScript was seen as probably like the ugliest language possible and yet it's quite
link |
01:05:16.700
arguably quite possibly taking over and not just the front and the back end of the internet,
link |
01:05:21.740
but possibly in the future taking over everything because they've now learned to make it very
link |
01:05:26.140
efficient.
link |
01:05:27.140
Yeah.
link |
01:05:28.140
And so what do you think about this?
link |
01:05:29.460
Yeah, well I think you've captured it in a lot of ways.
link |
01:05:32.260
When it first came out, JavaScript was deemed to be fairly irregular in an ugly language
link |
01:05:36.380
and certainly in the academy, if you said you were working on JavaScript, people would
link |
01:05:39.620
ridicule you.
link |
01:05:40.620
It was just not fit for academics to work on.
link |
01:05:43.740
I think a lot of that has evolved, the language itself has evolved and certainly the technology
link |
01:05:49.660
of compiling it is fantastically better than it was and so in that sense, it's absolutely
link |
01:05:56.500
a viable solution on back ends as well as the front ends.
link |
01:06:01.460
Used well, I think it's a pretty good language.
link |
01:06:03.460
I've written a modest amount of it and I've played with JavaScript translators and things
link |
01:06:09.380
like that, I'm not a real expert and it's hard to keep up even there with the new things
link |
01:06:14.460
that come along with it.
link |
01:06:17.980
So I don't know whether it will ever take over the world, I think not, but it's certainly
link |
01:06:25.140
an important language and worth knowing more about.
link |
01:06:29.460
There's maybe to get your comment on something which JavaScript and actually most languages
link |
01:06:35.100
as a Python, such a big part of the experience of programming with those languages includes
link |
01:06:41.500
libraries, sort of using building on top of the code that other people have built.
link |
01:06:46.020
I think that's probably different from the experience that we just talked about from
link |
01:06:49.780
Unix and CDays when you're building stuff from scratch.
link |
01:06:53.340
What do you think about this world of essentially leveraging, building up libraries on top of
link |
01:06:57.900
each other and leveraging them?
link |
01:06:59.940
That's a very perceptive kind of question.
link |
01:07:04.180
One of the reasons the programming was fun in the old days was that you were really building
link |
01:07:08.060
it all yourself.
link |
01:07:09.060
The number of libraries you had to deal with was quite small, maybe it was printf or the
link |
01:07:13.020
standard library or something like that.
link |
01:07:16.100
And that is not the case today and if you want to do something in, you mentioned Python
link |
01:07:21.700
and JavaScript and those are the two finding examples, you have to typically download a
link |
01:07:26.700
boatload of other stuff and you have no idea what you're getting, absolutely nothing.
link |
01:07:31.220
I've been doing some playing with machine learning over the last couple of days and gee, something
link |
01:07:37.940
doesn't work.
link |
01:07:38.940
Well, you pip install this and down comes another gazillion megabytes of something and
link |
01:07:44.500
you have no idea what it was.
link |
01:07:46.500
And if you're lucky, it works and if it doesn't work, you have no recourse.
link |
01:07:50.940
There's absolutely no way you could figure out which in these thousand different packages.
link |
01:07:55.380
And I think it's worse in the NPM environment for JavaScript.
link |
01:08:00.420
I think there's less discipline, less control there.
link |
01:08:02.620
And there's aspects of not just not understanding how it worked, but there's security issues,
link |
01:08:08.020
there's robustness issues, so you don't want to run a nuclear power plant using JavaScript,
link |
01:08:12.900
essentially.
link |
01:08:13.900
Probably not.
link |
01:08:14.900
So speaking to the variety of languages, do you think that variety is good or do you
link |
01:08:21.540
hope think that over time we should converge towards one, two, three programming languages
link |
01:08:27.460
that you mentioned to the bell out days when people could sort of the community of it.
link |
01:08:33.020
And the more languages you have, the more you separate the communities.
link |
01:08:36.900
There's the Ruby community, there's the Python community, there's C++ community.
link |
01:08:42.780
Do you hope that they'll unite one day to just one or two languages?
link |
01:08:47.660
I certainly don't hope it.
link |
01:08:48.820
I'm not sure that that's right, because I honestly don't think there is one language
link |
01:08:51.780
that will suffice for all the programming needs of the world.
link |
01:08:55.500
Are there too many at this point?
link |
01:08:56.980
Well, arguably.
link |
01:08:58.820
But I think if you look at the distribution of how they are used, there's something called
link |
01:09:05.060
a dozen languages that probably account for 95% of all programming at this point, and
link |
01:09:11.260
that doesn't seem unreasonable.
link |
01:09:13.940
And then there's another, well, 2,000 languages that are still in use that nobody uses and
link |
01:09:20.660
or at least don't use in any quantity.
link |
01:09:23.420
But I think new languages are a good idea in many respects, because they're often a chance
link |
01:09:27.820
to explore an idea of how a language might help.
link |
01:09:32.860
I think that's one of the positive things about functional languages.
link |
01:09:36.540
For example, they're a particularly good place where people have explored ideas that at the
link |
01:09:43.580
time didn't seem feasible, but ultimately have wound up as part of mainstream languages
link |
01:09:49.420
as well.
link |
01:09:50.420
They just go back as early as recursion and lisp and then follow forward with functions
link |
01:09:55.340
as first class citizens and pattern based languages and, gee, I don't know, closures
link |
01:10:02.140
and just on and on and on lambdas.
link |
01:10:05.180
Interesting ideas that showed up first in, let's call it broadly, the functional programming
link |
01:10:09.780
community and then find their way into mainstream languages.
link |
01:10:13.260
Yeah, it's a playground for rebels.
link |
01:10:15.660
Yeah, exactly.
link |
01:10:18.140
And so I think the languages in the playground themselves are probably not going to be the
link |
01:10:23.340
mainstream, at least for some while, but the ideas that come from there are invaluable.
link |
01:10:30.140
So let's go to something that when I found out recently, so I've known that you've done
link |
01:10:35.260
a million things, but one of the things I wasn't aware of that you had a role in ample.
link |
01:10:40.940
Before you interrupt me by minimizing your role in it.
link |
01:10:43.900
Ample is for minimizing functions.
link |
01:10:46.500
Yeah, minimizing functions, right, exactly.
link |
01:10:51.100
Can I just say that the elegance and abstraction power of ample is incredible when I first
link |
01:10:58.020
came to it about 10 years ago or so.
link |
01:11:01.460
Can you describe what is the ample language?
link |
01:11:04.220
Sure.
link |
01:11:05.220
So ample is a language for mathematical programming, technical term, think of it as linear programming
link |
01:11:10.700
that is setting up systems of linear equations that are of some sort of system of constraints.
link |
01:11:18.900
So that you have a bunch of things that have to be less than this, greater than that, whatever,
link |
01:11:23.220
and you're trying to find a set of values for some decision variables that will maximize
link |
01:11:29.500
or minimize some objective function.
link |
01:11:32.380
So it's a way of solving a particular kind of optimization problem, a very formal sort
link |
01:11:38.900
of optimization problem.
link |
01:11:40.100
But one that's exceptionally useful.
link |
01:11:42.740
And it specifies that there's objective function constraints and variables that become separate
link |
01:11:48.100
from the data it operates on.
link |
01:11:50.860
So that kind of separation allows you to put on different hats.
link |
01:11:58.180
One put the hat of an optimization person and then put another hat of a data person
link |
01:12:03.260
and dance back and forth and also separate the actual solvers, the optimization systems
link |
01:12:10.620
that do the solving, that you can have other people come to the table and then build their
link |
01:12:14.900
solvers, whether it's linear or nonlinear, convex, nonconvex, that kind of stuff.
link |
01:12:21.900
So what is the, maybe you can comment how you got into that world and what is the beautiful
link |
01:12:31.980
or interesting idea to you from the world of optimization?
link |
01:12:35.660
Sure.
link |
01:12:36.660
So I preface it by saying I'm absolutely not an expert on this and most of the important
link |
01:12:41.940
work in Ample comes from my two partners in crime on that, Bob Forer, who was a professor
link |
01:12:47.780
of and in the industrial engineering and management science department at Northwestern and my
link |
01:12:52.740
colleague at Bell Labs, Dave Gay, who is a numerical analyst and optimization person.
link |
01:12:59.100
So the deal is linear programming.
link |
01:13:02.660
Preface this by saying...
link |
01:13:03.660
Well, let's stay with linear programming.
link |
01:13:05.220
Yeah, linear programming is the simplest example of this.
link |
01:13:07.700
So linear programming is taught in school is that you have a big matrix, which is always
link |
01:13:11.660
called A and you say AX is less than or equal to B. So B is a set of constraints, X is the
link |
01:13:16.860
decision variables, and A as to how the decision variables are combined to set up the various
link |
01:13:23.820
constraints.
link |
01:13:24.820
A is a matrix and X and B are vectors, and then there's an objective function, which
link |
01:13:30.100
is just the sum of a bunch of X's and some coefficients on them, and yet that's the thing
link |
01:13:34.300
you want to optimize.
link |
01:13:37.180
The problem is that in the real world, that matrix A is a very, very, very intricate,
link |
01:13:43.660
very large and very sparse matrix where the various components of the model are distributed
link |
01:13:49.100
among the coefficients in a way that is totally unobvious to anybody.
link |
01:13:55.580
And so what you need is some way to express the original model, which you and I would
link |
01:14:00.700
write.
link |
01:14:01.700
You know, we'd write mathematics on the board, the sum of this is greater than the sum of
link |
01:14:04.980
that kind of thing.
link |
01:14:06.580
So you need a language to write those kinds of constraints, and Bob Forer for a long time
link |
01:14:12.220
had been interested in modeling languages, languages that made it possible to do this.
link |
01:14:16.580
There was a modeling language around called GAMS, the General Algebraic Modeling System,
link |
01:14:21.380
but it looked very much like Fortran, it was kind of clunky.
link |
01:14:24.860
And so Bob spent a sabbatical year at Bell Labs in 1984, and he was in the office across
link |
01:14:32.260
from me, and it's always geography, and he and Dave Gay and I started talking about this
link |
01:14:38.500
kind of thing, and he wanted to design a language that would make it so that you could take these
link |
01:14:44.900
algebraic specifications, you know, summation signs over sets, and that you would write
link |
01:14:50.380
on the board and convert them into basically this A matrix, and then pass that off to a
link |
01:14:57.820
solver, which is an entirely separate thing.
link |
01:15:01.740
And so we talked about the design of the language, I don't remember any of the details
link |
01:15:06.460
of this now, but it's kind of an obvious thing, you're just writing out mathematical expressions
link |
01:15:11.140
in a Fortran like, sorry, an algebraic, but textual like language.
link |
01:15:17.260
And I wrote the first version of this Ample program, my first C++ program.
link |
01:15:25.140
And
link |
01:15:26.140
That's written in C++?
link |
01:15:27.140
Yeah.
link |
01:15:28.140
And so I did that fairly quickly.
link |
01:15:31.060
We wrote, it was, you know, 3,000 lines or something, so it wasn't very big, but it sort
link |
01:15:35.100
of showed the feasibility of it that you could actually do something that was easy for people
link |
01:15:38.860
to specify models and convert it into something that a solver could work with, at the same
link |
01:15:45.100
time, as you say, the model and the data are separate things.
link |
01:15:47.940
So one model would then work with all kinds of different data in the same way that lots
link |
01:15:52.060
of programs do the same thing, but with different data.
link |
01:15:54.500
So one of the really nice things is the specification of the models, human, just kind of like as
link |
01:16:00.260
you say, it's human readable, like I literally, I remember on stuff I worked, I would send
link |
01:16:06.100
it to colleagues that I'm pretty sure never programmed in their life, just to understand
link |
01:16:13.260
what the optimization problem is.
link |
01:16:15.740
I think how hard is it to convert that?
link |
01:16:18.060
You said you there's a first prototype in C++ to convert that into something that could
link |
01:16:22.280
actually be used by the solver.
link |
01:16:24.380
It's not too bad because most of the solvers have some mechanism that lets them import
link |
01:16:28.580
a model in a form.
link |
01:16:30.500
It might be as simple as the matrix itself in just some representation.
link |
01:16:35.260
Or if you're doing things that are not linear programming, then there may be some mechanism
link |
01:16:39.660
that lets you provide things like functions to be called or other constraints on the model.
link |
01:16:48.580
So all Ample does is to generate that kind of thing and then solver deals with all the
link |
01:16:53.700
hard work.
link |
01:16:54.700
And then when the solver comes back with numbers, Ample converts those back into your original
link |
01:16:59.820
form so you know how much of each thing you should be buying or making or shipping or
link |
01:17:04.300
whatever.
link |
01:17:06.540
So we did that in 84 and I haven't had a lot to do with it since, except that we wrote
link |
01:17:12.700
a couple of versions of a book on it.
link |
01:17:14.300
Which is one of the greatest books ever written.
link |
01:17:16.500
I love that book.
link |
01:17:17.500
I don't know why.
link |
01:17:20.100
It's an excellent book.
link |
01:17:21.100
Bob Forer wrote most of it and so it's really, really well done.
link |
01:17:23.980
He must have been a dynamite teacher.
link |
01:17:25.700
And typeset in latex.
link |
01:17:27.300
No, no, no.
link |
01:17:28.300
Are you kidding?
link |
01:17:29.300
I remember liking the typography, so I don't know.
link |
01:17:33.020
We did it with TROF.
link |
01:17:34.460
I don't even know what that is.
link |
01:17:35.540
Yeah, exactly.
link |
01:17:36.540
You're too young.
link |
01:17:37.540
Oh boy.
link |
01:17:38.540
I think of TROF as a predecessor to the tech family of things.
link |
01:17:44.380
It's a formatter that was done at Bell Labs in this same period of the very early 70s that
link |
01:17:50.100
predates tech and things like that by five to 10 years.
link |
01:17:54.820
But it was nevertheless, I'm going by memories, I remember it being beautiful.
link |
01:17:59.500
Yeah, it was nicely done.
link |
01:18:02.060
Outside of Unix, Seaog, Golang, all the things we talked about, all the amazing work you've
link |
01:18:06.940
done, you've also done work in graph theory.
link |
01:18:12.900
Let me ask this crazy out there question.
link |
01:18:16.580
If you had to make a bet and I had to force you to make a bet, do you think P equals NP?
link |
01:18:23.580
The answer is no, although I've told that somebody asked Jeff Dean if that was under
link |
01:18:28.260
what conditions P would equal NP, and he said either P is zero or N is one, or vice first
link |
01:18:34.420
I've forgotten.
link |
01:18:35.420
P is zero, N is one.
link |
01:18:36.420
Jeff Dean is a lot smarter than I am.
link |
01:18:40.420
But your intuition is...
link |
01:18:42.420
I have no intuition, but I've got a lot of colleagues who've got intuition and their
link |
01:18:47.060
betting is no.
link |
01:18:48.380
That's the popular bet.
link |
01:18:52.820
What is computational complexity theory?
link |
01:18:55.860
Do you think these kinds of complexity classes, especially as you've taught in this modern
link |
01:19:00.940
world, are still a useful way to understand the hardness of problems?
link |
01:19:05.940
I don't do that stuff.
link |
01:19:07.420
The last time I touched anything to do with that was before it was invented, because it's
link |
01:19:13.860
literally true.
link |
01:19:14.860
I did my PhD thesis on graph...
link |
01:19:17.780
Before big O notation.
link |
01:19:18.940
Oh, absolutely.
link |
01:19:19.940
Before, I did this in 1968, and I worked on graph partitioning, which is this question.
link |
01:19:26.820
You've got a graph that is nodes and edges kind of graph, and the edges have weights,
link |
01:19:31.780
and you just want to divide the nodes into two piles of equal size, so that the number
link |
01:19:36.300
of edges that goes from one side to the other is as small as possible.
link |
01:19:41.700
You developed, so that problem is hard.
link |
01:19:45.580
Well, as it turns out, I worked with Shen Lin at Bell Labs on this, and we were never
link |
01:19:51.380
able to come up with anything that was guaranteed to give the right answer.
link |
01:19:54.220
We came up with heuristics that worked pretty darn well, and I peeled off some special cases
link |
01:20:00.260
for my thesis, but it was just hard.
link |
01:20:02.460
That was just about the time that Steve Cook was showing that there were classes of problems
link |
01:20:06.380
that appeared to be really hard, of which graph partitioning was one.
link |
01:20:11.340
My expertise, such as it was, totally predates that development.
link |
01:20:16.340
Oh, interesting.
link |
01:20:17.340
So the heuristic, which now cares the two of yours names for the traveling salesman
link |
01:20:23.260
problem and for the graph partitioning, that was like, how did you, you weren't even thinking
link |
01:20:28.180
in terms of classes.
link |
01:20:29.180
You were just trying to find a heuristic that kind of does the job pretty well.
link |
01:20:34.500
You were trying to find something that did the job, and there was nothing that you would
link |
01:20:38.420
call, let's say, a closed form or algorithmic thing that would give you a guaranteed right
link |
01:20:43.300
answer.
link |
01:20:44.300
I mean, compare graph partitioning to Max Flowman cut or something like that.
link |
01:20:50.460
That's the same problem, except there's no constraint on the number of nodes on one
link |
01:20:54.180
side or the other of the cut, and that means it's an easy problem, at least as I understand
link |
01:20:59.940
it, whereas the constraint that says the two have to be constrained in size makes it a
link |
01:21:03.780
hard problem.
link |
01:21:04.780
Yeah, so the Robert Frost has that poem where you have to choose two paths.
link |
01:21:09.340
So why did you, is there another alternate universe in which you pursued the Don Knuth
link |
01:21:16.140
path of algorithm design sort of?
link |
01:21:20.060
Not smart enough.
link |
01:21:21.060
Not smart enough.
link |
01:21:25.660
You're infinitely modest, but so you pursued your kind of love of programming.
link |
01:21:30.260
I mean, when you look back to those, I mean, just looking into that world, does that just
link |
01:21:35.740
seem like a distant world of theoretical computer science?
link |
01:21:40.540
Then is it fundamentally different from the world of programming?
link |
01:21:43.980
I don't know.
link |
01:21:45.380
I mean, certainly in all seriousness, I just didn't have the talent for it.
link |
01:21:49.620
When I got here as a grad student at Princeton and I started to think about research at the
link |
01:21:54.100
end of my, I don't know, first year or something like that, I worked briefly with John Hopcroft
link |
01:21:58.980
who was an absolutely, you know, he mentioned during award winner, et cetera, a great guy.
link |
01:22:04.180
And it became crystal clear I was not cut out for this stuff, period, okay.
link |
01:22:09.820
And so I moved into things where I was more cut out for it and that tended to be things
link |
01:22:15.660
like writing programs and then ultimately writing books.
link |
01:22:20.860
You said that in Toronto as an undergrad, you did a senior thesis or a literature survey
link |
01:22:26.340
on artificial intelligence.
link |
01:22:28.860
This was 1964.
link |
01:22:31.180
Correct.
link |
01:22:32.380
What was the AI landscape, ideas, dreams at that time?
link |
01:22:37.140
I think that was one of the, well, you've heard of AI winters.
link |
01:22:40.500
This is whatever the opposite was, AI summer or something.
link |
01:22:43.100
It was one of these things where people thought that, boy, we could do anything with computers
link |
01:22:49.180
that all these hard problems, computers will solve them.
link |
01:22:52.740
They will do machine translation.
link |
01:22:54.460
They will play games like chess at, they will do machine, you know, prove theorems in geometry.
link |
01:23:02.220
There are all kinds of examples like that where people thought, boy, we could really
link |
01:23:07.140
do those sorts of things.
link |
01:23:10.300
And you know, I read the Kool Aid in some sense, there's a wonderful collection of papers
link |
01:23:16.820
called computers and thought that was published in about that era and people were very optimistic.
link |
01:23:22.580
And then of course it turned out that what people thought was just a few years down the
link |
01:23:26.940
pike was more than a few years down the pike.
link |
01:23:31.700
And some parts of that are more or less now sort of under control.
link |
01:23:36.460
We finally do play games like go and chess and so on better than people do.
link |
01:23:41.300
But there are others and machine translation is a lot better than it used to be.
link |
01:23:45.260
But that's, you know, 50 close to 60 years of progress and a lot of evolution in hardware
link |
01:23:51.180
and a tremendous amount more data upon which you can build systems that actually can learn
link |
01:23:57.420
from some of that.
link |
01:23:59.140
And the infrastructure to support developers working together, like an open source movement,
link |
01:24:05.660
the internet period is also an empowering.
link |
01:24:08.940
But what lesson do you draw from that, the opposite of winter, that optimism?
link |
01:24:14.860
Well, I guess the lesson is that in the short run, it's pretty easy to be too pessimistic
link |
01:24:23.460
or maybe too optimistic and in the long run, you probably shouldn't be too pessimistic.
link |
01:24:27.140
I'm not saying that very well.
link |
01:24:28.900
It reminds me of this remark from Arthur Clark, a science fiction author who says, you know,
link |
01:24:34.740
when some distinguished but elderly person says that something is possible, he's probably
link |
01:24:40.460
right.
link |
01:24:41.460
And if he says it's impossible, he's almost surely wrong.
link |
01:24:44.420
But you don't know what the time scale is.
link |
01:24:45.820
The time scale is critical, right?
link |
01:24:48.420
So what are your thoughts on this new summer of AI now in the work with machine learning
link |
01:24:54.220
and neural networks?
link |
01:24:55.220
You've kind of mentioned that you started to try to explore and look into this world
link |
01:24:59.580
that seems fundamentally different from the world of heuristics and algorithms like search,
link |
01:25:06.660
it's now purely sort of trying to take huge amounts of data and learn from that data,
link |
01:25:12.380
create programs from the data.
link |
01:25:14.500
Yeah.
link |
01:25:15.500
Look, I think it's very interesting.
link |
01:25:16.940
I am incredibly far from an expert.
link |
01:25:19.940
Most of what I know I've learned from my students and they're probably disappointed in how little
link |
01:25:24.900
I've learned from them.
link |
01:25:26.540
But I think it has tremendous potential for certain kinds of things.
link |
01:25:30.660
I mean, games is one where it obviously has had any effect on some of the others as well.
link |
01:25:35.900
I think there's, and this is speaking from definitely not expertise, I think there are
link |
01:25:41.220
serious problems in certain kinds of machine learning, at least because what they're learning
link |
01:25:47.100
from is the data that we give them.
link |
01:25:49.300
And if the data we give them has something wrong with it, then what they learned from
link |
01:25:53.260
it is probably wrong too.
link |
01:25:54.860
And the obvious thing is some kind of bias in the data, that the data has stuff in it
link |
01:26:00.660
like, I don't know, women aren't as good as men as men at something, okay?
link |
01:26:05.620
That's just flat wrong.
link |
01:26:07.620
But if it's in the data because of historical treatment, then that machine learning stuff
link |
01:26:13.420
will propagate that.
link |
01:26:15.140
And that is a serious worry.
link |
01:26:18.180
The positive part of that is what machine learning does is reveal the bias in the data
link |
01:26:24.580
and puts a mirror to our own society.
link |
01:26:26.740
And in so doing helps us remove the bias, helps us work on ourselves, puts a mirror to ourselves.
link |
01:26:35.420
Yeah.
link |
01:26:36.420
That's an optimistic point of view.
link |
01:26:37.700
And if it works that way, that would be absolutely great.
link |
01:26:40.300
And what I don't know is whether it does work that way or whether the AI mechanisms or machine
link |
01:26:46.700
learning mechanisms reinforce and amplify things that have been wrong in the past.
link |
01:26:52.700
And I don't know, but I think that's a serious thing that we have to be concerned about.
link |
01:26:58.860
Let me ask you an outdoor question.
link |
01:27:00.500
Okay.
link |
01:27:01.500
I know nobody knows, but what do you think it takes to build a system of human level
link |
01:27:06.620
intelligence?
link |
01:27:07.620
That's been the dream from the 60s.
link |
01:27:09.940
We talk about games, about language, about image recognition, but really the dream is
link |
01:27:16.420
to create human level or super human level intelligence.
link |
01:27:19.700
What do you think it takes to do that?
link |
01:27:21.340
And are we close?
link |
01:27:23.060
I haven't a clue and I don't know, roughly speaking.
link |
01:27:26.020
I mean, this was trying to trick you into a high class assessment.
link |
01:27:29.500
Yeah, I mean, Turing talked about this in his paper on machine intelligence back in,
link |
01:27:34.460
jeez, I don't know, early fifties or something like that.
link |
01:27:36.740
And he had the idea of the Turing test and I don't know what the Turing test is.
link |
01:27:40.700
It's a good test of intelligence.
link |
01:27:41.700
I don't know.
link |
01:27:42.700
It's an interesting test.
link |
01:27:43.700
At least it's in some vague sense objective, whether you can read anything into the conclusions
link |
01:27:48.380
is a different story.
link |
01:27:50.500
Do you have worries, concerns, excitement about the future of artificial intelligence?
link |
01:27:57.020
So there's a lot of people who are worried.
link |
01:27:59.100
And you can speak broadly than just artificial intelligence is basically computing, taking
link |
01:28:04.580
over the world in various forms.
link |
01:28:06.780
Are you excited by this future, this possibility of computing being everywhere?
link |
01:28:12.500
Or are you worried?
link |
01:28:14.740
It's some combination of those.
link |
01:28:16.380
I think almost all technologies over the long run are for good, but there's plenty of examples
link |
01:28:24.500
where they haven't been good either over a long run for some people or over a short
link |
01:28:29.580
run and computing is one of those and AI within it is going to be one of those as well.
link |
01:28:36.940
But computing broadly for just a today example is privacy, that the use of things like social
link |
01:28:45.340
media and so on means that and the commercial surveillance means that there's an enormous
link |
01:28:50.420
amount more known about us by people, other businesses, government, whatever, than perhaps
link |
01:28:57.660
one ought to feel comfortable with.
link |
01:28:59.660
So that's an example.
link |
01:29:01.660
So that's an example of a possible negative effect of computing being everywhere.
link |
01:29:10.260
It's an interesting one because it could also be a positive if leveraged correctly.
link |
01:29:16.300
There's a big if there.
link |
01:29:18.220
So I have a deep interest in human psychology and humans there seem to be very paranoid
link |
01:29:25.060
about this data thing that varies depending on age group.
link |
01:29:31.420
It seems like the younger folks, so it's exciting to me to see what society looks like 50 years
link |
01:29:36.380
from now that the concerns about privacy might be flipped on their head based purely on human
link |
01:29:42.020
psychology versus actual concerns or not.
link |
01:29:47.900
What do you think about Moore's law?
link |
01:29:49.980
You said a lot of stuff we've talked about with programming languages in their design
link |
01:29:55.660
and their ideas are come from the constraints and the systems they operate in.
link |
01:30:00.540
Do you think Moore's law, the exponential improvement of systems will continue indefinitely?
link |
01:30:09.740
There's mix of opinions on that currently.
link |
01:30:12.540
Or do you think there'll be a plateau?
link |
01:30:18.540
Well, the frivolous answer is no exponential can go on forever, run out of something.
link |
01:30:26.300
Just as we said, time scale matters.
link |
01:30:27.780
So if it goes on long enough, that might be all we need.
link |
01:30:30.940
Yeah, right.
link |
01:30:31.940
It won't matter to us.
link |
01:30:33.420
So I don't know.
link |
01:30:34.420
We've seen places where Moore's law has changed.
link |
01:30:35.980
For example, mentioned earlier, processors don't get faster anymore, but you use that
link |
01:30:42.860
same growth of the ability to put more things in a given area to grow them horizontally
link |
01:30:49.580
instead of vertically as it were.
link |
01:30:51.180
So you can get more and more processors or memory or whatever on the same chip.
link |
01:30:55.700
Is that going to run into a limitation, presumably, because at some point you get down to the
link |
01:31:01.620
individual atoms.
link |
01:31:03.460
And so you've got to find some way around that.
link |
01:31:05.780
Will we find some way around that?
link |
01:31:07.340
I don't know.
link |
01:31:08.340
I just said that if I say it won't, I'll be wrong.
link |
01:31:11.980
Perhaps we will.
link |
01:31:12.980
So I just talked to Jim Keller and he says, he actually describes, he argues that the
link |
01:31:16.980
Moore's law will continue for a long, long time because you mentioned the atom.
link |
01:31:21.900
We actually have, I think, a thousand fold increase, still decrease in transit size,
link |
01:31:29.300
still possible before we get to the quantum level.
link |
01:31:32.140
There's still a lot of possibilities, so he thinks he'll continue indefinitely, which
link |
01:31:36.540
is an interesting optimistic viewpoint.
link |
01:31:40.820
But how do you think the programming languages will change with this increase?
link |
01:31:45.660
Whether we hit a wall or not, what do you think?
link |
01:31:49.900
Do you think there'll be a fundamental change in the way programming languages are designed?
link |
01:31:54.500
I don't know about that.
link |
01:31:55.500
I think what will happen is continuation of what we see in some areas, at least, which
link |
01:32:02.140
is that more programming will be done by programs than by people and that more will be done
link |
01:32:10.860
by sort of declarative rather than procedural mechanisms where I say, I want this to happen.
link |
01:32:17.460
You figure out how.
link |
01:32:20.420
And that is, in many cases, this point, domain of specialized languages for narrow domains,
link |
01:32:28.860
but you can imagine that broadening out.
link |
01:32:31.980
And so I don't have to say so much in so much detail.
link |
01:32:36.140
Some collection of software, let's call it languages or programs or something, will figure
link |
01:32:41.900
out how to do what I want to do.
link |
01:32:45.460
So increased levels of abstraction.
link |
01:32:49.020
And one day, getting to the human level, we're going to just use natural language.
link |
01:32:54.660
So you taught, still teach, of course, computers in our world here at Princeton that introduces
link |
01:33:00.500
computing and programming to nonmajors.
link |
01:33:05.820
Just from that experience, what advice do you have for people who don't know anything
link |
01:33:09.340
about programming but are kind of curious about this world or programming seems to become
link |
01:33:14.220
more and more of a fundamental skill that people need to be at least aware of?
link |
01:33:18.260
Yeah.
link |
01:33:19.260
Well, I could recommend a good book.
link |
01:33:20.260
What's that?
link |
01:33:21.260
The book I wrote for the course.
link |
01:33:24.300
I think this is one of these questions of, should everybody know how to program?
link |
01:33:28.540
And I think the answer is probably not, but I think everybody should at least understand
link |
01:33:32.900
sort of what it is so that if you say to somebody, I'm a programmer, they have a notion of what
link |
01:33:37.340
that might be.
link |
01:33:38.340
Or if you say, this is a program, or this was decided by a computer running a program
link |
01:33:43.500
that they have some vague, intuitive understanding, an accurate understanding of what that might
link |
01:33:50.300
imply.
link |
01:33:52.700
So part of what I'm doing in this course, which is very definitely for non technical
link |
01:33:56.900
people and a typical person in it is a history or English major, try and explain how computers
link |
01:34:03.140
work, how they do their thing, what programming is, how you write a program, and how computers
link |
01:34:09.660
talk to each other, and what do they do when they're talking to each other.
link |
01:34:14.700
And then I would say nobody, very rarely, does anybody in that course go on to become
link |
01:34:22.220
a real serious programmer, but at least they've got a somewhat better idea of what all this
link |
01:34:27.780
stuff is about, not just the programming, but the technology behind computers and communications.
link |
01:34:32.700
Do they try and write a program themselves?
link |
01:34:35.620
Oh yeah.
link |
01:34:36.620
Yeah.
link |
01:34:37.620
A very small amount.
link |
01:34:38.620
And we introduced them to how machines work at a level below high level language.
link |
01:34:43.060
So we have a kind of a toy machine that has a very small repertoire, a dozen instructions,
link |
01:34:47.860
and they write trivial assembly language programs for that.
link |
01:34:51.140
Really?
link |
01:34:52.140
Wow.
link |
01:34:53.140
That's interesting.
link |
01:34:54.140
So can you just, if you were to give a flavor to people of the programming world, of the
link |
01:34:57.900
computing world, what are the examples they should go with?
link |
01:35:01.980
So a little bit of assembly to get a sense at the lowest level of what the program is
link |
01:35:07.380
really doing.
link |
01:35:08.860
Yeah.
link |
01:35:09.860
I mean, in some sense, there's no such thing as the lowest level because you can keep going
link |
01:35:13.340
down, but that's the place where I drew the line.
link |
01:35:15.660
So the idea that computers have a fairly small repertoire of very simple instructions that
link |
01:35:21.100
they can do, like add and subtract and branch and so on, as you mentioned earlier.
link |
01:35:27.900
And that you can write code at that level and it will get things done.
link |
01:35:33.420
And then you have the levels of abstraction that we get with higher level languages, like
link |
01:35:38.140
Fortran or C or whatever, and that makes it easier to write the code and less dependent
link |
01:35:43.140
on particular architectures.
link |
01:35:46.100
And then we talk about a lot of the different kinds of programs that they use all the time
link |
01:35:50.540
that they don't probably realize are programs like they're running macOS on their computers
link |
01:35:57.540
or maybe Windows, and they're downloading apps on their phones, and all of those things
link |
01:36:01.740
are programs that are just what we just talked about except at a grand scale.
link |
01:36:07.740
Yeah.
link |
01:36:08.740
It's easy to forget that they're actual programs, that people program.
link |
01:36:11.980
There's engineers that wrote those things.
link |
01:36:14.140
Yeah.
link |
01:36:15.140
Right.
link |
01:36:16.140
And so in a way, I'm expecting them to make an enormous conceptual leap from their five
link |
01:36:21.740
or 10 line toy assembly language thing that adds two or three numbers to something that
link |
01:36:28.900
is a browser on their phone or whatever, but it's really the same thing.
link |
01:36:33.700
So if you look at the broad strokes of history, what do you think the world, like how do you
link |
01:36:39.940
think the world changed because of computers?
link |
01:36:42.980
It's hard to sometimes see the big picture when you're in it, but I guess I'm asking
link |
01:36:47.940
if there's something you've noticed over the years that, like you were mentioning, the
link |
01:36:54.580
students are more distracted looking at their, now there's a device to look at.
link |
01:36:58.780
Well, I think computing has changed a tremendous amount, obviously, but I think one aspect
link |
01:37:03.340
of that is the way that people interact with each other, both locally and far away.
link |
01:37:09.180
And when I was the age of those kids, making a phone call to somewhere was a big deal because
link |
01:37:15.660
it cost serious money, and this was in the 60s, right?
link |
01:37:20.780
And today, people don't make phone calls, they send texts or something like that.
link |
01:37:25.800
So there's up and down in what people do.
link |
01:37:29.740
People think nothing of having correspondence, regular meetings, video, whatever with friends
link |
01:37:37.020
or family or whatever in any other part of the world, and they don't think about that
link |
01:37:41.700
at all.
link |
01:37:43.380
And so that's just the communication aspect of it.
link |
01:37:48.380
Do you think that brings us closer together or does it make us, does it take us away from
link |
01:37:57.180
the closeness of human to human contact?
link |
01:37:59.100
I think it depends a lot on all kinds of things.
link |
01:38:02.940
So I trade mail with my brother and sister in Canada much more often than I used to talk
link |
01:38:07.540
to them on the phone.
link |
01:38:08.940
So probably every two or three days, I get something or send something to them.
link |
01:38:14.780
Because 20 years ago, I probably wouldn't have talked to them on the phone nearly as
link |
01:38:20.300
much.
link |
01:38:21.300
So in that sense, that's brought my brother and sister and I closer together.
link |
01:38:24.180
That's a good thing.
link |
01:38:25.860
I watch the kids on campus and they're mostly walking around with their heads down, fooling
link |
01:38:31.460
with their phones 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 in some ways.
link |
01:38:40.700
There's sociological research that says people are in fact not as close together as they
link |
01:38:45.380
used to be.
link |
01:38:46.380
I don't know whether that's really true, but I can see potential downsides and kids
link |
01:38:52.460
where you think, come on, wake up and just smell the coffee or whatever.
link |
01:38:56.900
That's right.
link |
01:38:57.900
But if you look at, again, nobody can predict the future, but are you excited, kind of touched
link |
01:39:03.220
this a little bit with AI, but are you excited by the future in the next 10, 20 years that
link |
01:39:08.780
computing will bring?
link |
01:39:11.860
You were there when there was no computers really.
link |
01:39:16.060
And now computers are everywhere, all over the world and Africa and Asia and just every
link |
01:39:22.500
person, almost every person in the world has a device.
link |
01:39:25.660
So are you hopeful, optimistic about that future?
link |
01:39:30.940
It's mixed, if the truth be told.
link |
01:39:32.380
I mean, I think there are some things about that that are good.
link |
01:39:34.860
I think there's the potential for people to improve their lives all over the place and
link |
01:39:39.220
that's obviously good.
link |
01:39:41.340
And at the same time, at least in the short run, you can see lots and lots of bad as people
link |
01:39:46.260
become more tribalistic or parochial in their interests and there's an enormous amount more
link |
01:39:51.940
us than them and people are using computers in all kinds of ways to mislead or misrepresent
link |
01:39:58.020
or flat out lie about what's going on and that is affecting politics locally and I think
link |
01:40:03.020
everywhere in the world.
link |
01:40:05.620
Yeah, the long term effect on political systems and so on, who knows.
link |
01:40:10.780
Who knows indeed.
link |
01:40:15.620
People now have a voice, which is a powerful thing.
link |
01:40:18.860
People who are oppressed have a voice, but also everybody has a voice and the chaos that
link |
01:40:24.820
emerges from that is fascinating to watch.
link |
01:40:27.700
It's kind of scary.
link |
01:40:29.500
If you can go back and relive a moment in your life, one that made you truly happy outside
link |
01:40:35.940
of family or was profoundly transformative.
link |
01:40:40.100
Is there a moment or moments that jump out at you from memory?
link |
01:40:46.100
I don't think specific moments.
link |
01:40:47.980
I think there were lots and lots and lots of good times at Bell Labs where you would
link |
01:40:51.340
build something and it worked.
link |
01:40:54.900
Huh.
link |
01:40:55.900
Did I say it worked?
link |
01:40:56.900
So the moment it worked.
link |
01:40:57.900
Yeah.
link |
01:40:58.900
And somebody used it and they said, gee, that's neat.
link |
01:41:01.340
Those kinds of things happened quite often in that sort of golden era in the 70s when
link |
01:41:07.980
Unix was young and there was all this low hanging fruit and interesting things to work
link |
01:41:13.100
on and a group of people who kind of, we were all together in this and if you did something,
link |
01:41:18.940
they would try it out for you.
link |
01:41:20.820
And I think that was in some sense a really, really good time.
link |
01:41:24.620
And AUK was AUK an example of that, when you built it and people used it.
link |
01:41:29.500
Yeah, absolutely.
link |
01:41:30.500
And now millions of people use it.
link |
01:41:32.780
And all your stupid mistakes are right there for them to look at, right?
link |
01:41:36.540
So it's mixed.
link |
01:41:37.540
Yeah.
link |
01:41:38.540
It's terrifying, vulnerable, but it's beautiful because it does have a positive impact on
link |
01:41:42.540
so, so many people.
link |
01:41:43.900
So I think there's no better way to end it.
link |
01:41:47.340
Brian, thank you so much for talking.
link |
01:41:48.340
It was an honor.
link |
01:41:49.340
Okay.
link |
01:41:50.340
My pleasure.
link |
01:41:51.340
Good fun.
link |
01:41:53.900
Thank you for listening to this conversation with Brian Kernigan.
link |
01:41:56.660
And thank you to our sponsors, Aidsleep Mattress and Raycon Earbuds.
link |
01:42:02.500
Please consider supporting this podcast by going to Aidsleep.com slash Lex and to buy
link |
01:42:09.380
Raycon.com slash Lex.
link |
01:42:12.340
Click the links, buy the stuff.
link |
01:42:14.700
These both are amazing products.
link |
01:42:16.860
It really is the best way to support this podcast and the journey I'm on.
link |
01:42:21.260
It's how they know I sent you.
link |
01:42:23.660
It increases the chance that they'll actually support this podcast in the future.
link |
01:42:27.740
If you enjoy this thing, subscribe on YouTube, review it with Firestars and Apple Podcasts.
link |
01:42:33.020
Support on Patreon or connect with me on Twitter at Lex Freedman, spelled somehow miraculously
link |
01:42:39.940
without the letter E, just F R I D M A N.
link |
01:42:44.340
Because when we immigrated to this country, we were not so good at spelling.
link |
01:42:49.140
And now let me leave you with some words from Brian Kernigan.
link |
01:42:53.540
And comment bad code, rewrite it.
link |
01:42:57.620
Thank you for listening and hope to see you next time.