← Lex Fridman

James Gosling: Java, JVM, Emacs, and the Early Days of Computing

第126期2020-09-24English

嘉宾:James Gosling

收听本集00:00 / 1:51:28
阅读设置
按你的习惯阅读
正文字号
下载播客精读
把这一篇,带走慢慢读

精读待补充

下载功能还未开放

§01Transcript · 00:00–10:12

00:00The following is a conversation with James Gosling,

00:02the founder and lead designer

00:03behind the Java programming language,

00:05which in many indices is the most popular

00:08programming language in the world,

00:10or is always at least in the top two or three.

00:14We only had a limited time for this conversation,

00:16but I'm sure we'll talk again several times in this podcast.

00:19Quick summary of the sponsors,

00:21Public Goods, BetterHelp, and ExpressVPN.

00:24Please check out these sponsors in the description

00:26to get a discount and to support this podcast.

00:29As a side note, let me say that Java is the language

00:33with which I first learned object-oriented programming,

00:36and with it, the art and science of software engineering.

00:40Also, early on in my undergraduate education,

00:43I took a course on concurrent programming with Java.

00:47Looking back at that time,

00:49before I fell in love with neural networks,

00:51the art of parallel computing was both algorithmically

00:55and philosophically fascinating to me.

00:58The concept of a computer in my mind before then

01:01was something that does one thing at a time.

01:04The idea that we could create an abstraction of parallelism

01:07where you could do many things at the same time

01:10while still guaranteeing stability

01:11and correctness was beautiful.

01:15While some folks in college took drugs

01:17to expand their mind, I took concurrent programming.

01:21If you enjoy this thing, subscribe on YouTube,

01:23review it with 5 Stars on Apple Podcasts,

01:25follow on Spotify, support on Patreon,

01:28or connect with me on Twitter @LexFriedman.

01:31As usual, I'll do a few minutes of ads now

01:33and no ads in the middle.

01:34I try to make these interesting,

01:36but I do give you timestamps, so go ahead and skip,

01:39but please do check out the sponsors

01:41by clicking the links in the description.

01:43It's the best way to support this podcast.

01:46This show, sponsored by Public Goods,

01:49the one-stop shop for affordable, sustainable,

01:51healthy household products.

01:54I take their fish oil and use their toothbrush,

01:57for example.

01:58Their products often have a minimalist

02:00black and white design that I find to be just beautiful.

02:03Some people ask why I wear this black suit and tie.

02:07There's a simplicity to it that, to me,

02:09focuses my mind on the most important bits

02:12of every moment of every day,

02:14pulling only at the thread of the essential

02:17and all that life has to throw at me.

02:20It's not about how I look, it's about how I feel.

02:23That's what design is to me,

02:24creating an inner conscious experience,

02:26not an external look.

02:29Anyway, Public Goods plants one tree

02:32for every order placed, which is kind of cool.

02:35Visit publicgoods.com/lex, or use code LEX at checkout

02:38to get 15 bucks off your first order.

02:41This show is also sponsored by BetterHelp,

02:45spelled H-E-L-P, help.

02:47Check it out at betterhelp.com/lex.

02:50They figure out what you need

02:52and match you with a licensed professional therapist

02:54in under 48 hours.

02:56I chat with the person on there and enjoy it.

02:59Of course, I also regularly talk to David Goggins these days

03:03who is definitely not a licensed professional therapist,

03:07but he does help me meet his and my demons

03:11and become comfortable to exist in their presence.

03:14Everyone is different, but for me,

03:16I think suffering is essential for creation,

03:19but you can suffer beautifully

03:21in a way that doesn't destroy you.

03:23I think therapy can help

03:24in whatever form that therapy takes,

03:27and I do think that BetterHelp is an option worth trying.

03:30They're easy, private, affordable, and available worldwide.

03:35You can communicate by text anytime

03:37and schedule weekly audio and video sessions.

03:39Check it out at betterhelp.com/lex.

03:42This show is also sponsored by ExpressVPN.

03:46You can use it to unlock movies and shows

03:48that are only available in other countries.

03:51I did this recently with Star Trek Discovery

03:53and UK Netflix mostly because I wonder what it's like

03:57to live in London.

03:58I'm thinking of moving from Boston

04:00to a place where I can build the business

04:02I've always dreamed of building.

04:04London is probably not in the top three,

04:06but top 10 for sure.

04:08The number one choice currently is Austin

04:11for many reasons that I'll probably speak to another time.

04:14San Francisco, unfortunately,

04:17dropped out from the number one spot,

04:18but it's still in the running.

04:20If you have advice, let me know.

04:23Anyway, check out ExpressVPN.

04:25It lets you change your location to almost 100 countries

04:27and it's super fast.

04:29Go to expressvpn.com/lexpod

04:32to get an extra three months of ExpressVPN for free.

04:36That's expressvpn.com/lexpod.

04:39And now, here's my conversation with James Gosling.

04:44I've read somewhere that the square root of two

04:47is your favorite irrational number.

04:49- I have no idea where that got started.

04:52(laughing)

04:53- Is there any truth to it?

04:55Is there anything in mathematics or numbers

04:57that you find beautiful?

04:58- Oh, well, there's lots of things in math

05:02that's really beautiful.

05:03You know, I used to consider myself really good at math

05:09and these days I consider myself really bad at math.

05:12I never really had a thing for the square root of two,

05:17but when I was a teenager,

05:20there was this book called

05:22The Dictionary of Curious and Interesting Numbers,

05:26which for some reason I read through

05:32and damn near memorized the whole thing.

05:35And I started this weird habit

05:41of when I was like filling out checks,

05:45you know, or paying for things with credit cards,

05:49I would want to make the receipt

05:52add up to an interesting number.

05:54- Is there some numbers that stuck with you

05:57that just kind of make you feel good?

06:00- They all have a story.

06:01And fortunately, I've actually mostly forgotten all of them.

06:06(laughing)

06:08- Are they, so like 42?

06:11- Well, yeah, I mean, 42 is pretty magical.

06:14- And then the irrationals.

06:15I mean, but is there a square root of two

06:17story in there somewhere?

06:19How did the number get started?

06:21- It's like the only number that has destroyed a religion.

06:26- In which way?

06:28- Well, the Pythagoreans,

06:31they believed that all numbers were perfect

06:33and you could represent anything as a rational number.

06:38And in that time period,

06:45this proof came out that there was no,

06:50you know, rational fraction whose value

06:57was equal to the square root of two.

06:59- And that means nothing in this world is perfect,

07:04not even mathematics.

07:05- Well, it means that your definition

07:08of perfect was imperfect.

07:10- Well, then there's the Gatel and completeness theorems

07:14in the 20th century that ruined it once again for everybody.

07:17- Yeah, although, although, although Gatel's theorem,

07:21you know, the lesson I take from Gatel's theorem

07:26is not that, you know, there are things you can't know,

07:30which is fundamentally what it says.

07:33But, you know, people want black and white answers.

07:39They want true or false.

07:43But if you allow a three-state logic

07:48that is true, false, or maybe,

07:50then life's good.

07:54- I feel like there's a parallel

07:56to modern political discourse in there somewhere.

07:59But let me ask, so with your kind of early love

08:04or appreciation of the beauty of mathematics,

08:11do you see a parallel between that world

08:15and the world of programming?

08:16- You know, programming is all about logical structure,

08:22understanding the patterns that come out of computation,

08:28understanding sort of, I mean, it's often like,

08:37you know, the path through the graph of possibilities.

08:41To find a short route.

08:44- Meaning like find a short program

08:48that gets the job done kind of thing?

08:51But so then on the topic of irrational numbers,

08:54do you see programming, you just painted it so cleanly.

08:59It's a little of this trajectory

09:02to find like a nice little program,

09:05but do you see it as fundamentally messy?

09:07Maybe unlike mathematics?

09:10- I don't think of it as, I mean, you know,

09:13you watch somebody who's good at math do math,

09:16and you know, often it's fairly messy.

09:21Sometimes it's kind of magical.

09:25When I was a grad student, one of the students,

09:32his name was Jim Sachs, was, he had this,

09:37he had this reputation of being sort of a walking,

09:42talking human theorem proving machine.

09:48And if you were having a hard problem with something,

09:51you could just like accost him in the hall and say,

09:54"Jim," and he would do this funny thing

09:59where he would stand up straight,

10:01his eyes would kind of defocus.

10:03He'd go, you know, just like, you know,

10:06like something in today's movies, he's just,

10:09and then he'd straighten up and say,

10:12"N log N," and walk away.

§02Transcript · 10:13–21:55

10:13And you'd go, well, okay, so N log N is the answer.

10:20How did he get there?

10:21By which time he's, you know, down the hallway somewhere.

10:27- Yeah, it's just the Oracle,

10:29the black box just gives you the answer.

10:31- Yeah, and then you have to figure out the path

10:33from the question to the answer.

10:35- I think in one of the videos I watched,

10:38you mentioned Don Knuth, well, at least recommending his,

10:43you know, his book is something people should read.

10:47- Oh yeah.

10:48- But in terms of, you know, theoretical computer science,

10:52do you see something beautiful

10:57that has been inspiring to you, speaking of N log N,

11:00in your work on programming languages,

11:03that's in that whole world of algorithms and complexity

11:08and, you know, these kinds of more formal

11:11mathematical things?

11:13Or did that not really stick with you

11:16in your programming life?

