Lex Fridman PodcastJames Gosling: Java, JVM, Emacs, and the Early Days of Computing | Lex Fridman Podcast #126
EVERY SPOKEN WORD
150 min read · 30,111 words- 0:00 – 4:45
Introduction
- LFLex Fridman
The following is a conversation with James Gosling, the founder and lead designer behind the Java programming language, which in many indices is the most popular programming language in the world, or is always at least in the top two or three. We only had a limited time for this conversation, but I'm sure we'll talk again several times in this podcast. A quick summary of the sponsors: Public Goods, BetterHelp, and ExpressVPN. Please check out these sponsors in the description to get a discount and to support this podcast. As a side note, let me say that Java is the language with which I first learned object-oriented programming, and with it, the art and science of software engineering. Also, early on in my undergraduate education, I took a course on concurrent programming with Java. Looking back at that time, before I fell in love with neural networks, the art of parallel computing was both algorithmically and philosophically fascinating to me. The concept of a computer in my mind before then was something that does one thing at a time. The idea that we could create an abstraction of parallelism where you can do many things at the same time while still guaranteeing stability and correctness was beautiful. While some folks in college took drugs to expand their mind, I took concurrent programming. If you enjoy this thing, subscribe on YouTube, review it with five stars on Apple Podcast, follow on Spotify, support on Patreon, or connect with me on Twitter, @lexfridman. As usual, I'll do a few minutes of ads now and no ads in the middle. I try to make these interesting, but I do give you timestamps, so go ahead and skip, but please do check out the sponsors by clicking the links in the description. It's the best way to support this podcast. This show, sponsored by Public Goods, the one-stop shop for affordable, sustainable, healthy household products. I take their fish oil and use their toothbrush, for example. Their products often have a minimalist black and white design that I find to be just beautiful. Some people ask why I wear this black suit and tie. There's a simplicity to it that, to me, focuses my mind on the most important bits of every moment of every day, pulling only at the thread of the essential in all that life has to throw at me. It's not about how I look, it's about how I feel. That's what design is to me; creating an inner conscious experience, not an external look. Anyway, Public Goods plants one tree for every order placed, which is kind of cool. Visit publicgoods.com/lex or use code Lex at checkout to get 15 bucks off your first order. This show is also sponsored by BetterHelp, spelled H-E-L-P, help. Check it out at betterhelp.com/lex. They figure out what you need and match you with a licensed professional therapist in under 48 hours. I chat with a person on there and enjoy it. Of course, I also regularly talk to David Goggins these days, who is definitely not a licensed professional therapist, but he does help me meet his and my demons and become comfortable to exist in their presence. Everyone is different, but for me, I think suffering is essential for creation, but you can suffer beautifully, in a way that doesn't destroy you. I think therapy can help in whatever form that therapy takes, and I do think that BetterHelp is an option worth trying. They're easy, private, affordable, and available worldwide. You can communicate by text any time and schedule weekly audio and video sessions. Check it out at betterhelp.com/lex. This show is also sponsored by ExpressVPN. You can use it to unlock movies and shows that are only available in other countries. I did this recently with Star Trek Discovery on UK Netflix, mostly because I wonder what it's like to live in London. I'm thinking of moving from Boston to a place where I can build the business I've always dreamed of building. London is probably not in the top three, but top 10 for sure. The number one choice currently is Austin, for many reasons that I'll probably speak to another time. San Francisco unfortunately dropped out from the number one spot, but it's still in the running. If you have advice, let me know. Anyway, check out ExpressVPN. It lets you change your location to almost 100 countries and it's super fast. Go to expressvpn.com/lexpod to get an extra three months of ExpressVPN for free. That's expressvpn.com/lexpod. And now, here's my conversation with James Gosling.
- 4:45 – 8:04
Irrational numbers
- LFLex Fridman
I've read somewhere that the square root of two is your favorite irrational number.
- JGJames Gosling
I have no idea where that got started.
- LFLex Fridman
(laughs)
- JGJames Gosling
Um...
- LFLex Fridman
Is there any truth to it? Is there anything in mathematics or numbers that you find beautiful?
- JGJames Gosling
Oh, well, there's lots of things in, in math that's really beautiful. Um, you know, I, I used to consider myself really good at math and these days I consider myself really bad at math. I never had... really had a thing for the square root of two, but when I was a teenager, there was this book called the, The Dictionary of Curious and Interesting Numbers.
- LFLex Fridman
Mm-hmm.
- JGJames Gosling
Which, for some reason, I read through and damn near memorized the whole thing. And I started this weird habit of when I was like filling out checks, you know, or, you know, paying for things with credit cards, I would want to make the, the receipt add up to an interesting number.
- LFLex Fridman
Hmm. Is there some numbers that stuck with you that just kind of make you feel good?
- JGJames Gosling
They all have a story and fortunately, I've actually mostly forgotten all of them.
- LFLex Fridman
(laughs)
(laughs)
- JGJames Gosling
Um...
- LFLex Fridman
Are they, uh, so like 42? Uh...
- JGJames Gosling
Well, yeah, I mean-
- LFLex Fridman
That one-
- JGJames Gosling
42 is pretty magical.
- LFLex Fridman
And then the irrationals. I mean, but is there a square root of two story in there somewhere? How did that-
- JGJames Gosling
Well-
- LFLex Fridman
... rumor get started?
- JGJames Gosling
... in that it's, it's like the only number that has destroyed religion.
- LFLex Fridman
(laughs) In which way? (laughs)
- JGJames Gosling
Well, the, the Pythagoreans, they, they believed that all numbers were perfect and you could re- represent anything as, as a, as a rational number. And, um, in that, in that time period, um, the, this proof came out that there was no, you know, rational fraction whose value was equal to the square root of two.
- LFLex Fridman
And that-
- JGJames Gosling
Huh.
- LFLex Fridman
... that means nothing in this world is perfect, not even mathematics.
- JGJames Gosling
Well, it, it means that your definition of perfect was imperfect. (laughs)
- LFLex Fridman
Well then-
- JGJames Gosling
Right?
- LFLex Fridman
... then there's the Godel incompleteness theorems in the 20th century that ruined it once again for everybody.
- 8:04 – 10:36
Math and programming
- LFLex Fridman
so with your kind of early, uh, love or appreciation of the beauty of mathematics, do, do you see a parallel between that world and the world of programming?
- JGJames Gosling
You know, programming is all about logical structure, understanding the, the patterns that, um, come out of computation, understanding sort of... I mean, it's often like, you know, the path through the graph of possibilities to find a, a short, a short route.
- LFLex Fridman
Meaning like, uh, find a short program that gets the job done-
- JGJames Gosling
Yeah.
- LFLex Fridman
... kind of thing? But, uh, so then on the topic of irrational numbers, (laughs) do you, do you see, do you see programming... You just painted it so cleanly, uh, it's a little, this trajectory to find like a nice little program, but do you see it as fundamentally messy-
- JGJames Gosling
Um-
- LFLex Fridman
... m- maybe unlike mathematics?
- JGJames Gosling
I don't think of it as... I mean, I mean, y- you know, you watch somebody who's good at math do math and, you know, often it's, it's fairly messy. Sometimes it's kind of magical. Um, when I was a grad student, um, one of the students, his name was Jim Saxh, was... He had this, this, this, this, this reputation of being sort of a, a walking, talking human, uh, theorem proving machine.
- LFLex Fridman
Hmm.
- JGJames Gosling
And if you were having a hard problem with something, you could just, like, accost him in the hall and say, "Jim, da-da-da-da," and, and he would do this, this, this funny thing where he would stand up straight, his eyes would kind of defocus. He'd go, "Uh..." You know, just, just like you, you know, like, like something in today's movies. He'd just be like, "Uh..."
- LFLex Fridman
Yeah.
- JGJames Gosling
And then he'd straighten up and say, "N log N," and walk away.
- LFLex Fridman
(laughs)
- JGJames Gosling
And, and y- and you'd go, "Well, okay, so N log N is the answer. How did he get there?" By which time he's, you know, down the hallway somewhere.
- LFLex Fridman
Yeah. Y- yeah, he's just the, the oracle, the black box that just gives you the answer.
- JGJames Gosling
Yeah.
- LFLex Fridman
You-
- JGJames Gosling
And then you have to figure out the path from the question to the answer.
- 10:36 – 14:41
Coding style
- JGJames Gosling
- LFLex Fridman
I think in one of the videos I watched you mentioned, uh, Don Knuth, uh, well, at least recommending his, uh, you know, his, hi- his book as something people should read.
- JGJames Gosling
Oh yeah.
- LFLex Fridman
But in terms of, you know, theoretical computer science, do y- do you see something beautiful in, in, that has been inspiring to you, speaking of N log N, in your work on programming languages, uh, that's in the, in the, that whole world of algorithms and complexity and, you know, these kinds of more formal mathematical things?
- JGJames Gosling
Um...
- LFLex Fridman
Or did that not really stick with you in your programming life?
- JGJames Gosling
W- it, it did stick pretty c- clearly for me, because one of the things that I care about is being able to (breathes deeply) sort of look at a piece of code and, and be able to prove to myself that it works. Um, you know, and, you know, so, so for example, I find that, um, I'm, I'm at odds with many of the people around me over, um, issues about, like, how you lay out a piece of software, right? You know, so, so software engineers get really cranky about how they format their- the documents that are the programs, you know, w- where they put new lines and where they put, you know-
- LFLex Fridman
The braces, and-
- JGJames Gosling
The braces and-
- LFLex Fridman
... spaces and tabs.
- JGJames Gosling
... all the rest of that, right? And...I tend to go for a, a style that's very dense.
- LFLex Fridman
Hmm.
- JGJames Gosling
Um...
- LFLex Fridman
So minimize the white space.
- JGJames Gosling
Um, yeah. Well, to maximize the amount that I can see at once, right?
- LFLex Fridman
Got it.
- JGJames Gosling
So I like to be able to see a whole function and to understand what it does, rather than have to go scroll, scroll, scroll and remember, right?
- LFLex Fridman
Yeah. I'm with you on-
- JGJames Gosling
Yeah.
- LFLex Fridman
... that. Yeah. That's...
- JGJames Gosling
And-
- LFLex Fridman
And people don't like that?
- JGJames Gosling
Yeah. I've, I've had-
- LFLex Fridman
(laughs)
- JGJames Gosling
I, I've had, you know, multiple times when engineering teams have, uh, staged what was effectively an intervention.
- LFLex Fridman
(laughs)
- JGJames Gosling
Um, you know, where they, they, they invite me to a meeting and everybody's arrived before me, and they sort of all look at me and say, "James, about your coding style."
- LFLex Fridman
(laughs)
- JGJames Gosling
I'm sort of an odd person to be programming because I don't think very well verbally. Um, I am just naturally a slow reader.
- LFLex Fridman
Hmm.
- 14:41 – 23:54
First computer
- LFLex Fridman
access. What's the first program you've ever written?
- JGJames Gosling
Oh.
- LFLex Fridman
(laughs)
- JGJames Gosling
I have no idea what the first one was. I mean, I, I know the first machine that I learnt, that, that I learned to program on.
- LFLex Fridman
What is it?
- JGJames Gosling
Was a, a PDP-8, um, at the University of Calgary.
- LFLex Fridman
Do you remember the specs?
- JGJames Gosling
Oh yeah. It... So, so the thing had 4K of RAM.
- LFLex Fridman
Nice.
- JGJames Gosling
12 bit words. The clock rate was, um, it was about a third of a megahertz.
- LFLex Fridman
Oh, so it didn't even get to the, to the M. Okay.
- JGJames Gosling
Yeah.
- LFLex Fridman
(laughs)
- JGJames Gosling
Yeah. So, you know, we're, we're like 10,000 times faster these days. Um...
- LFLex Fridman
And was this kind of a, like a super compute- like a serious computer for-
- JGJames Gosling
No, the PDP-8I was the, the first thing that people were calling like mini computer.
- LFLex Fridman
Got it.
- JGJames Gosling
They were sort of inexpensive enough that y- that a university lab could maybe afford to buy one.
- LFLex Fridman
And was there time-sharing, all that kind of stuff? Or no?
- JGJames Gosling
Um, there, there actually was a time-sharing OS for that, but it wasn't used really widely. The machine that I learned on was one that was kind of hidden in the back corner of the, of the computer center. Um, and it was, it was bought as a, as part of a, a, um, project to do computer networking. Um, but, you know, they didn't actually use it very much. It was mostly just kind of sitting there.
- LFLex Fridman
Mm-hmm.
- JGJames Gosling
And it was kind of sitting there and I noticed it was just kind of sitting there. And so I started fooling around with it, and nobody seemed to mind. So I just kept doing that and...
- LFLex Fridman
It had a keyboard and like a, a monitor? Or, or were you-
- JGJames Gosling
Oh, this is way before monitors were common. So it was, it was literally a, a Model 33 Teletype...
- LFLex Fridman
Okay.
- JGJames Gosling
... with a paper tape reader. (laughs)
- LFLex Fridman
(laughs) Okay, so the user interface wasn't very good. Okay. (laughs)
- JGJames Gosling
Yeah. Yeah. It was-
- LFLex Fridman
Uh...
- JGJames Gosling
It was the first computer ever built with integrated circuits. But by integrated circuits, I mean that they would have like 10 or 12 transistors on one piece of silicon.
- 23:54 – 27:22
Lisp
- LFLex Fridman
... world. That said, you've also showed appreciation for the greatest language, um, ever that, uh, I think everyone agrees is Lisp. Um-
- JGJames Gosling
Well, Lisp is definitely on my list of the greatest ones that have li- have, um, existed.
- LFLex Fridman
Is that at number one? Or, I mean...
- JGJames Gosling
Um...
- LFLex Fridman
Or are you... ? I mean...
- JGJames Gosling
You know, the... you know, the thing is that it's-
- LFLex Fridman
(laughs)
- JGJames Gosling
... that... y- you know, I wouldn't put it number one, no.
- LFLex Fridman
Is it the parentheses? What, uh-
- JGJames Gosling
Um, n- no, no.
- LFLex Fridman
What do you love and what do you not love about Lisp?
- JGJames Gosling
Um-Well, I guess the number one thing to not love about it, it is so freaking many parentheses.
- LFLex Fridman
Yeah.
- JGJames Gosling
Um, on the, on the love thing is, you know, out of those tons of parentheses, you actually get an interesting language structure. And I've always thought that there was a friendlier version of Lisp hiding out there somewhere. Um, but I've never really spent much time...
- LFLex Fridman
Thinking about it.
- JGJames Gosling
... thinking about it. But, you know, so like, like up the food chain for me, um, the, from Lisp is Simula, which a very small number of people have ever used.
- LFLex Fridman
But a lot of people, I think, had a huge influence, right?
- JGJames Gosling
Yeah.
- LFLex Fridman
Um, you know, the programming but... And the Simula, I- I apologize if I'm wrong on this, but is that one of the first functional languages?
- JGJames Gosling
Um...
- LFLex Fridman
Or no?
- JGJames Gosling
No. It was, it was-
- LFLex Fridman
Object-oriented?
- JGJames Gosling
It was the first object-oriented programming language.
- LFLex Fridman
Yes, yeah. Got it.
- JGJames Gosling
It's really where object-oriented and languages sort of came together. Um, and it was also the, the language where coroutines first showed up as a part of the language. So, you could have a programming style that was... You could think of it as multi-par- uh, sort of multi-threaded with a lot of parallel- parallelism.
- LFLex Fridman
Really? Y- there's ideas of parallelism in there?
- JGJames Gosling
Yeah. Yeah.
- LFLex Fridman
Like-
- JGJames Gosling
So that was, that was back, you know... So, so the first Simula spec was Simula '67. Um-
- 27:22 – 35:15
Write an Emacs implementation in C
- LFLex Fridman
To, to return to, uh, the world of Lisp for (laughs) for a brief moment, you, uh, at CMU, you've, you, uh, wrote a version of Emacs-
- JGJames Gosling
Yeah.
- LFLex Fridman
... that, that I think was very impactful on the history of Emacs. Uh, what, what was your motivation for-
- JGJames Gosling
Um-
- LFLex Fridman
... for doing so?
- JGJames Gosling
A- at, at that time... So that was in like '85 or '86. Um, I had been using Unix for a few years. And, um, most of the editing was this, this tool called ed, um, which was sort of an ancestor of vi. And-
- LFLex Fridman
Is it, is it a pretty good editor? Not a good editor?
- JGJames Gosling
Well, if, if what you're using... Um, if your input device is a Teletype, it's pretty good.
- LFLex Fridman
Yeah.
- JGJames Gosling
It's certainly more humane than TECO, which was kind of the, the common thing in, in a lot of, um, the DEC universe at the time.
- LFLex Fridman
TECO is spelled T-K? Is that the... No.
- JGJames Gosling
No. TECO. T-E-C-O. The Text Editor and Corrector.
- LFLex Fridman
Corrector. Wow, so many features.
- JGJames Gosling
Um...
- LFLex Fridman
(laughs)
- JGJames Gosling
And the original Emacs, um, came out as... So, Emacs stands for Editor Macros. And TECO had a way of writing macros, and so the original, um, Emacs from MIT sort of started out as a collection of macros for TECO, but then, you know, you know, the, the sort of Emacs style got, got popular originally at, at, at MIT, and then people did a few other implementations of, of Emacs that were... You know, the, the, the code base was entirely different, but it was sort of the philosophical style of the original Emacs.
- LFLex Fridman
What was the pho- philosophy of Emacs? And by the way, were all the implementations always in C? And then-
- JGJames Gosling
No. No.
- LFLex Fridman
And how does Lisp fit into the picture?
- JGJames Gosling
No. So, so the very first Emacs was written as a bunch of macros for the TECO text editor.
- LFLex Fridman
Wow. That's so interesting.
- JGJames Gosling
And the, the, the macro language for TECO was probably the most ridiculously obscure format. You know, if you just look at a TECO program on a, on a page, you think it was just random characters.
- LFLex Fridman
Okay.
- JGJames Gosling
It really looks like just line noise.
- LFLex Fridman
Just kind of like LaTeX or something?
- JGJames Gosling
Oh-
- LFLex Fridman
Like, worse?
- JGJames Gosling
Oh, way worse than LaTeX.
- LFLex Fridman
(laughs)
- JGJames Gosling
Way, way worse than LaTeX. Um, but, you know, if you use TECO a lot, which I did, the, the... TECO was completely optimized for touch typing-
- 35:15 – 45:57
Early days of the Internet
- LFLex Fridman
I mean, can I ask briefly what were those early days of ARPANET and the internet like? What was, uh, what... I mean, did you, uh... Again, sorry for the silly question, but, like, could you have possibly imagined that, uh, the, the internet would look like what it is today?
- JGJames Gosling
You know, some of it is remarkably unchanged. So like-
- LFLex Fridman
In what way?
- JGJames Gosling
...one of the things that I noticed really early on, um, uh, you know, when I was at, at, at Carnegie Mellon was that a lot of social life became centered around the ARPANET.
- LFLex Fridman
Hmm.
- JGJames Gosling
So things like, you know, between email and text messaging, uh, because the qu- you know, text messaging was a part of the ARPANET really early on. There were no cell phones but, you know, you're sitting at a terminal, and you're typing stuff, and y-
- LFLex Fridman
So essentially email or like what, what is the text message?
- JGJames Gosling
Well, just like, like a one-line message, right? So, so, so...
- LFLex Fridman
Oh, cool. So like chat.
- JGJames Gosling
Like chat.
- LFLex Fridman
Yeah.
- JGJames Gosling
Right.
- LFLex Fridman
Wow.
- JGJames Gosling
So it's like, like sending a, a one-line message to somebody, right?
- LFLex Fridman
Yeah.
- JGJames Gosling
And, and, and so pretty much everything from, you know, arranging lunch to-... going out on dates, you know? It was all, like, driven by social media.
- LFLex Fridman
(laughs) Social media.
- JGJames Gosling
You know? Right? In the-
- LFLex Fridman
The early days, yeah.
- JGJames Gosling
... in the, in the '80s.
- LFLex Fridman
(laughs) Easier than phone calls, yeah.
- JGJames Gosling
You know, and my life had gotten to where, you know, I was, you know, living on social media, you know, from, like, the early mid '80s. Um, and, and so when, when it sort of transformed into the internet and social media explodes, I was kind of like-
- LFLex Fridman
Yeah.
- JGJames Gosling
... "What's the big deal?"
- LFLex Fridman
Yeah. (laughs) It's just a scale thing.
- JGJames Gosling
It's, it's... Right. Uh, the, the, the scale thing is just astonishing.
- LFLex Fridman
Yeah.
- JGJames Gosling
Um...
- LFLex Fridman
But the fundamentals, um, in some ways remain the same.
- JGJames Gosling
The fundamentals have, have, have hardly changed. And, you know, the, the technologies behind the, the networking have changed significantly. The, you know, the, the, the watershed moment of, you know, going from the ARPANET to the internet, um, and then people starting to just scale and scale and scale. I mean the, the, the, the scaling that happened in the early '90s, and the way that so many vested interests fought the internet.
- 45:57 – 56:13
Elon Musk, Steve Jobs, Jeff Bezos
- JGJames Gosling
- LFLex Fridman
Well, that's where visionary leadership comes in, right? Yeah, somebody needs to roll in-
- JGJames Gosling
Well-
- LFLex Fridman
... and say, and take- t- take the leap.
- JGJames Gosling
Well, it's- i- it's partly take the leap, but it's also partly take the hit.
- LFLex Fridman
Take the hit, in the short term.
- JGJames Gosling
Right? So- so- so- so you can draw all the graphs you want that show that, you know, if we leap from here y- y- you know, on our present trajectory we're doing this and there's a cliff. If we, um, force ourselves into a- into a transition and we proactively do that, we can be on the next wave, but there will be a period when we're in a trough. And pretty much always there ends up being a- a trough as you leap the chasm.
- LFLex Fridman
(laughs) .
- JGJames Gosling
But the way that public companies work on this planet, they're reporting every quarter, and the one thing that a CEO must never do is take a big hit.
- LFLex Fridman
Take a big hit. Yeah.
- JGJames Gosling
Uh, you know, over some- some quarter. And- and many of these transitions involve a big hit for a- a period of time, you know, one, two, three quarters. And so you get some companies and, you know, like Tesla and Amazon are- are really good examples of companies that take huge hits, but they have the luxury of being able to ignore the stock market for a little while. And that's not so true today really, but, you know, in the early days of- of- of both of those companies, um, you know, like- like- like- like- like they- they- they both did this thing of, you know, "I don't care about the quarterly reports. I care about how many- how many happy customers we have."
- LFLex Fridman
Yeah.
- JGJames Gosling
Right? And having as many happy customers as possible can often be, um, an enemy of the bottom line.
- LFLex Fridman
Yeah, so how do they make that work? I mean, Amazon-
- JGJames Gosling
Well-
- LFLex Fridman
... operated in the negative for a long time. It's like investing into the future.
- JGJames Gosling
Right. But, you- you know, so Amazon and Google and Tesla and Facebook, a lot of those had what i- what amounted to patient money. Um, often because the- there's- there's like a charismatic central figure who has a really large block of stock and they can just make it so.
- LFLex Fridman
So what, uh, on, on that topic, just, maybe it's a small tangent, but, uh, you've gotten the chance to work with some pretty big leaders. What, what are your thoughts about, on the Tesla side, Elon Musk, leadership on the Amazon side, Jeff Bezos? All of these folks with large amounts of stock and vision in their company. I mean, they're founders.
- JGJames Gosling
Yeah.
- LFLex Fridman
Either, either complete founders or, like, early on folks. And, uh, they're, they hit, th- Amazon have taken leap, a lot of leaps, uh, and bel- you know, uh, that probably at the time people would criticize as, like, "What, what is this bookstore thing? Why..." (laughs)
- JGJames Gosling
Yeah. And, and, you know, Bezos had a vision, and he had the ability to just follow it. Lots of people have visions and, you know, the average vision is completely idiotic, and you crash and burn. Um, you know, the, the Silicon Valley, um, crash and burn rate is pretty high.
- LFLex Fridman
Yeah.
- JGJames Gosling
Um, and they're not, they don't necessarily crash and burn because they were dumb ideas but, you know, often it's, it's just timing.
- LFLex Fridman
Yes, timing.
- JGJames Gosling
Um, timing and luck. And, you know, you take companies like, like, like Tesla, um, and, and, and, and, and really, you know, the, the original Tesla, um, you know, sort of pre-, um, Elon, it was kind of doing sort of okay.
- LFLex Fridman
Mm-hmm.
- JGJames Gosling
But, but, but he just drove them. And because he had a really strong vision, you know, he would, he would make calls that were always, you know, or well, mostly pretty good. I mean, the Model X was kind of a goofball thing to do.
- LFLex Fridman
But he did it boldly anyway. Like, there's so many people that just said, like, there's so many people that opposed him on the, in the Falcon 1 door, like the doors?
- JGJames Gosling
Yeah.
- LFLex Fridman
From an engineering perspective, those doors are ridiculous. It's like-
- 56:13 – 58:48
Work hard and smart
- JGJames Gosling
- LFLex Fridman
But, uh, one thing I maybe wanna ask on that is, and maybe to push back a little bit, so there's the jerk side, but there's also, if I were to criticize what I've seen in Silicon Valley, which is almost a resistance to working hard. So on the jerkiness side is, um... (sighs) it's- it's... so both Steve Jobs and Elon kind of pushed people to work really hard to do-
- JGJames Gosling
Yeah.
- LFLex Fridman
And it's a question whether it's possible to do that nicely, but one of the things that bothers me, maybe I'm just Russian and just kind of, you know, romanticize the whole suffering thing, but I think working hard is es- is essential for accomplishing anything interesting. Like, really hard.
- JGJames Gosling
Yeah.
- LFLex Fridman
And in the parlance of Silicon Valley, it's probably too hard. This idea of that you should work smart, not hard often, uh, (laughs) to me sounds like you should be lazy, because of course you wanna be- work smart. Of course you wanna be maximally efficient. But in order to discover the efficient path, like we're talking about with the short programs-
- JGJames Gosling
Yeah.
- LFLex Fridman
... you have to check before.
- JGJames Gosling
Well, you know, the- the- the- the smart hard thing-
- LFLex Fridman
Yeah.
- JGJames Gosling
... isn't an either or. It's an and.
- LFLex Fridman
It's an and, yeah.
- JGJames Gosling
Right? And, um, you know, the- the- the- the- the, the people who say you should work smart, not hard, they pretty much always fail.
- LFLex Fridman
Yeah. Thank you. (laughs)
- JGJames Gosling
Right? I mean that's-
- LFLex Fridman
I agree with that.
- JGJames Gosling
... that's- that's just- just a recipe for disaster.
- LFLex Fridman
Yeah.
- JGJames Gosling
I mean, there are, there are counterexamples, but they're more people who benefited from luck.
- LFLex Fridman
And you're... yeah, exactly. Luck- luck and timing, like you said, is often, uh, an essential thing. But you're saying, you know, you can be... you can push people to work hard and do incredible work without, without, uh...
- JGJames Gosling
Without being nasty.
- LFLex Fridman
Yeah, without being nasty. I think, uh, um, Google, uh, is a good example of, uh, the leadership of Google throughout its history has been a pretty good example of, uh, not being nasty and being-
- JGJames Gosling
Yeah.
- LFLex Fridman
... being kind.
- JGJames Gosling
Yeah. I mean, the, the, the, the, the twins-
- LFLex Fridman
(laughs)
- JGJames Gosling
... Larry and Sergey, um, are both pretty nice people.
- LFLex Fridman
Yeah. Sandhya Pichai is very nice.
- JGJames Gosling
Yeah.
- LFLex Fridman
Yeah.
- 58:48 – 1:10:25
Open source
- JGJames Gosling
- LFLex Fridman
Let me ask maybe a little bit of a tense question. Uh, we're talking about Emacs. It seems like you've done some incredible work. So outside of Java, you've done some incredible work that didn't become as popular as it could have because of like licensing issues and open source and like-
- JGJames Gosling
Yeah.
- LFLex Fridman
... issues. Um, is... (laughs) uh, what are your thoughts about the- the- that entire mess? Like what's... uh, about open source now in retrospect, looking back, uh, about licensing, about open sourcing, do you think, uh, open source is a good thing, a bad thing? Do you have regrets? Do you have wisdom that you've learned from that whole experience?
- JGJames Gosling
So in general, I'm a big fan of, of open source. The way that it, it, it can be used to build communities and promote the development of things and promote collaboration and all of that is really pretty grand. Um, when open source turns into a religion that says all things must be open source-
- LFLex Fridman
Right.
- JGJames Gosling
... um, I get kind of weird about that because it's- it's sort of like saying, you know, some, some versions of that, um, e- end up saying that the- that all, all software engineers must take a vow of poverty.
- LFLex Fridman
Right.
- JGJames Gosling
Right? As though, um...
- LFLex Fridman
It's unethical to have money-
- JGJames Gosling
Yeah.
- LFLex Fridman
... to build a company, to, uh... right.
- JGJames Gosling
And, you know, there's a, there's a, there's a- a slice of me that actually kind of buys into that-
- LFLex Fridman
Right.
- JGJames Gosling
... because, you know, people who make billions of dollars off of like a patent and the- the patent came from, like...... you know, literally a, a stroke of lightning that, that, that hits you as you lie half awake in bed. Yeah, that's lucky, good for you. The way that that sometimes sort of explodes into something that looks to me a lot like exploitation. You know, you see a lot of that in, in, in like the, the drug industry. Um, you know, when, you know, when you've got a, got, got medications that cost, you know, cost you like $100 a day and it's like, "No."
- LFLex Fridman
(laughs) Yeah, so the, the, the interesting thing about the sort of open source, uh, wha- what bothers me is when it, something is not open source and because of that, it's a worse product.
- JGJames Gosling
Yeah.
- LFLex Fridman
So, so like, I mean, if I look at your just implementation of Emacs, like that could have been the dominant implementa- like I use Emacs. That's my main ID. I apologize to the world, but I still love it. Uh, (laughs) and you know, I could have been using, um, your implementation of Emacs, and why aren't I?
- JGJames Gosling
So are you using the GNU Emacs?
- LFLex Fridman
I guess the default on Linux is like GNU?
- JGJames Gosling
Yeah.
- LFLex Fridman
Yeah.
- JGJames Gosling
And, and that through a strange passage started out as the one that I wrote.
- LFLex Fridman
Exactly. So it's, it still has a...
- JGJames Gosling
Right.
- LFLex Fridman
Yeah. You... right.
- JGJames Gosling
Well, and, and, and part of that was because, you know, in, you know, the last couple of years of grad school, it, it became really clear to me that I was either going to be Mr. Emacs forever-
- LFLex Fridman
Mm-hmm.
- JGJames Gosling
... or I was gonna graduate.
- LFLex Fridman
Got it.
- 1:10:25 – 1:28:31
Java
- JGJames Gosling
- LFLex Fridman
I know you've talked about this in quite a few places, but you have created one of the most popular programming languages in the world. Uh, this is the programming language that I first learned about object-oriented programming with. Uh, you know, I think it's a programming language that a lot of people use in a lot of different places and millions of devices today, Java. So the... Absurd question, but can you tell the origin story of Java?
- JGJames Gosling
So long time ago at Sun-
- LFLex Fridman
(laughs)
- JGJames Gosling
... in about 1990, there was a group of us who were kind of worried that, that there was stuff going on in the universe of computing that the computing industry was missing out on. Um, and so, uh, uh, a few of us started this project at Sun that really got going... I mean, we started talking about it in 1990, and it really got going in '91. Um, and it was all about, you know, what was happening in terms of, you know, computing hardware, you know, processors and networking and all of that that was outside of the computer industry, and that was everything from the, the, the sort of early glimmers of cell phones that were happening then to, you know, you look at elevators and locomotives and process control systems in factories and all kinds of audio, audio equipment, video equipment. Um, they all had processors in them, and they were all doing stuff with them. And, and it, and it sort of felt like there was something going on there that we needed to understand. And-
- LFLex Fridman
So C, C and C++ was in the air already?
- JGJames Gosling
Oh, no, C and C++ absolutely owned the universe at that time. Everything was written in C and C++.
- LFLex Fridman
So where, where was the hunch that there was a need for a revolution?
- JGJames Gosling
Well, so the, the need for revolution was not about the lang- a, a language. It was about... It was just as simple and vague as, "There are things happening out there, and we-"
- LFLex Fridman
We need to understand them.
- JGJames Gosling
We need to understand them.And, and so, um, a few of us went on several, um, somewhat epic road trips. Um...
- LFLex Fridman
Literal road trips?
- JGJames Gosling
Literal road trips. It's like, get on an airplane, go to Japan, visit, you know, Toshiba and Sharp and Mitsubishi and Sony and all of these folks. And, you know, because we worked for Sun, we had, you know, folks who were willing to, like, give us introductions, you know. We, we visited, you know, Samsung and, um, you know, a bunch of Korean companies, and we went all over Europe. We went to, you know, places like, like Philips and Siemens and Thomson and...
- LFLex Fridman
What did you see there?
- JGJames Gosling
You know, for me the, one of the things that sort of leapt out was that they were doing all the usual computer, computer things that people had been doing, like, 20 years before. The thing that really leapt out to me was that they were sort of reinventing computer networking in... And, they were making all the mistakes that people in the computer industry had, had made. And since I'd been doing a lot of work in, in the networking area, you know, you know, we'd go and, you know, visit, you know, company X. They'd describe this networking thing that they were doing, and just without any thought I could, I could tell them, like, the 25 things that were going to be complete disasters with that thing that they were doing.
- LFLex Fridman
Mm-hmm.
- JGJames Gosling
Um, and I don't know whether that had any impact on any of them, but, but, but that particular story of, you know, sort of repeating the disasters the com- of the computer science industry, um, was there, and we th- and one of the things we thought was, "Well, maybe we could do something useful here with, like, bringing them forward somewhat." But, but also at the same time, we learned a bunch of things from, from these, you know, mostly consumer electronics companies. Um, and, you know, high on the list was that they viewed their, like, relationship with the customer as sacred. Um, they, they were never, ever willing to make trade-offs between... For, for safety, all right? So, one of the things that had always made me nervous in the computer industry was that, um, people were willing to make trade-offs in reliability to get performance. Um, you know, the, the, you know, th- they, they want faster, faster, and it breaks a little more often because it's fast, you know, you... Maybe you run it a little hotter than you should, or like, like the one that always blew my mind was the way that, um, the folks at, at, at Cray supercomputers-
- LFLex Fridman
Mm-hmm.
- JGJames Gosling
... got their division to be really fast, was that they did Newton-Raphson approximations.
- LFLex Fridman
Uh-huh. (laughs)
- JGJames Gosling
And so, you know, the bottom several bits of, you know, A over B were essentially random numbers. Um...
- LFLex Fridman
What could possibly go wrong?
- JGJames Gosling
What could go wrong, right?
- LFLex Fridman
(laughs)
- JGJames Gosling
And, you know, just figuring out how to nail the bottom bit. Um, how to make sure that, you, you know, if you put a piece of toast in a toaster, it's not going to kill the customer. It's not gonna burst into flames and burn the house down.
- LFLex Fridman
So those are... I guess those are the, the principles that were inspiring, but how did the... From the days of, uh, Java's... Called Oak because of a tree outside the window story-
- JGJames Gosling
Yeah.
- LFLex Fridman
... that lots of people know. How did it become this incredible, like, powerful language?
- JGJames Gosling
Well, so it wa- it was a bunch of things. So we s- you know, a- after all that we started... You know, the, the way that we decided that we could understand things better was by building a demo, building a prototype of something.
- LFLex Fridman
Got it.
- 1:28:31 – 1:44:05
Java virtual machine
- JGJames Gosling
- LFLex Fridman
So I think one of the most beautiful ideas, uh, philosophically and technically is, uh, of a virtual machine, the Java Virtual Machine. Um, again, apologize to romanticize things but, uh, (laughs) uh, how did the idea of the JVM come to be? How to you radical of an idea it is? 'Cause it, it seems to me to be just a really interesting idea in the history of programming.
- JGJames Gosling
So-
- LFLex Fridman
And what is it?
- JGJames Gosling
So the Java Virtual Machine, you can think of it in different ways, um, because it was carefully designed to have different ways of viewing it. So one view of it that most people don't really realize is there is that you can, um, view it as sort of an encoding of the abstract syntax tree in reverse Polish notation. Um, I don't know if that makes any sense at all. I, I could explain it and that would blow all of our time.
- LFLex Fridman
Yeah.
- JGJames Gosling
Um, but the other way to think of it, um, and the way that it, it ends up being explained is that it's, it's like the, the instruction set of an abstract machine that's designed such that you can translate that abstract machine to a physical machine. And the reason that that's important... So if you wind back to the early '90s when we were talking to all of these, these companies doing consumer electronics and you talk to the purchasing people, there were interesting conversations with purchasing. Um, so if you look at how, you know, these, you know, these devices come together, they're sheet metal and gears and circuit boards and capacitors and resistors and stuff, and everything you buy has multiple sources, right? So you can buy a capacitor from here, you can buy a capacitor from there, and you've got kind of a market. So y- y- you know, so that the... you can actually get a decent price for a capacitor. Um, but CPUs, and particularly in the early '90s, um, CPUs were all different and all proprietary. So if you used a chip from Intel-You had to be an Intel customer for the end of, till the end of time, because if you wrote a bunch of software, you know, when, when you wrote software using whatever technique you wanted, and C was particularly bad about this be- because there was a lot of properties of the underlying machine that came through. So for-
- LFLex Fridman
You were stuck. So the code you wrote, you were stuck to that particular machine.
- JGJames Gosling
You were stuck to that particular machine, which meant that they couldn't decide, "You know, Intel is screwing us."
- LFLex Fridman
Mm-hmm.
- JGJames Gosling
"Um, I'll, I'll start buying chips from, you know, Bob's Better Chips." This drove the, like the purchasing people absolutely insane. That, that they would, they were welded into this decision, and it would ha- they would have to make this decision before the first line of software was written.
- LFLex Fridman
It's funny that you're talking about the purchasing people. So there's one perspective, right? It's, you could, there's a lot of other perspectives that all probably hated this idea.
- JGJames Gosling
Right.
- LFLex Fridman
But from a technical aspect, just like the creation of an abstraction layer that's, uh, agnostic to the underlying machine, uh, from the perspective of the developer, I mean, that's brilliant. Uh-
- JGJames Gosling
Right. Well, and, and, and, and, and it, you know, so that's like across the spectrum of, of providers of chips. But then there's also the, the time thing, because, um, you know, as you went from one generation to the next generation to the next generation, they were all different, and you would often have to rewrite your software.
- LFLex Fridman
Oh, you mean g- generations of, uh, CP, of machines of different kinds? So like-
- JGJames Gosling
Yeah. So, so like, like-
- LFLex Fridman
(laughs)
- JGJames Gosling
...like, like one of the things that sucked about a year out of my life was when Sun went from the, the Motorola 68010 processor to the 68020 processor.
- LFLex Fridman
Mm-hmm.
- JGJames Gosling
Then they had a number of differences, and one of them hit us really hard, and I ended up being the, the point guy on the worst case of where the new instruction cache architecture hurt us.
- LFLex Fridman
Well, okay, so, (laughs) I mean, so-
- JGJames Gosling
So-
- LFLex Fridman
...when, when did this i- idea, I mean, okay, so yeah. You, you articulate a really clear fundamental problem in all of computing, but how, where do you get the guts then to think, (laughs) "We can actually solve this?"
- JGJames Gosling
You know, in our conversations with, uh, you know, all of these vendors, you know, these, these problems started to, to show up. And I kind of had this epiphany, because it reminded me of a summer job that I had had in grad school. So back in grad school, my, my thesis advisor ... well, I had two thesis advisors, for bizarre reasons. Um, one of them was a guy named Raj Reddy. The other one was Bob Sproull. Um, and Raj, I love Ra- I really love both of them, but-
- LFLex Fridman
Yeah, Raj was amazing.
- JGJames Gosling
Um, so the, the department had bought a bunch of, like early workstations from a company called Three Rivers Computer Company.
- LFLex Fridman
Mm-hmm.
- JGJames Gosling
And Three Rivers Computer Company was a bunch of electrical engineers who wanted to do as little software as possible. So, um, they knew that they'd need to have, like compilers and an OS and stuff like that, and they didn't want to do any of that. And they wanted to do that for as close to zero money as possible. So, um, what they did was they, they built a machine whose instruction set was, um, the, was literally the byte code for UCSD Pascal, the P-code. And so we had a bunch of software, um, that was, that was written for this machine.
- LFLex Fridman
Mm-hmm.
- 1:44:05 – 1:47:04
Android
- LFLex Fridman
But I gotta ask you about Android and the use of Java there, because it's one of the many places where Java ha- just has a huge impact on this world. Just on your opinion, is there things that make you happy, uh, about the way Andro- uh, Java is used in the Android world? And are there things that, uh, you wish were different?
- JGJames Gosling
I, I don't know how to do a short answer to that, um-
- LFLex Fridman
(laughs)
- JGJames Gosling
... but I have to do a short answer to that. So, you know, I'm happy that they did it. Um, Java had been running on cellphones at that time for quite a few years, and it worked really, really well. Um, there were things about how they did it and, and in particular, um, various ways that they kind of, you know, violated all kinds of contracts. The guy who, who led it, Andy Rubin, he crossed a lot of lines.
- LFLex Fridman
There's some lines crossed.
- JGJames Gosling
Yeah. Lines were crossed that have since, you know, mushroomed into giant court cases. Um, and, you know, they didn't need to do that. And in fact, it would've been so much cheaper for them to not cross lines.
- LFLex Fridman
I mean, I, I suppose they didn't anticipate the, the success, uh, of this whole endeavor.
- JGJames Gosling
Um-
- LFLex Fridman
Or do you think at that time, it was already clear that this is, uh, is gonna blow up?
- JGJames Gosling
I, I guess I, I, I, I, I sort of came to believe that it didn't matter what Andy did, it was gonna blow up.
- LFLex Fridman
(laughs) Okay.
- JGJames Gosling
He's, he, he's, he... You know, I kinda started to think of him as, as, as like a manufacturer of bombs.
- LFLex Fridman
(laughs) Uh, yeah. Some of the best things in this world come about through a little bit of, uh, uh, explosive...
- JGJames Gosling
Well, and some of the worst.
- LFLex Fridman
And some of the worst. Beautifully put. But is there, um... And, and like you said, I mean, does that make you proud that the Java is in-
- JGJames Gosling
Yeah.
- LFLex Fridman
... is in millions... I mean, it could be billions of devices and-
- JGJames Gosling
Yeah. Well, I, I mean, it was in, in billions of phones before Android came along. Um, and, you, you know, I'm, I'm just as proud as, you know, of the way that, like, the, the smart card standards adopted Java. And they did a, they... you know, everybody involved in that did a really good job, and that's, you know, billions and billions. Um...
- LFLex Fridman
That's crazy.
- JGJames Gosling
The SIM cards-
- LFLex Fridman
SIM cards.
- JGJames Gosling
You know, the SIM cards in your pocket.
- LFLex Fridman
Yeah. I mean, it's, uh-
- JGJames Gosling
I've been out of, outside of that world for a decade, so I don't know how that has, has evolved. But, um, you know, it's just been crazy.
- 1:47:04 – 1:48:11
Advice
- JGJames Gosling
- LFLex Fridman
So on that topic, let me ask, uh... Again, there's a million technical things, uh, uh, we could talk about, but let me ask the absurd, the old, uh, philosophical question about life. Um, what do you hope... When you look back at your life and, uh, people talk about you or write about you 500 years from now, uh, what do you hope your legacy is?
- JGJames Gosling
People not being afraid to take a leap of faith. Um, I mean, I... You know, I've got this, this kinda weird history of doing weird stuff and, um...
- LFLex Fridman
It worked out pretty damn well.
- JGJames Gosling
It, it, it worked out, right? And I think some of the weirder stuff that I've done, um, has been the coolest. And some of it, some of it crashed and burned and, um... Yeah, you know, I think well over half of the stuff that I've done has crashed and burned, um, which has occasionally been really annoying.
Episode duration: 1:51:00
Install uListen for AI-powered chat & search across the full episode — Get Full Transcript
Transcript of episode IT__Nrr3PNI
Get more out of YouTube videos.
High quality summaries for YouTube videos. Accurate transcripts to search & find moments. Powered by ChatGPT & Claude AI.
Add to Chrome