11:18- It did stick pretty clearly for me,

11:24because one of the things that I care about

11:27is being able to sort of look at a piece of code

11:32and be able to prove to myself that it works.

11:39And, you know, so for example, I find that I'm at odds

11:46with many of the people around me

11:54over issues about like how you lay out

11:59a piece of software, right?

12:03You know, so software engineers get really cranky

12:07about how they format the documents that are the programs,

12:11you know, where they put new lines

12:13and where they put, you know.

12:14- The braces.

12:15- The braces and all the rest of that, right?

12:18And I tend to go for a style that's very, very simple

12:23that's very dense.

12:25- To minimize the white space.

12:29- Yeah, well, to maximize the amount

12:34that I can see at once, right?

12:37So I like to be able to see a whole function

12:40and to understand what it does,

12:43rather than have to go scroll, scroll, scroll

12:44and remember, right?

12:46- Yeah, I'm with you on that.

12:47Yeah, that's, and people don't like that?

12:52- Yeah, I've had, you know, multiple times

12:56when engineering teams have staged

13:01what was effectively an intervention.

13:03You know, where they invite me to a meeting

13:10and everybody's arrived before me

13:12and they sort of all look at me and say,

13:14"James, about your coding style."

13:21I'm sort of an odd person to be programming

13:24because I don't think very well verbally.

13:29I am just naturally a slow reader.

13:35I'm what most people would call a visual thinker.

13:42- So when you think about a program, what do you see?

13:45- I see pictures, right?

13:47So when I look at a piece of code on a piece of paper,

13:52it very quickly gets transformed into a picture.

13:55And, you know, it's almost like a piece of machinery

14:02with, you know, this connected to that and-

14:05- Like these gears of different sizes.

14:07- Yeah, yeah.

14:09I see them more like that than I see

14:12the sort of verbal structure

14:16or the lexical structure of letters.

14:18- So then when you look at the program,

14:19that's why you wanna see it all in the same place,

14:21then you can just map it to something visual.

14:24- Yeah, and it just kind of like it leaps off the page at me.

14:28- Yeah, what are the inputs, what are the outputs,

14:30what the heck is this thing doing?

14:32- Yeah, yeah.

14:33- Getting a whole vision of it.

14:35Can we go back into your memory, long-term memory access?

14:40What's the first program you've ever written?

14:45- Oh, I have no idea what the first one was.

14:50I mean, I know the first machine

14:54that I learned to program on.

14:58- What is it?

14:59- Was a PDP-8 at the University of Calgary.

15:04- Do you remember the specs?

15:08- Oh yeah, so the thing had 4K of RAM.

15:12- Nice.

15:13- 12-bit words.

15:16The clock rate was,

15:18it was about a third of a megahertz.

15:25- Oh, so you didn't even get to the M, okay.

15:29- Yeah, yeah, so we're like 10,000 times faster these days.

15:34- And was this kind of like a super computer,

15:40like a serious computer for--

15:42- No, the PDP-8i was the first thing

15:46that people were calling like mini computer.

15:49- Got it.

15:50- They were sort of inexpensive enough

15:53that a university lab could maybe afford to buy one.

15:57- And was there time-sharing, all that kind of stuff?

16:02- There actually was a time-sharing OS for that,

16:06but it wasn't used really widely.

16:10The machine that I learned on was one

16:13that was kind of hidden in the back corner

16:16of the computer center.

16:20And it was bought as part of a project

16:27to do computer networking.

16:32But they didn't actually use it very much.

16:38It was mostly just kind of sitting there.

16:40And it was kind of sitting there,

16:44and I noticed it was just kind of sitting there.

16:47And so I started fooling around with it,

16:50and nobody seemed to mind, so I just kept doing that.

16:54- It had a keyboard and like a monitor?

16:59- Oh, this is way before monitors were common.

17:02So it was literally a Model 33 Teletype.

17:07- Okay.

17:08- Paper tape reader.

17:09(laughing)

17:12- Okay, so the user interface wasn't very good.

17:14- Yeah, yeah.

17:15It was the first computer ever built

17:20with integrated circuits.

17:22But by integrated circuits, I mean that they would have

17:26like 10 or 12 transistors on one piece of silicon.

17:31Not the 10 or 12 billion that machines have today.

17:38- So what did that, I mean, feel like,

17:41if you remember those, I mean,

17:45did you have kind of inklings of the magic

17:48of exponential kind of improvement of Moore's Law,

17:52of the potential of the future that was at your fingertips

17:56kind of thing, or was it just a cool--

17:58- Yeah, it was just a toy.

18:00You know, I had always liked building stuff,

18:04but one of the problems with building stuff

18:06is that you need to have parts.

18:08You need to have pieces of wood or wire

18:12or switches or stuff like that.

18:15And those all cost money.

18:16- And here you could build--

18:18- You could build arbitrarily complicated things,

18:20and I didn't need any physical materials.

18:23It required no money.

18:27- That's such a good way to put programming.

18:29You're right.

18:30If you love building things, it's completely accessible.

18:35You don't need anything.

18:38Anybody from anywhere could just build

18:40something really cool.

18:41- Yeah, yeah.

18:43If you've got access to a computer,

18:44you can build all kinds of crazy stuff.

18:49And when you were somebody like me

18:58who had really no money,

19:01and I remember just lusting after being able

19:08to buy a transistor.

19:10(laughing)

19:13And when I would do electronics kind of projects,

19:20they were mostly made, done by dumpster diving for trash.

19:27And one of my big hauls was discarded relay racks

19:32from the back of the phone company switching center.

19:37- Oh, nice.

19:38That was the big memorable treasure.

19:41- Oh yeah, yeah.

19:43- What do you use that for?

19:45- I built a machine that played tic-tac-toe.

19:47(laughing)

19:50- Nice.

19:51- Out of relays.

19:52Of course, the thing that was really hard

19:55was that all the relays required a specific voltage,

20:00but getting a power supply that would do that voltage

20:04was pretty hard.

20:06And since I had a bunch of trashed television sets,

20:09I had to sort of cobble together something

20:15that was wrong, but worked.

20:19So I was actually running these relays at 300 volts.

20:25- Huh.

20:26And none of the electrical connections

20:30were properly sealed off.

20:32- Surprised you survived that period of your life.

20:36- Oh, for so many reasons.

20:38For so many reasons.

20:40I mean, it's pretty common for teenage geeks to discover,

20:45oh, thermite, that's real easy to make.

20:48- Yeah, well, I'm glad you did.

20:52But do you remember what program in Calgary that you wrote?

20:57Anything that stands out?

21:01And what language?

21:03- Well, so mostly, anything of any size was assembly code.

21:08And actually, before I learned assembly code,

21:17there was this programming language on the PDP-8

21:20called Focal 5.

21:22And Focal 5 was kind of like a really stripped down Fortran.

21:26And I remember playing, you know,

21:31building programs that did things like play Blackjack

21:36or Solitaire or, and for some reason or other,

21:42the things that I really liked were ones

21:45where they were just like plotting graphs.

21:50- So something with like a function or a data,

21:54and then you'd plot it.

21:55- Yeah, yeah, I did a bunches of those things

§03Transcript · 21:59–33:41

21:59and went, ooh, pretty pictures.

22:01- And so this would like print out, again, no monitors.

22:07- Right, so it was like on a teletype.

22:10- Yeah.

22:13- So it's using something that's kind of like a typewriter.

22:18And then using those to plot functions.

22:22- So when, I apologize to romanticize things,

22:26but when did you first fall in love with programming?

22:31You know, what was the first programming language?

22:34Like as a serious, maybe software engineer,

22:36where you thought this is a beautiful thing?

22:39- I guess I never really thought

22:41of any particular language as being like beautiful,

22:45'cause it was never really about the language for me.

22:47It was about what you could do with it.

22:49And, you know, even today, you know,

22:54people try to get me into arguments

22:56about particular forms of syntax or this or that.

23:00And I'm like, who cares?

23:03You know, it's about what you can do,

23:04not how you spell the word.

23:08And, you know, so back in those days,

23:12I learned like PL1 and Fortran and COBOL.

23:18And, you know, by the time that people were willing

23:22to hire me to do stuff, you know,

23:24it was mostly assembly code and, you know,

23:28PDP assembly code and Fortran code

23:32and control data assembly code for like the CDC 6400,

23:37which was an early, I guess, supercomputer.

23:41Even though that supercomputer has less compute power

23:46than my phone by a lot.

23:49- And that was mostly, like you said, Fortran world.

23:54That said, you've also showed appreciation

23:57for the greatest language ever

24:00that I think everyone agrees is Lisp.

24:03- Well, Lisp is definitely on my list

24:07of the greatest ones that have existed.

24:11- Is it at number one or, I mean, are you, I mean.

24:16- You know, the thing is that it's, you know,

24:19I wouldn't put it number one, no.

24:23- Is it the parentheses?

24:24What do you love and what do you not love about Lisp?

24:30- Well, I guess the number one thing to not love about it

24:36is so freaking many parentheses.

24:39- Yeah.

24:39- On the love thing is, you know,

24:44out of those tons of parentheses,

24:48you actually get an interesting language structure.

24:51And I've always thought that there was a friendlier version

24:54of Lisp hiding out there somewhere,

24:56but I've never really spent much time.

25:01- Thinking about it.

25:02- Thinking about it, but, you know,

25:03so like up the food chain for me,

25:07then from Lisp is Simula,

25:12which a very small number of people have ever used.

25:16- But a lot of people, I think,

25:18had a huge influence, right?

25:19- Yeah.

25:20- On the programming, but in Simula,

25:23I apologize if I'm wrong on this,

25:24but is that one of the first functional languages or no?

25:28- No, it was the first object oriented programming language.

25:32- Got it.

25:33- It's really where object oriented

25:35and languages sort of came together.

25:39And it was also the language where coroutines

25:44first showed up as a part of the language.

25:48So you could have a programming style that was,

25:53you could think of it as multi-threaded

25:57with a lot of parallelism.

26:00- Really?

26:01There's ideas of parallelism in there?

26:03- Yeah.

26:04Yeah, so that was back, you know,

26:08so the first Simula spec was Simula 67.

26:11- From like 1967?

26:14- Yeah.

26:15- Wow.

26:16- So it had coroutines, which are almost threads.

26:21The thing about coroutines

26:23is that they don't have true concurrency.

26:26So you can get away without really complex locking.

26:31You can't usably do coroutines

26:36on the multi-core machine.

26:38Or if you try to do coroutines

26:41on a multi-core machine,

26:44you don't actually get to use the multiple cores.

26:47- Got it.

26:48- Either that or you, you know,

26:49'cause you start then having to get into the universe

26:54of semaphores and locks and things like that.

26:58But, you know, in terms of the style of programming,

27:04you could write code and think of it

27:08as being multi-threaded.

27:11The mental model was very much a multi-threaded one.

27:16And all kinds of problems

27:18you could approach very differently.

27:20- To return to the world of Lisp for a brief moment,

27:27you, at CMU, you wrote a version of Emacs

27:32that I think was very impactful on the history of Emacs.

27:36What was your motivation for doing so?

27:42- At that time, so that was in like '85 or '86.

27:47I had been using Unix for a few years.

27:57And most of the editing was this tool called ED,

28:02which was sort of an ancestor of VI.

28:08And--

28:11- Is it a pretty good editor, not a good editor?

28:14- Well, if what you're using,

28:16if your input device is a teletype, it's pretty good.

28:21- Yeah.

28:22- It's certainly more humane than Tico,

28:25which was kind of the common thing

28:28in a lot of the DEC universe at the time.

28:32- Tico is spelled T-K?

28:34Is that the--

28:35- No, Tico, T-E-C-O, the text editor and corrector.

28:39- Corrector, wow, so many features.

28:41- And the original Emacs came out as,

28:48so Emacs stands for editor macros.

28:52And Tico had a way of writing macros.

28:55And so the original Emacs from MIT,

29:01sort of started out as a collection of macros for Tico.

29:06But then, the sort of Emacs style got popular

29:12originally at MIT, and then people did a few

29:19other implementations of Emacs that were,

29:22you know, the code base was entirely different,

29:26but it was sort of the philosophical style

29:29of the original Emacs.

29:30- What was the philosophy of Emacs?

29:33And by the way, were all the implementations always in C?

29:36And then--

29:37- No, no.

29:38- And how does Lisp fit into the picture?

29:39- No, so the very first Emacs was written

29:43as a bunch of macros for the Tico text editor.

29:46- Wow, that's so interesting.

29:47- And the macro language for Tico

29:52was probably the most ridiculously obscure format.

29:58You know, if you just look at a Tico program on a page,

30:02you think it was just random characters.

30:06It really looks like just line noise.

30:08- So it's kind of like LaTeX or something?

30:11- Oh, way worse than LaTeX.

30:15Way, way worse than LaTeX.

30:17But, you know, if you use Tico a lot, which I did,

30:21the Tico was completely optimized

30:25for touch typing at high speed.

30:29So there were no two character commands.

30:34Well, there were a few,

30:36but mostly they were just one character.

30:38So every character on the keyboard was a separate command.

30:41And actually every character on the keyboard

30:45was usually two or three commands

30:48because you can hit shift and control

30:51and all of those things.

30:52It's just a way of very tightly encoding it.

30:55And mostly what Emacs did was it made that visual.

31:00So one way to think of Tico is use Emacs

31:08with your eyes closed.

31:14Where you have to maintain a mental model of,

31:17you know, sort of a mental image of your document.

31:20You have to go, okay, so the cursor is between the A

31:25and the E and I want to exchange those.

31:29So I do these things, right?

31:31So it is almost exactly the Emacs command set.

31:36Well, it's roughly the same as Emacs command set,

31:42but using Emacs with your eyes closed.

31:45So what Emacs, you know,

31:50part of what Emacs added to the whole thing

31:52was being able to visually see what you were editing

31:57in a form that matched your document.

32:02And, you know, a lot of things changed in the command set.

32:11You know, because it was programmable,

32:13it was really flexible.

32:15You could add new commands for all kinds of things.

32:18And then people rewrote Emacs like multiple times in Lisp.

32:23There was one done at MIT for the Lisp machine.

32:28There was one done for Multics.

32:31And one summer I got a summer job

32:35to work on the Pascal compiler for Multics.

32:40And that was actually the first time I used Emacs.

32:43And so-

32:47- To write the compiler.

32:48So you've worked on compilers too.

32:50That's fascinating.

32:52- Yeah, so I did a lot of work.

32:53You know, I mean, I spent like a really intense three months

32:59working on this Pascal compiler, basically living in Emacs.

33:05And it was the one written in Mac Lisp

33:08by Bernie Greenberg.

33:11And I thought, wow, this is just a way better way

33:15to do editing.

33:16And then I got back to CMU where we had kind of one

33:24of everything and two of a bunch of things

33:28and four of a few things.

33:30And since I mostly worked in the Unix universe

33:35and Unix didn't have an Emacs,

33:38I decided that I needed to fix that problem.

33:41So I wrote this implementation of Emacs in C

§04Transcript · 33:47–46:02

33:47'cause at the time C was really the only language

33:51that worked on Unix.

33:54- And you were comfortable with C as well?

33:57- Oh yeah.

33:58- At that point?

33:59- Yeah, at that time I had done a lot of C coding.

34:02This was in like '86.

34:04And it was running well enough

34:11for me to use it to edit itself within a month or two.

34:17And then it kind of took over the university.

34:22- And it spread outside.

34:25- Yeah, and then it went outside.

34:28And largely because Unix kind of took over

34:32the research community on the ARPANET.

34:37And Emacs was kind of the best editor out there.

34:43It kind of took over.

34:44And there was actually a brief period

34:48where I actually had login IDs

34:53on every non-military host on the ARPANET.

34:57(laughing)

34:59Because people would say, "Oh, can we install this?"

35:01And I'd like, "Well, yeah, but you'll need some help."

35:06(laughing)

35:09- The days when security wasn't--

35:11- When nobody cared.

35:12- Nobody cared.

35:14- Yeah.

35:14- Can I ask briefly, what were those early days

35:19of ARPANET and the internet like?

35:24I mean, did you, again, sorry for the silly question,

35:28but could you have possibly imagined

35:31that the internet would look like what it is today?

35:36- You know, some of it is remarkably unchanged.

35:41So like one of the things that I noticed really early on

35:46when I was at Carnegie Mellon was that

35:53a lot of social life became centered around the ARPANET.

35:58So things like, you know, between email and text messaging,

36:05because text messaging was a part of the ARPANET

36:09really early on.

36:11There were no cell phones, but you're sitting at a terminal

36:15and you're typing stuff.

36:16- So essentially email, or like what is--

36:20- Well, just like a one-line message, right?

36:22So--

36:23- Oh, cool, so like chat.

36:25- Like chat.

36:26- Yeah.

36:27- Right, so it's like sending a one-line message

36:30to somebody, right?

36:31And so pretty much everything from, you know,

36:36arranging lunch to going out on dates, you know,

36:43it was all like driven by social media.

36:48- Social media. (laughs)

36:49- Right, in the '80s.

36:52- Easier than phone calls, yeah.

36:55- You know, and my life had gotten to where, you know,

36:59I was, you know, living on social media, you know,

37:03from like the early mid '80s.

37:08And so when it sort of transformed into the internet

37:16and social media explodes, I was kind of like,

37:19what's the big deal?

37:21- Yeah, it's just a scale thing.

37:23- It's, right, the scale thing is just astonishing.

37:27- Yeah, but the fundamentals in some ways--

37:32- The fundamentals have hardly changed.

37:36And, you know, the technologies behind the networking

37:40have changed significantly.

37:42The, you know, the watershed moment of, you know,

37:48going from the ARPANET to the internet,

37:50and then people starting to just scale and scale and scale.

37:57I mean, the scaling that happened in the early '90s

38:02and the way that so many vested interests

38:08fought the internet.

38:11- Oh, who, oh, interesting.

38:14What was the, oh, because you can't really control

38:16the internet?

38:18So who fought the internet?

38:19- So fundamentally, the, you know,

38:23the cable TV companies and broadcasters

38:27and phone companies, you know,

38:30at the deepest fibers of their being,

38:35they hated the internet.

38:38But it was often kind of a funny thing

38:43because, you know, so think of a cable company, right?

38:48Most of the employees of the cable company,

38:57their job is getting TV shows, movies,

39:02whatever out to their customers.

39:06They view their business as serving their customers.

39:13But as you climb up the hierarchy in the cable companies,

39:18that view shifts because really the business

39:24of the cable companies had always been

39:32selling eyeballs to advertisers.

39:34- Right.

39:40- And, you know, that view of like a cable company

39:45didn't really dawn on most people

39:49who worked at the cable companies.

39:51But, you know, I had various dustups

39:55with various cable companies where you could see,

39:58you know, in the stratified layers of the corporation

40:01that this view of, you know,

40:05the reason that you have, you know, cable TV

40:10is to capture eyeballs, you know, they're--

40:13- So they didn't see it that way.

40:15- Well, so the people who,

40:17most of the people who worked at the phone company

40:19or at the cable companies, their view was

40:24that their job was getting delightful content

40:28out to their customers and their customers

40:30would pay for that.

40:33Higher up, they viewed this as a way

40:36of attracting eyeballs to them.

40:40And then what they were really doing

40:45was selling the eyeballs that were glued to their content,

40:50to the advertisers.

40:52- To the advertisers, yeah.

40:54And so the internet was a competition in that sense.

40:57- Right, and so--

40:58- They were right.

41:00- Well, yeah, I mean, there was one proposal

41:04that we sent that we, one detailed proposal

41:09that we wrote up, you know, back at Sun

41:15in the early '90s that was essentially like,

41:19look, anybody, you know, with internet technologies,

41:22anybody can become provider of content.

41:27So, you know, you could be distributing home movies

41:32to your parents or your cousins who are anywhere else, right?

41:37So anybody can become a publisher.

41:41- Wow, you were thinking about that already, yeah.

41:43Netflix, Netflix.

41:45- Yeah, that was like in the early '90s.

41:48- Yeah.

41:49- And we thought this would be great.

41:52And the kind of content we were thinking about

41:56at the time was like, you know, home movies, kids' essays,

42:01you know, stuff from like grocery stores

42:08or, you know, or a restaurant

42:12that they could actually like start

42:15sending information about.

42:17- That's brilliant.

42:21- And the reaction of the cable companies was like,

42:27fuck no, because then we're out of business.

42:32- What is it about companies that,

42:36'cause they could have just,

42:38they could have been ahead of that wave.

42:40They could have listened to that and they could have--

42:42- They didn't see a path to revenue.

42:44- You know, there's somewhere in there,

42:47there's a lesson for like big companies, right?

42:50Like to listen, to try to anticipate the renegade,

42:56the out there, out of the box people like yourself

42:59in the early days writing proposals

43:01about what this could possibly be.

43:03- Well, and that, you know, it wasn't,

43:06you know, if you're in a position

43:08where you're making truckloads of money

43:12off of a particular business model,

43:15you know, the whole thought of like,

43:25you know, leaping the chasm, right?

43:27You know, you can see, oh, new models

43:31that are more effective are emerging, right?

43:35So like digital cameras versus film cameras.

43:39You know, I mean--

43:44- Why take the leap?

43:45- Why take the leap?

43:46Because you're making so much money off of film.

43:51And, you know, in my past at Sun,

43:56one of our big customers was Kodak.

43:59And I ended up interacting with folks from Kodak quite a lot

44:03and they actually had a big digital camera research

44:08and, you know, digital imaging business

44:12or development group.

44:16And they knew that, you know,

44:21you just look at the trend lines

44:24and you look at, you know, the emerging quality

44:28of these, you know, digital cameras.

44:33And, you know, you can just plot it on a graph, you know?

44:37And it's like, you know, sure film is better today,

44:42but, you know, digital is improving like this.

44:49The lines are gonna cross and, you know,

44:53the point at which the lines cross

44:55is gonna be a collapse in their business.

44:57And they could see that, right?

45:03They absolutely knew that.

45:06The problem is that, you know,

45:07up to the point where they hit the wall,

45:10they were making truckloads of money, right?

45:14- Yeah.

45:15- Right, and when they did the math,

45:20it never started to make sense for them

45:26to kind of lead the charge.

45:29And part of the issues for a lot of companies

45:32for this kind of stuff is that, you know,

45:36if you're gonna leap over a chasm like that,

45:39like with Kodak going from film to digital,

45:45that's a transition that's gonna take a while, right?

45:49We had fights like this with people who were like smart cards.

45:53The smart cards fights were just ludicrous.

45:56- But that's where visionary leadership comes in, right?

46:00Yeah, somebody needs to roll in and say,

46:02then take the leap.

§05Transcript · 46:04–58:13

46:04- Well, it partly take the leap,

46:07but it's also partly take the hit.

46:09- Take the hit in the short term.

46:10- So you can draw the graphs you want that show

46:15that if we leap from here,

46:18on our present trajectory, we're doing this

46:21and there's a cliff.

46:23If we force ourselves into a transition

46:27and we proactively do that, we can be on the next wave,

46:32but there will be a period when we're in a trough.

46:39And pretty much always there ends up being a trough

46:44as you leap the chasm.

46:46But the way that public companies work on this planet,

46:51they're reporting every quarter.

46:55And the one thing that a CEO must never do

47:00is take a big hit.

47:02- Take a big hit.

47:03- Over some quarter.

47:06And many of these transitions involve a big hit

47:11for a period of time, one, two, three quarters.

47:16And so you get some companies and like Tesla and Amazon

47:22are really good examples of companies that take huge hits,

47:31but they have the luxury of being able

47:34to ignore the stock market for a little while.

47:38And that's not so true today really,

47:42but in the early days of both of those companies,

47:47they both did this thing of,

47:53I don't care about the quarterly reports,

47:57I care about how many happy customers we have.

48:02And having as many happy customers as possible

48:05can often be an enemy of the bottom line.

48:10- Yeah, so how do they make that work?

48:12I mean, Amazon operated in the negative for a long time.

48:15It's like investing into the future.

48:17- Right, but so Amazon and Google and Tesla and Facebook,

48:22a lot of those had what amounted to patient money.

48:30Often because there's like a charismatic central figure

48:35who has a really large block of stock

48:39and they can just make it so.

48:44- So on that topic, just maybe it's a little small tangent,

48:49but you've gotten the chance to work

48:51with some pretty big leaders.

48:53What are your thoughts about on Tesla's side,

48:55Elon Musk leadership, on the Amazon side, Jeff Bezos,

49:00all of these folks with large amounts of stock

49:02and vision in their company.

49:05I mean, they're founders,

49:06either complete founders or early on folks.

49:11And Amazon have taken a lot of leaps

49:16that probably at the time people would criticize

49:21as like, what is this bookstore thing?

49:24Why? (laughs)

49:26- Yeah, and Bezos had a vision

49:30and he had the ability to just follow it.

49:36Lots of people have visions

49:37and the average vision is completely idiotic

49:41and you crash and burn.

49:42The Silicon Valley crash and burn rate is pretty high.

49:50And they don't necessarily crash and burn

49:54because they were dumb ideas,

49:55but often it's just timing and luck.

50:00And you take companies like Tesla

50:06and really the original Tesla,

50:12sort of pre-Elon was kind of doing sort of okay,

50:18but he just drove them.

50:26And because he had a really strong vision,

50:31he would make calls that were always,

50:36well, mostly pretty good.

50:40I mean, the Model X was kind of a goofball thing to do.

50:44- But he did it boldly anyway.

50:46Like there's so many people that just said,

50:49like there's so many people that oppose them

50:51on the Falconwind door, like the door.

50:54From an engineering perspective,

50:55those doors are ridiculous.

50:57It's like--

50:58- Yeah, they are a complete travesty.

51:00- But they're exactly the symbol

51:04of what great leadership is,

51:05which is like you have a vision and you just go like--

51:09- If you're gonna do something stupid,

51:10make it really stupid.

51:12- Yeah, and go all in.

51:13- Yeah, yeah.

51:15And to my credit, he's a really sharp guy.

51:22So going back in time a little bit to Steve Jobs,

51:26Steve Jobs was a similar sort of character

51:29who had a strong vision and was really, really smart.

51:33And he wasn't smart about the technology parts of things,

51:39but he was really sharp about the sort of human relationship

51:44between humans and objects.

51:52And, but he was a jerk.

51:57- You know--

52:00- Right?

52:01- Can we just linger on that a little bit?

52:02Like people say he's a jerk.

52:04Is that a feature or a bug?

52:08- Well, that's the question, right?

52:11So you take people like Steve,

52:13who was really hard on people.

52:18And so the question is, was he really,

52:22was he needlessly hard on people

52:25or was he just making people reach to meet his vision?

52:30And you could kind of spin it either way.

52:39- Well, the results tell a story.

52:46Whatever jerk ways he had,

52:47he made people often do the best work of their life.

52:51- Yeah, yeah.

52:52And that was absolutely true.

52:54And I interviewed with him several times.

52:58I did various negotiations with him.

53:04And even though kind of personally I liked him,

53:09I could never work for him.

53:14- Why do you think that,

53:22can you put into words the kind of tension

53:25that you feel would be destructive

53:29as opposed to constructive?

53:30- Oh, he'd yell at people, he'd call them names.

53:39- And you don't like that?

53:40- No, no, I don't think you need to do that.

53:44And I think there's pushing people to excel

53:51and then there's too far.

54:01And I think he was on the wrong side of the line.

54:04And I've never worked for Musk.

54:07I know a number of people who have,

54:10many of them have said,

54:11and it shows up in the press a lot

54:13that Musk is kind of that way.

54:18And one of the things that I sort of loathe

54:21about Silicon Valley these days

54:24is that a lot of the high flying successes

54:29are run by people who are complete jerks.

54:33But it seems like there's become this,

54:36there's come this sort of mythology out of Steve Jobs

54:41that the reason that he succeeded

54:44was because he was super hard on people.

54:49And in a number of corners, people start going,

54:55oh, if I wanna succeed, I need to be a real jerk.

55:01- Yeah.

55:01- Right, and that for me just does not compute.

55:05I mean, I know a lot of successful people

55:07who are not jerks, who are perfectly fine people.

55:12You know, they tend to not be in the public eye.

55:19- The general public somehow lifts the jerks up

55:25into the hero status.

55:28- Right, well, because they do things

55:30that get them in the press.

55:32- Yeah.

55:33- And the people who don't do the kind of things

55:38that spill into the press.

55:46- Yeah, I just talked to Chris Lautner for the second time.

55:52He's a super nice guy, just an example

55:57of this kind of kind of individual

55:58that's in the background.

56:00I feel like he's behind like a million technologies,

56:03but he also talked about the jerkiness

56:05of some of the folks.

56:06- Yeah, yeah, and the fact that being a jerk

56:10has become your required style.

56:13- But one thing I maybe wanna ask on that

56:15is maybe to push back a little bit.

56:17So there's the jerk side, but there's also,

56:21if I were to criticize what I've seen in Silicon Valley,

56:24which is almost the resistance to working hard.

56:28So on the jerkiness side is,

56:31so Poste Jobs and Elon kind of push people

56:38to work really hard to do.

56:41And there's a question whether it's possible

56:44to do that nicely.

56:45But one of the things that bothers me,

56:47maybe I'm just a Russian and just kind of,

56:51romanticize the whole suffering thing.

56:53But I think working hard is essential

56:56for accomplishing anything interesting, like really hard.

57:00And in the parlance of Silicon Valley,

57:02it's probably too hard.

57:04This idea of the, you should work smart, not hard,

57:07often to me sounds like you should be lazy,

57:12because of course you wanna be to work smart.

57:15Of course you would be maximally efficient,

57:18but in order to discover the efficient path,

57:20like we're talking about with the short programs.

57:21- Yeah, well, you know,

57:25the smart hard thing isn't an either or, it's an and.

57:29- It's an and, yeah.

57:30- Right?

57:31And, you know,

57:35the people who say you should work smart, not hard,

57:41they pretty much always fail.

57:44- Yeah, thank you.

57:46- Right, I mean, that's just a recipe for disaster.

57:49I mean, there are counter examples,

57:53but there are more people who benefited from luck.

57:57- And you're saying, yeah, exactly.

58:00Luck and timing, like you said, is often an essential thing.

58:04But you're saying, you know,

58:06you can push people to work hard

58:08and do incredible work without--

58:10- Without being nasty.

58:13- Yeah, without being nasty.

§06Transcript · 58:14–1:11:51

58:14I think Google is a good example

58:19of the leadership of Google throughout its history

58:23has been a pretty good example of not being nasty.

58:28- Yeah, I mean, the twins, Larry and Sergey,

58:33are both pretty nice people.

58:37- Sandra Pacheco's very nice.

58:39- Yeah, yeah, and, you know,

58:43it's a culture of people who work really, really hard.

58:49- Let me ask maybe a little bit of a tense question.

58:53We're talking about Emacs.

58:56It seems like you've done some incredible work,

58:58so outside of Java, you've done some incredible work

59:01that didn't become as popular as it could have

59:04because of like licensing issues

59:07and open sourcing issues.

59:10What are your thoughts about that entire mess?

59:18Like what's about open source now in retrospect,

59:22looking back, about licensing, about open sourcing,

59:27do you think open source is a good thing, a bad thing?

59:32Do you have regrets?

59:35Do you have wisdom that you've learned

59:38from that whole experience?

59:39- So in general, I'm a big fan of open source.

59:45The way that it can be used to build communities

59:49and promote the development of things

59:52and promote collaboration and all of that

59:55is really pretty grand.

59:56When open source turns into a religion

60:03that says all things must be open source,

60:05I get kind of weird about that

60:10because it's sort of like saying,

60:13some versions of that end up saying

60:18that all software engineers must take a vow of poverty.

60:23Right, as though--

60:26- It's unethical to have money.

60:30- Yeah.

60:31- To build a company to, right.

60:34- And there's a slice of me

60:38that actually kind of buys into that

60:41because people who make billions of dollars

60:46off of a patent and the patent came from literally

60:52a stroke of lightning that hits you

60:58as you lie half awake in bed,

61:01yeah, that's lucky, good for you.

61:06The way that that sometimes sort of explodes

61:09into something that looks to me a lot like exploitation,

61:14you see a lot of that in the drug industry.

61:19When you've got medications that cost you $100 a day

61:27and it's like, no.

61:36- Yeah, so the interesting thing about sort of open source,

61:41what bothers me is when something is not open source

61:47and because of that, it's a worse product.

61:51- Yeah.

61:52- So like, I mean, if I look at your just implementation

61:55of Emacs, like that could have been the dominant,

61:59like I use Emacs, that's my main ID,

62:01I apologize to the world, but I still love it.

62:05And I could have been using your implementation of Emacs

62:10and why aren't I?

62:13- So are you using the GNU Emacs?

62:16- I guess the default on Linux, is that GNU?

62:18- Yeah, and that through a strange passage

62:22started out as the one that I wrote.

62:24- Exactly, so it still has, yeah.

62:28- Well, and part of that was because

62:32in the last couple of years of grad school,

62:37it became really clear to me that I was either going

62:44to be Mr. Emacs forever or I was gonna graduate.

62:49- Got it.

62:52- I couldn't actually do both.

62:54- Was that a hard decision?

62:58That's so interesting to think about you as a,

63:00like it's a different trajectory that could have happened.

63:02- Yeah.

63:03- That's fascinating.

63:04- And maybe I could be fabulously wealthy today

63:10if I had become Mr. Emacs and Emacs had mushroomed

63:14into a series of text processing applications

63:19and all kinds of stuff and I would have,

63:22but I have a long history

63:28of financially suboptimal decisions

63:32because I didn't want that life, right?

63:37And I went to grad school because I wanted to graduate

63:43and being Mr. Emacs for a while was kind of fun

63:52and then it kind of became--

64:00- Not fun.

64:00- Not fun.

64:02And when it was not fun and I was,

64:07there was no way I could pay my rent, right?

64:14- Yeah.

64:17- And I was like, okay, do I carry on as a grad student?

64:21I had a research assistantship

64:25and I was sort of living off of that

64:27and I was trying to do my,

64:30I was doing all my RA work, all my RA,

64:34being grad student work and being Mr. Emacs

64:36all at the same time.

64:38And I decided to pick one.

64:44And one of the things that I did at the time

64:48was I went around all the people I knew on the ARPANET

64:53who might be able to take over looking after Emacs

64:58and pretty much everybody said, I got a day job.

65:04So I actually found two folks and a couple of folks

65:11in a garage in New Jersey, complete with a dog,

65:17who were willing to take it over,

65:23but they were gonna have to charge money.

65:25But my deal with them was that they would,

65:28only that they would make it free

65:32for universities and schools and stuff.

65:35And they said, sure.

65:36And that upset some people.

65:41- So you have some,

65:42now I don't know the full history of this,

65:44but I think it's kind of interesting.

65:46You have some tension with Mr. Richard Stallman.

65:52And he kind of represents this kind of,

65:56like you mentioned, free software,

65:59sort of a dogmatic focus on-

66:06- Yeah, all information must be free.

66:10- Must be free.

66:11So what, is there an interesting way to paint a picture

66:15of the disagreement you have with Richard through the years?

66:20- My basic opposition is that,

66:23when you say information must be free,

66:28to a really extreme form that turns into,

66:33all people whose job is the production of

66:41everything from movies to software,

66:49they must all take a vow of poverty

66:51because information must be free.

66:56And that doesn't work for me.

66:58Right, and I don't wanna be wildly rich.

67:04I am not wildly rich.

67:07I do okay.

67:10But I do actually,

67:18I can feed my children.

67:20- Yeah, I totally agree with you.

67:22It does just make me sad that sometimes

67:25the closing of the source,

67:27for some reason the people that,

67:29like a bureaucracy begins to build,

67:33and sometimes it doesn't, it hurts the product.

67:37- Oh, absolutely, absolutely.

67:39- It's always sad.

67:40- And there is a balance in there.

67:44- There's a balance.

67:47And it's not hard over rapacious capitalism,

67:52and it's not hard over in the other direction.

68:00And a lot of the open source movement,

68:07they have been managing to find a path

68:11to actually making money, right?

68:15So doing things like service and support

68:19works for a lot of people.

68:21And there are some ways where it's kind of,

68:29some of them are a little perverse, right?

68:35So as a part of things like the Sarbanes-Oxley Act

68:43that would be various people's interpretations

68:46of all kinds of accounting principles,

68:48and this is kind of a worldwide thing,

68:52but if you've got a corporation

68:55that is depending on some piece of software,

68:57the often various accounting and reporting standards say,

69:04if you don't have a support contract on this thing

69:08that your business is depending on,

69:11then that's bad.

69:14So if you've got a database, you need to pay for support.

69:21But there's a difference between

69:26the sort of support contracts

69:30that the average open source database producer charges

69:37and what somebody who is truly rapacious,

69:42like Oracle charges.

69:43- Yeah, so it's a balance, like you said.

69:47- It is absolutely a balance.

69:49And there are a lot of different ways

69:54to make the math work out for everybody.

70:05And the very unbalanced,

70:10like the winner takes all thing

70:18that happens in so much of modern commerce,

70:21that just doesn't work for me either.

70:25- I know you've talked about this in quite a few places,

70:31but you have created one of the most popular

70:36programming languages in the world.

70:39This is the programming language that I first learned

70:42about object-oriented programming with.

70:45I think it's a programming language

70:49that a lot of people use in a lot of different places

70:52and millions of devices today, Java.

70:55So the absurd question,

70:59but can you tell the origin story of Java?

71:03- So long time ago at Sun, in about 1990,

71:07there was a group of us who were kind of worried

71:12that there was stuff going on in the universe of computing

71:17that the computing industry was missing out on.

71:25And so a few of us started this project at Sun.

71:30The really got going,

71:32I mean, we started talking about it in 1990

71:34and it really got going in '91.

71:37And it was all about what was happening

71:44in terms of computing hardware,

71:48processors and networking and all of that

71:51that was outside of the computer industry.

§07Transcript · 1:11:54–1:24:03

71:54And that was everything from the sort of early glimmers

71:59of cell phones that were happening then to,

72:04you know, you look at elevators and locomotives

72:08and process control systems in factories

72:12and all kinds of audio equipment and video equipment.

72:17They all had processors in them

72:22and they were all doing stuff with them.

72:24And it sort of felt like there was something going on there

72:29that we needed to understand.

72:32And--

72:36- So C and C++ was in the air already.

72:39- Oh no, C and C++ absolutely owned the universe

72:42at that time.

72:43Everything was written in C and C++.

72:45- So where was the hunch

72:46that there was a need for a revolution?

72:48- Well, so the need for a revolution

72:50was not about a language.

72:54It was about, it was just as simple and vague

72:58as there are things happening out there.

73:03- We need to understand them.

73:05- We need to understand them.

73:06And so a few of us went on several

73:12somewhat epic road trips.

73:19- Literal road trips?

73:20- Literal road trips.

73:22It's like get on an airplane, go to Japan,

73:24visit Toshiba and Sharp and Mitsubishi

73:29and Sony and all of these folks.

73:33And because we worked for Sun,

73:36we had folks who were willing to give us introductions.

73:41We visited Samsung and a bunch of Korean companies

73:48and we went all over Europe, went to places

73:53like Phillips and Siemens and Thompson.

73:56- What did you see there?

74:00- For me, one of the things that sort of left out

74:03was that they were doing all the usual computer things

74:07that people had been doing like 20 years before.

74:10The thing that really left out to me

74:13was that they were sort of reinventing computer networking

74:18and they were making all the mistakes

74:24that people in the computer industry had made.

74:28And since I had been doing a lot of work

74:31in the networking area, we'd go and visit Company X,

74:36they'd describe this networking thing that they were doing.

74:40And just without any thought, I could tell them

74:43like the 25 things that were going to be complete disasters

74:48with that thing that they were doing.

74:50And I don't know whether that had any impact on any of them,

74:55but that particular story of sort of repeating

75:00the disasters of the computer science industry was there.

75:08And one of the things we thought was,

75:10well, maybe we could do something useful here

75:13with like bringing them forward somewhat.

75:16But also at the same time,

75:20we learned a bunch of things from these,

75:26mostly consumer electronics companies.

75:29And high on the list was that

75:38they viewed their like relationship

75:41with the customer as sacred.

75:43They were never, ever willing to make trade-offs

75:50between for safety, right?

75:56So one of the things that had always made me nervous

76:01in the computer industry was that

76:07people were willing to make trade-offs in reliability

76:11to get performance.

76:12They want faster, faster,

76:17it breaks a little more often because it's fast.

76:20Maybe you run it a little hotter than you should,

76:22or like the one that always blew my mind

76:26was the way that the folks at Cray Supercomputers

76:33got their division to be really fast

76:38was that they did Newton-Raphson approximations.

76:43And so, the bottom several bits of A over B

76:49were essentially random numbers.

76:53- What could possibly go wrong?

76:56- What could go wrong, right?

76:59And just figuring out how to nail the bottom bit,

77:04how to make sure that if you put a piece of toast

77:13in a toaster, it's not going to kill the customer.

77:17It's not gonna burst into flames and burn the house down.

77:21- So those are, I guess those are the principles

77:25that were inspiring, but how did,

77:28from the days of Java's called Oak,

77:33because of a tree outside the window story

77:35that a lot of people know,

77:36how did it become this incredible, like,

77:40powerful language?

77:44- Well, so it was a bunch of things.

77:46So we, you know, after all that, we started,

77:49you know, the way that we decided

77:51that we could understand things better

77:54was by building a demo, building a prototype of something.

77:59So kind of because it was easy and fun,

78:02we decided to build a control system

78:05for some home electronics, you know, TV, VCR,

78:09that kind of stuff.

78:11And as we were building it, we, you know,

78:14we sort of discovered that there were some things

78:18about standard practice in C programming

78:22that were really getting in the way.

78:26And it wasn't exactly, you know,

78:29because we were writing this,

78:31all the C code and C++ code,

78:34that we couldn't write it to do the right thing,

78:37but that one of the things that was weird in the group

78:42was that we had a guy who's, you know,

78:49his sort of top level job was he was a business guy.

78:52You know, he was sort of an MBA kind of person,

78:56you know, think about business plans and all of that.

78:58And, you know, there were a bunch of things

79:03that were kind of, you know,

79:05and we would talk about things that were going wrong

79:07and things that were going wrong,

79:10things that were going right.

79:11And, you know, as we thought about, you know,

79:14things like the requirements for security and safety,

79:19we would look at some low level details

79:21and see like naked pointers.

79:24- Yeah.

79:25- And, you know, so back in the early nineties,

79:30it was well understood that, you know,

79:36the number one source of like security vulnerabilities.

79:41- Is pointers.

79:42- Was just pointers, was just bugs.

79:44- Yeah.

79:46- And it was like, you know, 50, 60, 70%

79:50of all security vulnerabilities were bugs.

79:53And the vast majority of them were like buffer overflows.

79:57- Yeah.

79:58So you're like, we have to fix this.

80:00- We have to make sure that this cannot happen.

80:03And that was kind of the original thing for me

80:07was this cannot continue.

80:11And one of the things I find really entertaining this year

80:16was I forget which rag published it,

80:21but there was this article that came out

80:24that was an examination.

80:28It was sort of the result of an examination

80:31of all the security vulnerabilities in Chrome.

80:34And Chrome is like a giant piece of C++ code.

80:39And 60 or 70% of all the security vulnerabilities

80:44were stupid pointer tricks.

80:46And I thought it's 30 years later and we're still there.

80:53- Still there.

80:55- And we're still there.

80:56And you know, that's one of those, you know,

80:59slap your forehead and just want to cry.

81:04- Would you attribute,

81:07or is that too much of a simplification,

81:09but would you attribute the creation of Java

81:11to C pointers?

81:14Obvious problem.

81:16- Well, I mean, that was one of the trigger points.

81:21- And currency you've mentioned.

81:23- Concurrency was a big deal.

81:25You know, because when you're interacting with people,

81:30you know, the last thing you ever want to see

81:32is the thing like waiting.

81:35And, you know, issues about the software development process,

81:40you know, when faults happen, can you recover from them?

81:45What can you do to make it easier to create

81:50and eliminate complex data structures?

81:54What can you do to fix, you know,

81:57one of the most common C problems, which is storage leaks.

82:03And it's evil twin, the freed,

82:07but still being used piece of memory.

82:14You know, you free something and then you keep using it.

82:17- Oh, yeah.

82:19- You know, so when I was originally thinking about that,

82:21I was thinking about it in terms of,

82:23of sort of safety and security issues.

82:26And one of the things I sort of came to believe,

82:28came to understand was that it wasn't just about safety

82:32and security, but it was about developer velocity, right?

82:37So, and I got really religious about this

82:43because at that point I had spent an ungodly amount

82:46of my life hunting down mystery pointer bugs.

82:51And, you know, like two thirds of my time

82:59as a software developer was, you know,

83:02because the mystery pointer bugs tend to be

83:04the hardest to find because they tend to be

83:08very, very statistical.

83:11The ones that hurt, you know, they're, you know,

83:14they're like a one in a million chance.

83:16And--

83:20- But nevertheless create an infinite amount of suffering.

83:23- Right.

83:24Because when you're doing a billion operations a second,

83:27- Yeah.

83:28- You know, one in a million chance means

83:31it's going to happen.

83:32And so I got really religious about this thing,

83:38about, you know, making it so that if something fails,

83:41it fails immediately and visibly.

83:44And, you know, one of the things that was a real

83:50attraction of Java to lots of development shops was that,

83:55you know, we get our code up and running twice as fast.

84:01- You mean like the entirety of the development process,

84:03debugging, all that kind of stuff?

§08Transcript · 1:24:05–1:35:24

84:05- Yeah, if you, you know, so if you measure time from,

84:09you know, you first touch fingers to keyboard

84:13until you get your first demo out,

84:15not much different.

84:21But if you look from fingers touching keyboard

84:23to solid piece of software that you could release

84:27in production, it would be way faster.

84:32- And I think what people don't often realize is,

84:34yeah, there's things that really slow you down,

84:36like it's hard to catch bugs probably is the thing

84:41that really slows down that.

84:43- It really slows things down.

84:45But also there were, you know, one of the things

84:47that you get out of object oriented programming

84:51is a strict methodology about, you know,

84:53what are the interfaces between things?

84:56And being really clear about how parts relate to each other.

85:00And what that helps with is so many times what people do

85:07is they kind of like sneak around the side.

85:12So if you've built something and people are using it,

85:15and then, and you say, well, okay, you know,

85:20I built this thing, you use it this way.

85:23And then you change it in such a way that it still does

85:27what you said it does,

85:28it just does it a little bit different.

85:30Then you find out that somebody out there

85:33was sneaking around the side,

85:35they sort of tunneled in a back door,

85:38and this person, their code broke.

85:42And because they were sneaking through a side door.

85:47And normally the attitude is,

85:52(laughs)

85:54dummy.

85:55But a lot of times, you know, you can't get away,

86:01you can't just slap their hand and tell them to not do that.

86:06Because, you know, it's, you know, somebody's,

86:10you know, some banks, you know,

86:15account reconciliation system that, you know,

86:19some developer decided, oh, I'm lazy, you know,

86:22I'll just sneak through the back door.

86:24- And because the language allows it,

86:26I mean, you can't even mad at them.

86:28- Yeah, and so one of the things I did

86:30that on the one hand upset a bunch of people,

86:33it was that I made it so that

86:36you really couldn't go through back doors, right?

86:38So the whole point of that was to say,

86:41if you need, you know, if the interface here isn't right,

86:47the wrong way to deal with that is go through a back door.

86:51The right way to deal with it is to walk up

86:53to the developer of this thing and say,

86:55- Change the interface.

86:56- Fix it.

86:57- Yep.

86:58- Right, and so it was kind of like

87:00a social engineering thing.

87:01- Yeah.

87:02- And,

87:03- It's brilliant.

87:05- And people ended up discovering

87:07that that really made a difference in terms of,

87:12you know, and a bunch of this stuff, you know,

87:14if you're just like screwing around,

87:16writing your own, like, you know,

87:18class project scale stuff,

87:20a lot of this stuff doesn't,

87:22isn't quite so important because, you know,

87:27you're, you know, both sides of the interface,

87:29but, you know, when you're building, you know,

87:34sort of larger, more complex pieces of software

87:37that have a lot of people working on them,

87:40and especially when they like span organizations,

87:46you know, having really clear,

87:49having clarity about how that stuff gets structured

87:52saves your life.

87:54- Yeah.

87:54- And, you know, especially, you know,

87:58there's so much software that is fundamentally untestable,

88:03you know, until you do the real thing.

88:08- It's better to write good code in the beginning

88:12as opposed to writing crappy code

88:13and then trying to fix it and,

88:15- Yeah. - trying to scramble

88:16and figure out and through testing,

88:19figure out where the bugs are.

88:20- Yeah, it's like, it's like, it's like,

88:23which shortcut caused that rocket

88:28to not get where it was needed to go?

88:30- So I think one of the most beautiful ideas

88:36philosophically and technically is of a virtual machine,

88:41the Java virtual machine.

88:45Again, I apologize to romanticize things,

88:47but how did the idea of the JVM come to be?

88:52How to you radical of an idea it is?

88:56'Cause it seems to me to be just a really interesting idea

89:01in the history of programming.

89:03- So, - And what is it?

89:05- So the Java virtual machine,

89:07you can think of it in different ways

89:14because it was carefully designed

89:17to have different ways of viewing it.

89:19So one view of it that most people

89:22don't really realize is there,

89:25is that you can view it as sort of an encoding

89:30of the abstract syntax tree in reverse Polish notation.

89:36I don't know if that makes any sense at all.

89:41I could explain it and that would blow all over time.

89:44- Yeah.

89:45- But the other way to think of it

89:46and the way that it ends up being explained

89:50is that it's like the instruction set of an abstract machine

89:55that's designed such that you can translate

90:00that abstract machine to a physical machine.

90:03And the reason that that's important,

90:07so if you wind back to the early '90s

90:10when we were talking to all of these companies

90:14doing consumer electronics

90:16and you talk to the purchasing people,

90:20there were interesting conversations with purchasing.

90:25So if you look at how these devices come together,

90:32they're sheet metal and gears and circuit boards

90:36and capacitors and resistors and stuff.

90:40And everything you buy has multiple sources, right?

90:45So you can buy a capacitor from here,

90:49you can buy a capacitor from there

90:52and you've got kind of a market

90:54so that you can actually get a decent price for a capacitor.

90:59But CPUs and particularly in the early '90s

91:08CPUs were all different and all proprietary.

91:13So if you use the chip from Intel,

91:18you had to be an Intel customer

91:22till the end of time.

91:25Because if you wrote a bunch of software,

91:28when you wrote software using whatever technique you wanted

91:33and C was particularly important

91:36and C was particularly bad about this

91:39because there was a lot of properties

91:43of the underlying machine that came through.

91:47- So you were stuck, so the code you wrote,

91:50you were stuck to that particular machine.

91:51- You were stuck to that particular machine,

91:54which meant that they couldn't decide,

91:56you know, Intel is screwing us.

92:01I'll start buying chips from, you know, Bob's Better Chips.

92:06This drove the purchasing people absolutely insane

92:12that they were welded into this decision.

92:19And they would have to make this decision

92:22before the first line of software was written.

92:25- It's funny that you're talking about the purchasing people.

92:28So there's one perspective, right?

92:31There's a lot of other perspectives

92:32that all probably hated this idea.

92:35- Right.

92:36- But from a technical aspect,

92:37just like the creation of an abstraction layer

92:41that's agnostic to the underlying machine

92:45from the perspective of the developer,

92:48I mean, that's brilliant.

92:50- Right, well, and, you know,

92:54so that's like across the spectrum of providers of chips.

92:58But then there's also the time thing

93:00because, you know, as you went from one generation

93:04to the next generation to the next generation,

93:06they were all different.

93:07And you would often have to rewrite your software.

93:10- Oh, you mean generations of machines of different kinds?

93:14- Yeah, so like one of the things

93:18that sucked about a year out of my life

93:20was when San went from the Motorola 68010 processor

93:28to the 68020 processor.

93:31Then they had a number of differences

93:33and one of them hit us really hard.

93:36And I ended up being the point guy

93:41on the worst case of where

93:44the new instruction cache architecture hurt us.

93:49- Well, okay, so I mean, so when did this idea,

93:52I mean, okay, so yeah, you articulate a really clear

93:56fundamental problem in all of computing,

93:59but where do you get the guts to think

94:02we can actually solve this?

94:05- You know, in our conversations with all of these vendors,

94:09you know, these problems started to show up.

94:12And I kind of had this epiphany

94:19because it reminded me of a summer job

94:27that I had had in grad school.

94:29So back in grad school, my thesis advisor,

94:36well, I had two thesis advisors for bizarre reasons.

94:41One of them was a guy named Raj Reddy,

94:44the other one was Bob Sproul.

94:46And Raj, I love Raj, I really love both of them.

94:53- Yeah, Raj is amazing.

94:56- So the department had bought a bunch of

95:01like early workstations

95:06from a company called Three Rivers Computer Company.

95:09And Three Rivers Computer Company

95:13was a bunch of electrical engineers

95:15who wanted to do as little software as possible.

95:17So they knew that they'd need to have like compilers

95:23and an OS and stuff like that,

95:24but they didn't wanna do any of that.

§09Transcript · 1:35:26–1:46:43

95:26And they wanted to do that

95:28for as close to zero money as possible.

95:31So what they did was they built a machine

95:36whose instruction set was literally the byte code

95:43for UCSD Pascal, the P code.

95:50And so we had a bunch of software

95:55that was written for this machine.

96:00And for various reasons,

96:05the company wasn't doing terrifically well.

96:08We had all this software on these machines

96:10and we wanted it to run on other machines,

96:12principally the VAX.

96:19And so Raj asked me if I could come up with a way

96:24to port all of this software

96:27- Translate it.

96:28- From the PERC machines to VAXs.

96:33And I think he, you know what he had in mind

96:40was something that would translate from like Pascal to C

96:48or Pascal to, actually at those times,

96:51pretty much it was, you could translate to C or C.

96:55And if you didn't like translate to C,

96:57you could translate to C.

96:58There was, you know, it's like the Henry Ford,

97:04you know, any color you want,

97:05just as long as it's black.

97:07And I went, that's really hard.

97:13- That's a...

97:16- And I noticed that, you know,

97:19and I was like looking at stuff and I went,

97:21ooh, I bet I could rewrite the P code

97:26into VAX assembly code.

97:27And then I started to realize that, you know,

97:33there were some properties of P code

97:36that made that really easy,

97:38some properties that made it really hard.

97:40So I ended up writing this thing that translated

97:44from P code on the three rivers perks

97:49into assembly code on the VAX.

97:52And I actually got higher quality code than the C compiler.

97:58And so everything just went, got really fast.

98:03It was really easy.

98:04It was like, wow, I thought that was a sleazy hack

98:08'cause I was lazy.

98:10And in actual fact, it worked really well.

98:14And I tried to convince people

98:16that that was maybe a good thesis topic.

98:19And nobody was, you know, it was like, nah.

98:26- Really?

98:27That's, I mean, yeah.

98:29It's kind of a brilliant idea, right?

98:31Maybe you didn't have the,

98:34you weren't able to articulate the big picture of it.

98:37- Yeah, and I think, you know, that was a key part.

98:42But so then, you know, clock comes forward a few years

98:47and it's like, we've got to be able to, you know,

98:51if they want to be able to switch from, you know,

98:54this weird microprocessor to that weird

98:57and totally different microprocessor, how do you do that?

99:00And I kind of went, oh, maybe by doing something

99:05kind of in the space of, you know, Pascal P code,

99:11you know, I could do like multiple translators.

99:14And I spent some time thinking about that

99:17and thinking about, you know, what worked

99:18and what didn't work when I did the P code to Vax translator.

99:23And I talked to some of the folks

99:29who were involved in Smalltalk

99:30because Smalltalk also did a bytecode.

99:32And then I kind of went, yeah, I want to do that.

99:41'Cause that, you know, and it had the other advantage

99:45that you could either interpret it or compile it.

99:48And interpreters are usually easier to do

99:55but not as fast as a compiler.

99:58And so I figured, good, I can be lazy again.

100:03You know, sometimes I think that most of my good ideas

100:09are driven by laziness.

100:12And often I find that some of the people's stupidest ideas

100:15are because they're insufficiently lazy.

100:17They just want to build something really complicated.

100:23It's like, it doesn't need to be that complicated.

100:26Yeah, and so that's how that came out.

100:30You know, but that also turned into kind of,

100:37you know, almost a religious position on my part,

100:39which got me in several other fights.

100:44So like one of the things that was a real difference

100:49was the way that arithmetic worked.

100:51You know, once upon a time,

100:57there were, you know, it wasn't always

100:59just two's complement arithmetic.

101:01There were some machines

101:02that had one's complement arithmetic,

101:04which was like almost anything built by CDC.

101:07And occasionally there were machines

101:10that were decimal arithmetic.

101:12And I was like, this is crazy.

101:16You know, pretty much two's complement

101:20integer arithmetic has one.

101:22So just--

101:24- Let's just do that.

101:26- Just do that.

101:27One of the other places where there was a lot of variability

101:31was in the way that floating point behaved.

101:34And that was causing people

101:37throughout the software industry much pain

101:42because you couldn't do a numerical computing library

101:46that would work on CDC

101:48and then have it work on an IBM machine

101:50and then work on a DEC machine.

101:52And as a part of that whole struggle,

101:56there had been this big body of work

102:00on floating point standards.

102:04And this thing emerged that came to be called IEEE 754,

102:09which is the floating point standard

102:12that pretty much has taken over the entire universe.

102:16And at the time I was doing Java,

102:21it had pretty much completed taking over the universe.

102:25There were still a few pockets of holdouts,

102:27but I was like, you know,

102:30it's important to be able to say what two plus two means.

102:33- Yeah.

102:36- And so I went that.

102:40And one of the ways that I got into fights with people

102:45was that there were a few machines

102:48that did not implement IEEE 754 correctly.

102:52- Of course, that's all short term.

102:57- Short term kind of fights.

102:58I think in the long term, I think this vision is one out.

103:03- Yeah, and I think it's, you know,

103:05and it worked out over time.

103:06I mean, the biggest fights were with Intel

103:09because they had done some strange things with rounding.

103:15They'd done some strange things

103:16with their transcendental functions,

103:19which turned into a mushroom cloud of, you know, weirdness.

103:25And in the name of optimization,

103:27but from the perspective of the developer,

103:30that's not good.

103:32- Well, their issues with transcendental functions

103:34were just stupid.

103:35- Okay, so that's not even a trade off.

103:39That's just absolutely.

103:40- Yeah, they were doing range reduction

103:42in first sign and cosine using a slightly wrong value for pi.

103:47- Got it.

103:49We've got 10 minutes.

103:50So in the interest of time, two questions.

103:53So one about Android and one about life.

103:55So one, I mean, we could talk for many more hours.

104:02I hope eventually we might talk again,

104:05but I gotta ask you about Android

104:07and the use of Java there

104:09because it's one of the many places where Java

104:13just has a huge impact on this world.

104:16Just on your opinion,

104:18is there things that make you happy

104:22about the way Java is used in the Android world?

104:25And are there things that you wish were different?

104:29- I don't know how to do a short answer to that,

104:32but I have to do a short answer to that.

104:34So, you know, I'm happy that they did it.

104:37Java had been running on cell phones at that time

104:41for quite a few years and it worked really, really well.

104:44There were things about how they did it.

104:49And in particular,

104:51various ways that they

104:55kind of, you know, violated all kinds of contracts.

105:00The guy who led it, Andy Rubin,

105:03he crossed a lot of lines.

105:06- There's some lines crossed.

105:07- Yeah, lines were crossed

105:09that have since, you know, mushroomed into giant court cases.

105:16And, you know, they didn't need to do that.

105:19And in fact, it would have been so much cheaper

105:22for them to not cross lines.

105:25- I mean, I suppose they didn't anticipate

105:28the success

105:30of this whole endeavor.

105:33Or do you think at that time it was already clear

105:36that this is gonna blow up?

105:38- I guess I sort of came to believe

105:42that it didn't matter what Andy did, it was gonna blow up.

105:46(laughing)

105:47- Okay.

105:48- He's, you know, I kind of started to think of him

105:52as like a manufacturer of bombs.

105:55- Yeah.

105:59Some of the best things in this world come about

106:02through a little bit of explosive.

106:05- Well, and some of the worst.

106:07- And some of the worst, beautifully put.

106:09But is there, and like you said, I mean,

106:13does that make you proud that Java is in--

106:16- Yeah.

106:17- Is in millions, I mean, it could be billions of devices.

106:21- Yeah, well, I mean, it was in billions of phones

106:25before Android came along.

106:26And, you know, I'm just as proud as, you know,

106:33of the way that like the smart card standards adopted Java.

106:38And they did a, you know, everybody involved in that

106:41did a really good job.

106:43And that's, you know, billions and billions.

§10Transcript · 1:46:46–1:50:54

106:46- That's crazy.

106:49- The SIM cards, you know, the SIM cards in your pocket.

106:53- Yeah, I mean, it's--

106:54- I've been outside of that world for a decade,

106:57so I don't know how that has evolved,

107:00but, you know, it's just been crazy.

107:04- So on that topic, let me ask,

107:06again, there's a million technical things

107:11we could talk about, but let me ask the absurd,

107:14the old philosophical question about life.

107:17What do you hope when you look back at your life

107:23and people talk about you, write about you

107:27500 years from now, what do you hope your legacy is?

107:31- People not being afraid to take a leap of faith.

107:39I mean, you know, I've got this kind of weird history

107:44of doing weird stuff and--

107:46- It worked out pretty damn well.

107:49- It worked out, right?

107:50And I think some of the weirder stuff that I've done

107:53has been the coolest and some of it crashed and burned.

108:00You know, I think well over half of the stuff

108:05that I've done has crashed and burned,

108:08which has occasionally been really annoying.

108:10- But still you kept doing it.

108:13- But yeah, yeah, yeah.

108:16And you know, even when things crash and burn,

108:19you at least learn something from it.

108:22- By way of advice, you know, people, developers,

108:26engineers, scientists, or just people who are young

108:30to look up to you, what advice would you give them?

108:34How to approach their life?

108:37- Don't be afraid of risk.

108:39It's okay to do stupid things once.

108:42(both laughing)

108:45- Maybe a couple of times.

108:46- You know, you get a pass on the first time or two

108:50that you do something stupid.

108:53You know, the third or fourth time, yeah, not so much.

108:55But also, you know, I don't know why,

109:04but really early on I started to think about

109:09ethical choices in my life.

109:13And because I'm a big science fiction fan,

109:18I got to thinking about like just about

109:24every technical decision I make in terms of,

109:28how do you want, you know,

109:29are you building Blade Runner or Star Trek?

109:33- Which one's better?

109:34- Which future would you rather live in?

109:37You know?

109:39- So what's the answer to that?

109:40- Well, I would sure rather live

109:43in the universe of Star Trek.

109:45- Yeah, that opens up a whole topic about AI,

109:48but that's a really interesting.

109:49- Yeah, yeah, yeah.

109:51- It's a really interesting idea.

109:53So your favorite AI system would be data from Star Trek.

109:58- And my least favorite would easily be Skynet.

110:00- Yeah.

110:01(laughing)

110:02Beautifully put.

110:03I don't think there's a better way to end it, James.

110:05I can't say enough how much of an honor it is

110:08to meet you, to talk to you.

110:09Thanks so much for wasting your time with me today.

110:12- Not a waste at all.

110:13- Thanks, James.

110:14- All right, thanks.

110:16- Thanks for listening to this conversation

110:18with James Gosling, and thank you to our sponsors,

110:20Public Goods, BetterHelp, and ExpressVPN.

110:24Please check out these sponsors in the description

110:26to get a discount and to support this podcast.

110:30If you enjoy this thing, subscribe on YouTube,

110:32review it with Five Stars on Apple Podcasts,

110:34follow on Spotify, support on Patreon,

110:37or connect with me on Twitter @LexFriedman.

110:40And now, let me leave you with some words

110:42from James Gosling.

110:44One of the toughest things about life is making choices.

110:48Thank you for listening, and hope to see you next time.

110:52(upbeat music)

110:54(upbeat music)

— 读到这里,多懂一点。 —