By playing, you agree to uListen's Terms and Privacy Policy and YouTube's Terms of Service.
Lex Fridman PodcastBrendan Eich: JavaScript, Firefox, Mozilla, and Brave | Lex Fridman Podcast #160
Summaries, chapters, transcripts, and FAQs on this page are made by uListen, not YouTube.
Partial transcript
75 min read · 15,004 wordsIntroduction
Lex Fridman 0:00 The following is a conversation with Brendan Eich, creator of the JavaScript programming language, co-founder of Mozilla, which created the Firefox browser, and now co-founder and CEO of Brave Software, which has created the Brave browser. Each of these are revolutionary technologies. JavaScript is one of the most widely used and impactful programming languages in the world. Firefox pioneered many browser ideas that we love today, or even take for granted today. And Brave is looking to revolutionize not only the browser, but content creation online and the nature of the internet to make it fundamentally about respecting people's control over their data. Quick mention of our sponsors. The Jordan Harbinger Show, Sambasket meal delivery service, BetterHelp online therapy, and Eight Sleep self-cooling mattress. Click the sponsor links to get a discount and to support this podcast. As a side note, let me say that there's a tension between theory and engineering that I've been thinking a lot about. I tweeted something like, "Good execution is more important than a good idea, but one helps the other." I think the wording of that sucks, but what I mean is a, a good idea is a must, but in my experience, good ideas are in abundance. Good execution, on the other hand, is rare. I think some mix of good timing, good idea, and good execution is essential. Getting that mix right is tough, and (laughs) Brendan somehow, multiple times in his career, did just that. I'm starting to believe it's more art than science, like most interesting things in life. If you enjoy this thing, subscribe on YouTube, review it on Apple Podcast, follow on Spotify, support me on Patreon, or connect with me on Twitter @LexFridman. And now, here's my conversation with Brendan Eich.
History of early programming languages
Lex Fridman 1:53 When did you first fall in love with programming?
Brendan Eich 1:56 I didn't program a lot when I was in high school, but I had a friend who had a Commodore PET. And after we saw Star Wars, he said, "Hey, let's make a, a basic, uh, program that does the Death Star trench run."
Lex Fridman 2:08 (laughs)
Brendan Eich 2:08 And it was just, you know, simple 2D graphics. And I didn't know what I was doing, so I just helped him out, uh, on the math and stuff like that. I was a math and science kid. I was really into, uh, the HP calculators of the early mid-'70s. These were the RPN. They were really strongly built, and as Rik Goldfinger said of gold, "divinely heavy" (laughs) .
Lex Fridman 2:27 (laughs)
Brendan Eich 2:27 There was probably some gold in them, too. Gold metalization. But they were awesome calculators, and they had all the scientific functions, so I was really into that. Um, so I, I aimed toward physics. Um, I was a little late for the, I think the, you know, the 20th century golden age, and I read a lot of science fiction, so I was like, "Yeah, it's on to hyperdrives and warp drives and..." Uh, physics was not going to get there quickly, and I started hacking on computers while I was studying physics as an undergraduate at Santa Clara University. And, um, you know, it... I, I dodged the Fortran bullet because I was in the science department instead of the engineering department, where they still did Fortran, card decks, I think they had an auto collator. But, uh, we were using Pascal, and, uh, I got one of the first portable C compilers, uh, ports to the deck minicomputers we were using, and I, I fell in love with programming just based on, um, you know, procedural abstraction, uh, Pascal, just what now would be considered old school, like, structured programming from the '70s. Um, Niklaus Wirth, the creator of Pascal, was a good writer and a, a good pedagogue, right? He al- always, at ETH, would do these courses where it's like, "Build your own computer."
Lex Fridman 3:39 Mm-hmm.
Brendan Eich 3:40 "Build your own compiler, build your own operating system."
Lex Fridman 3:42 From scratch, mm-hmm.
Brendan Eich 3:43 Yeah, kind of. And, uh, (laughs) I know some people who were grad students under him and said he was, um... he would torture the students with things like this custom email system that had a 25-word limit. (laughs)
Lex Fridman 3:55 (laughs)
Brendan Eich 3:55 And, uh, things like that.
Lex Fridman 3:56 I unfortunately dodged both the Pascal and the Fortran bullets.
Brendan Eich 4:00 Mm-hmm.
Lex Fridman 4:00 Uh, could you maybe, uh, linger on, uh, the Pascal? Like, what kind of programming language was it? What, what is it reminiscent of of today? Because it sounds like it may have had, uh, an impact on your own tr- trajectory.
Brendan Eich 4:12 Yeah. Yeah, it was in the ALGOL family, and ALGOL was, um, you know, the big, uh, successful, uh, language design and compiler project in the '60s. It had a successor called ALGOL 68, which was ambitious but not as successful. But Pascal was kind of a wordy procedures and functions language. It distinguished between functions, which return a value, and procedures, which don't-
Lex Fridman 4:36 Mm-hmm.
Brendan Eich 4:36 ... which just compute. Uh, and, uh, you could say that whole ALGOL family went into Ada. Um, Pascal had a second life thanks to Borland with Turbo Pascal-
Lex Fridman 4:45 Mm-hmm.
Brendan Eich 4:46 ... which was hugely successful, uh, I think in large part due to Anders Hejlsberg, who then went to Microsoft and did-
Lex Fridman 4:52 Mm-hmm.
Brendan Eich 4:52 ... you know, C# and .NET-
Lex Fridman 4:53 Yeah.
Brendan Eich 4:53 ... with his team there and has done really well doing TypeScript, typed JavaScript. Uh.
Lex Fridman 4:57 (laughs)
Brendan Eich 4:58 So yeah, there's a, there's a lineage here. Uh, but I was also interested in C and Unix by the time I was an undergrad, because, uh, people were bringing Unix up on all sorts of hardware. I had some friends who were doing their own wire wrap computers, 6820 maybe, um, and I was wire wrapping for my engineering course, um, 6809 or something simpler, building a computer on a board. And I wanted to build a more ambitious one and port Unix to it, but I picked the wrong processor. I picked the National Semiconductor NS16032, which was this amazing, you know, CISC con- uh, complex instruction set computer, and not the reduced instructions that computers... that were just being contemplated into the mid-'80s. Um...
Lex Fridman 5:43 And RISC ultimately won out.
Brendan Eich 5:45 RISC won in some ways. It, it dissolved into the... You have both now. You have these superscalar architectures where, like, Intel has kept...... probably too much backward compatibility at the instruction level, but that's just the... There's a front end that parses that into these, you know, these wide internal instructions. So, you know, the very long instruction word research that, um, was also interesting at the time kind of became the microarchitecture inside the backward-compatible Intel. Um, but I picked the National Semi Chip, and it never got made successfully. It was full of bugs and I never could have brought it up. But I went on, uh, out of physics after three years into math computer science. And like I said, I did it because I saw, um, I was being sort of childlike and naive about physics, and I thought, uh, "Meanwhile, the valley is, is go-go for computers." The Apple II, right, the, the PC, the Intel, um, 8086, um, 8088-based PC. IBM, you know, gave Microsoft the future for (laughs) -
Lex Fridman 6:45 Mm-hmm.
Brendan Eich 6:45 ... in a somewhat fishy deal.
Physics needs more experiments and less theory
Lex Fridman 6:46 So, it was wide open in the computing space, but in physics, you, you were as, uh, optimistic about physics as
Brendan Eich 6:52 No. ... that was reported to be. I mean, I was one of three brothers who were all in the same grade. I have a twin and a younger brother who, um, skipped second grade and was with us the whole time after that. And, you know, he went on, he actually studied under Kip Thorne at Caltech.
Lex Fridman 7:06 Wow.
Brendan Eich 7:07 Uh, but he also didn't... He ended up in software engineering (laughs) .
Lex Fridman 7:10 (laughs)
Brendan Eich 7:10 He didn't end up in physics, so.
Lex Fridman 7:11 All right. Does it make you sad that, uh, theoretical physics, even with string theory, hasn't really had any foundational breakthroughs in the latter part of the 20th century and, uh, into the-
Brendan Eich 7:23 Yeah. In fact, I'd say the problem is theory over, over experiment. I would say, you know, we need more Aristotle and less Plato.
Lex Fridman 7:31 (laughs)
Brendan Eich 7:31 You know, mathematics is not all physical.
Lex Fridman 7:33 Mm-hmm.
Brendan Eich 7:33 There are lots of mathematics that cannot be realized as far as I know in, in this world. So, to understand the world, you need to do experiments, you need to, you know, not just dream up, uh, inductive theories that could have lots of alternative theories competing with them, with no way to decide between them except aesthetics, which is not a good guide, in my opinion.
Lex Fridman 7:53 I don't know if you, uh, are friends with or have a relationship with Elon Musk. Where's the, um... In terms of, like, what you would love to see our society investing in, building up, is it closer to Elon or is it closer to Feynman and Einstein and those-
Brendan Eich 8:09 Well, those gentlemen are no longer with us, and I think-
Lex Fridman 8:11 Yeah.
Brendan Eich 8:11 ... that's noticed. So, like I said, the real glory days of physics, the famous pictures from Germany before the war- second world war were, uh, just a fantastic assembly of brains, um, you know, Schrodinger and Einstein. And, and physics, I think, took a wrong turn that maybe all, all of, um, I would say Western science took in going for models over reality, right? You see this in all sorts of fields. Now, we can build models that are very predictive and generative, and then we build actual devices or, you know, semiconductors, things like that. That's, that's good. I'm not dismissing that. Uh, we need good models. We need to experiment and prove them and, and test them. But the problem I've seen in physics, which you see certainly in economics, um, the dismal science, and you see surprisingly in other so-called hard sciences, is models that, um, don't really have to be, um, tested against reality. They can instead become policy tools or they can become, uh, like I said, uh, one of a large family of alternate theories that could be as predictive, but nobody's doing the-
Lex Fridman 9:16 Yeah.
Brendan Eich 9:16 ... winnowing out.
Lex Fridman 9:17 That's such an interesting tension in society. You see this in even the softer sciences, which I have a deep love for, like psychology, you see this in epidemiology now with the virus.
Brendan Eich 9:27 Yeah. Absolutely.
Lex Fridman 9:27 It's this tension of, you know, how much of the world can we understand through just a beautifully fit model? And then at the same time, my main work is in machine learning-
Brendan Eich 9:38 Mm-hmm.
Lex Fridman 9:39 ... where it's like there is no provable thing usually. It's just, it's kind of you... It's all about just getting the right data set and getting tricks and so on.
Brendan Eich 9:49 Mm-hmm.
Lex Fridman 9:49 And there's this tension even in my own soul of like, I grow- I grew up on theoretical computer science, like, I loved, uh, uh, approximation algorithms, like, all of that, like, different complexity classes-
Brendan Eich 10:02 Mm-hmm.
Lex Fridman 10:02 ... just those little puzzles. I mean, I don't know. Do you, do you as somebody who was in math and computer science and then ended up going into places where you engineer some of the most impactful things in this world, do you see the P versusNP, all that whole space as interesting at all? Impactful?
Brendan Eich 10:21 Yeah, uh, it's, it's not that useful in practice, right? People are using it, uh, with sort of crypto analysis or asymptotic arguments about, you know, can, can we have a quantum-resistant crypto algorithm, things like that, which may not be practical, right? If you, if you follow Mikhail Diakonov or Gil Kalai, there, there are big questions about how health quantum computing will scale up. Um, how practical it will be.
Lex Fridman 10:46 Is that something that you think about, quantum computing, and, and-
Brendan Eich 10:49 Not-
Lex Fridman 10:50 And that-
Brendan Eich 10:50 Except for spare time. Like you said, I'm not using this kind of computer science in practice because almost everything now is engineering, um, and finding ways to get, um, computers to be more useful for people, which goes from, you know, design problems, which are really kind of an art, like, who said anything you can't automate is an art.
Lex Fridman 11:09 Yeah.
Brendan Eich 11:10 Well, um, we can have, you know, machine learning compose music and it can imitate... You can train it and it can sound kind of decent, but maybe lacking that je ne sais quoi.
Lex Fridman 11:18 Yeah.
Brendan Eich 11:18 But, you know, user interface still I think requires, uh, human art.
JavaScript origin story
Lex Fridman 11:23 So, speaking of things that, uh, didn't follow a perfect theory and model, uh, JavaScript.
Brendan Eich 11:29 (laughs)
Lex Fridman 11:30 So there's two things. One, it had an impact on the world at a huge scale, obviously.
Brendan Eich 11:34 Mm-hmm.
Lex Fridman 11:35 And it also still is one of probably the most popular programming language in the world. So, can we go back to the origin story? Uh, can you tell the story of how JavaScript was created?
Brendan Eich 11:47 Yeah. I was at Silicon Graphics after graduate school for seven years, and it got to be big and successful and divisionalized and political. And-... I thought, um, kind of boring, and a friend who had been there went to, uh, one of the last of the super companies, the super startups in, in the early '90s. There were several. I suppose General Magic was a little after that, or around the same time, but Microunity was that company that I went to and it was because my friend, uh, Jeff Weinstein had gone there from Silicon Graphics. He recruited me and Microunity was doing everything. So this, this was like the ultimate sort of pretend grad school. It was doing a new fab, new semi-
Lex Fridman 12:28 Wow.
Brendan Eich 12:28 ... connector process. It was doing new, um, analog and digitals circuits on the same very large but not wafer s- scale chip. Um, originally it was, um, five centimeters on its side. (laughs) It was, it was really hot too, so it needed a water cooler. Um, it was a crate killer. And then they shrunk it and they tried to do a, a home sort of media processor that was essentially a barrel processor, but you could think of, um, trying to do all the things that we now see in modern architectures, uh, with short vector instructions and, um, sort of wide instructions for multiple issue. Uh, and, and doing a lot of this stuff in software because the second iteration, the set-top box, was really for avoiding the cost to the cable company of rolling the trucks out to replace your garbage General Atlantic set-top box with the slightly newer, less, less, uh, garbagey one. So if you could have software upgradable, um, set-top boxes, the cable companies, uh, thought they could save a lot of money and add features.
Lex Fridman 13:27 Is this Assembly? Or which, which-
Brendan Eich 13:29 It was like-
Lex Fridman 13:29 ... level of the software?
Brendan Eich 13:30 It was like S- ... We were writing in, in, um ... We were using GCC where we were getting to C++ and C. Uh, somebody I, I worked with there, um, really very smart guy, hired from a sort of Wall Street, um, hotshot programming consultancy, did his own hardware design as well as software, and we were working on how to make, uh, not only short vector units but general bit shufflers and permuters so that you could do things like, um, uh, you know, crypto-algorithms efficiently and you could do, uh, demodulation of the cable, you know, complex, uh, quadrature amplitude modulated signal. So you were, you were ta- basically taking, uh, A to D converters, dumping things in buffers, and then doing the rest in software, all the framing and the Reed-Solomon and Viterbi and all that error correction. So that was really great learning experience, but it was not gonna work. It was doing too many risky things at once, right? If you ... As Jim Clark said to me when I had hopped to Netscape after three years at Microunity, he said, "Oh, yeah, you do 10 things each, uh, 1 in 10 odds, it's gonna be 1 in 10 billion," right?
Lex Fridman 14:28 (laughs) Yeah.
Brendan Eich 14:28 Um, the multiplication principle. So, you know, Netscape was already a rocket and I'd passed the chance to go there in 1994. I knew the founders because I worked at SGI, Clark's company-
Lex Fridman 14:40 Could you pause for a second-
Brendan Eich 14:41 Sure.
Lex Fridman 14:41 ... Netscape, uh, w- when was the launch of this rocket? What, uh, just-
Brendan Eich 14:45 '94, um-
Lex Fridman 14:45 '94 was the launch of Netscape?
Brendan Eich 14:47 Yeah. And I went there in early '95, in April.
Lex Fridman 14:49 Okay. But, uh, so you said you missed the launch of the l-
Brendan Eich 14:52 Well, I missed the, the en- the first floor employment opportunity, but the IPO was, was August 1995, so I was there for that.
Lex Fridman 14:59 How obvious was it that Netscape was like world-changing? Uh, what was the layout? Was Netscape one of the first big browsers?
Brendan Eich 15:06 Yes. So wh- when I was at Microunity still in '93, we saw a browser called Mosaic. And up 'til then, we'd used email and we'd used Usenet, the NNTP protocol, we'd used newsreaders, we used FTP, we used all these old internet protocols, all relying on the DNS and TCP/IP and UDP for that matter. Um, when I was at Silicon Graphics, we brought up the whole stack, right? We had to, you know, discover how, how to f- find the Ethernet addresses on your network and then find IP addresses for them, ARP protocol, all that stuff. And it was great because nobody knew in the '80s what was gonna win. All the proprietary stacks like IBM, SNA, and DECnet, and all these other protocols were saying, "It's- we're gonna do it," or, "It's gonna be a heterogeneous future." And instead it was, you know, Berkeley Unix and the TCP/IP stack that dated back to the ARPANET that won. And I think we knew it. We all knew it at, at SGI but the salespeople didn't, and so they kept trying to get m- multiple network stacks inter-operating. But in the end, uh, it won. And so it ... That was the internet, and it was email and text-y, and it was Usenet, very text-y.
Lex Fridman 16:09 Mm-hmm.
Brendan Eich 16:09 And then, uh, Tim Berners-Lee did his thing, but I don't think I was paying attention. And I think the date when he first did it, or when he wrote the famous email has been pushed back to '89. But I noticed, uh, Mosaic in '93 because one of the things that Marc Andreessen and Eric Bina did at NCSA was they innovated on, on the HTML s- early HTML standard. They, in particular, Marc sent this email saying, "Hey, everybody. We think you should be able to put an image in a page." And you know when he sent that, Eric Bina had already written the code. And, you know, I talked to Tim Berners-Lee more recently, just a few years ago, and he was like, "Oh, we had another way of doing it and then, uh, d- it didn't work out 'cause Mark shipped his in Mosaic." And this convinced me of several things. One, the internet meant there was a huge first-mover advantage, and being fast, getting on first mattered a lot. And so, you know, Richard Gabriel of Scheme and poetry fame has written about this, the famous essay-
Lex Fridman 17:03 Poetry? What's poetry?
Brendan Eich 17:04 Uh, well, he's a poet. Uh, Richard's a poet. Yeah.
Lex Fridman 17:06 Oh, actual poetry. I thought he was talking about some kind of sonnet. Okay.
Brendan Eich 17:08 No, no. I mean, he's the founder of Lucid, which is where Jamie Zawinski worked before Netscape. And Lucid was doing, you know, compilers and Lucid Emacs, which was a fork of Emacs.
Lex Fridman 17:17 Mm-hmm.
Brendan Eich 17:18 Famously Jamie fighting against Richard Stallman, Stallmax.
Lex Fridman 17:22 (laughs)
Brendan Eich 17:22 Um, and so Richard Gabriel, you know, very, very brainy computer guy, but also a poet, but he wrote a nice essay that gets abused all the time. In fact, Jamie's put a kind of warning in front of his version of it on his site, jwc.org, called Worse is Better. And this is about survival advantage of software in a network world, in my opinion. It's about Unix ... It started out being framed as Unix and Lisp, good news, bad news, because all the Lisp people, the MIT people were like-
Lex Fridman 17:46 Yes.
Brendan Eich 17:46 ... "Oh, you know, this is the crown jewel," right, uh, "Scheme, this-"
Lex Fridman 17:50 Yeah.
Brendan Eich 17:50 "... Faberge egg or Common Lisp, this giant cathedral."
Lex Fridman 17:53 Yes.
Brendan Eich 17:53 "Of course we're gonna win. This is civilization."
Lex Fridman 17:55 (laughs)
Brendan Eich 17:55 And those, you know, those farmers in New Jersey, to borrow from The Sopranos, those-
Lex Fridman 17:59 (laughs)
Brendan Eich 17:59 ... those hicks down at Bell Labs, they're just-
Lex Fridman 18:01 Yes.
Brendan Eich 18:01 You know, there's nothing sound there, it's all hacking.
Lex Fridman 18:04 Yeah.
Brendan Eich 18:04 Um, well, guess what won?
Lex Fridman 18:05 (laughs) Wow, so that you- you're saying this is a fundamental, like, principle of the internet, is moving fast wins.
Brendan Eich 18:14 You could say, in, in almost any network system, like in biological evolution, you see successful alleles sweep populations, and they don't always have, um... You know, they aren't free of flaws, like h- heterozygous advantage, right? You can get both parents, uh, give you the gene variant, and you get sickle cell anemia, right? But, but if one of them does, you're more resistant to malaria. And so this isn't, um, a beautiful process except at large scale, and then you realize that because it moves fast and can adapt, it- it can win. And people still struggle with this. I- I used to struggle with this because JavaScript was done in such a hurry, and the force of web compatibility meant early mistakes couldn't be fixed, and even the standards process injected new mistakes, as it will. Uh, but often standards bodies go back and make incompatible changes. You can't do that with the web. It's more like, again, like biology, you- you preserve what still works. You don't wanna break ATP metabolism or whatever. So, um, you have to kind of resign yourself to the reality of, um, worse is better being enshrined in actual design points you might not like. Um, and that happened with JavaScript, and I'm way over it, but, uh, it also, I think, was a huge advantage, which is why JavaScript has kind of swept a lot of programming domains. Um, people will say, "Oh, it's not because of merit." Well, you're right, but we also improved it over time in the standards body.
Lex Fridman 19:37 Yeah.
Brendan Eich 19:37 I spent 20 years doing that. And, uh, you don't get that choice. It- it's like, I'm not saying that that was the best language. I'm just saying that was the right time to do it. And I like to say the alternative was not to do it. I could have told Netscape, "I can't do this. It's too rushed," and it would have been Visual Basic script, and-
Lex Fridman 19:56 (laughs)
Brendan Eich 19:56 ... it would have been bad.
Lex Fridman 19:57 Uh, so that- that's a good way to present the alternative. But so you're- it was in Netscape, and you- you have written in how many days, and why was it only that many days, and what was the- the goal and the underlying principles in your mind at the time?
Brendan Eich 20:09 So the whole, uh... I'm sort of describing worse is better in a frenetic way because it fit the- the model of Netscape. When- when, um, it was known that Jim Clark would... And Marc Andreessen were founding Netscape, and they did the first release in 1994, that browser took over from Mosaic. In fact, that's why Mozilla is called that, it's the Mosaic killer. It's like-
Lex Fridman 20:28 (laughs)
Brendan Eich 20:28 ... the giant monster that kills Mosaic.
Lex Fridman 20:30 That's awesome. (laughs)
Brendan Eich 20:30 And, um, they knew they could... You know, it wasn't, it wasn't that... Again, it's not like you're doing advanced scientific research that is changing the world. You're more like taking down, uh, uh, uh, the last iteration of the browser Marc did, which had images, and, you know, other importances before he stopped working on it, and you're making Netscape the new thing that has images, plug-ins, which was the way to do video back in the day. It had something that's kind of died now for tiled windows called frames and frame sets.
Lex Fridman 20:55 Mm-hmm.
Brendan Eich 20:56 Um, it had-
Lex Fridman 20:56 Oh, yeah. Yeah, yeah, yeah.
Brendan Eich 20:57 ... HTML tables. That was new. Eric Bina did tables in Netscape 1.1. So when I got there, they were heading toward IPO. Clark wanted to IPO early. I think his instinct was right, and that kicked off the whole dot-com era, right? There was a recession in the US in '91. You can see old Law & Order reruns where they talk about the recession, how hard it's hitting New Yorkers. And after that, uh, Greenspan really goosed things at the Federal Reserve, and- and technology had been sort of fermenting in a way that came together with the internet. And Netscape made it, you know, possible to do pets.com, to do eBay, to get people to recognize a URL on a billboard and then type it in when they get home, and that was huge. Um, that- that was so fast-moving a rocket that, uh, Marc and, um, the engineering team there thought, "We- we need to make this a programmable browser, not just a- a document viewer, not just a video-"
Lex Fridman 21:50 So it was all HTML with images and tables, and also, like you said, frames?
Brendan Eich 21:55 Or really plug-ins or anything.
Lex Fridman 21:56 There was no dynamic element at all.
Brendan Eich 21:57 Yeah, the most dynamism you get was from a plug-in, which w- there were a few of them then. Flash didn't exist at that point. Uh, it was, I think, um...
Lex Fridman 22:06 Java applets yet, or no?
Brendan Eich 22:07 Well, that's the thing. We did the deal with Sun. In fact, I- I was recruited to go do Scheme in the browser. Remember guy stealing Gerald Sussman's beautiful Li- LISP variant. I was gonna do it in the browser because my friends from SGI thought, "Hey, we like Scheme, you'll like Scheme." And I'm like, "I hardly ever use Scheme. It's not really used in industry, except in sort of silos. Um, but I like it. Okay, I'll come do Scheme in the browser." (laughs) I have a slide from my 2017, uh, talk where I have Bruce Wallace crawling through the duct in Die Hard and he's like-
Lex Fridman 22:35 (laughs)
Brendan Eich 22:35 ... "Come out to the coast, you'll have a lot of fun. Come on, do Scheme in the browser."
Lex Fridman 22:39 (laughs)
Brendan Eich 22:40 Um, but when I got there, there was no Scheme in the browser because they'd started a deal with Sun Microsystems. And my best contact there was Bill Joy, who I admired as a Berkeley Unix founder and, you know, Sun founder. Uh, and Bill got the idea of making the browser programmable too, and so the idea, main idea was to put the Java VM, which at that point was not really easy to embed, into Netscape, including the Netscape version on Windows that was still most popular, which was the 16-bit Windows 3.1, which was going away. Microsoft was coming out with Windows 95, and everyone was afraid they were gonna do, you know, Internet Explorer, I guess, 2.0 at that point, 3.0 the next year. They already bought, uh, or invested in, somehow, Spyglass, this other company that shot out from NCSA-
Lex Fridman 23:24 Mm-hmm.
Brendan Eich 23:24 ... at University of Illinois. Um, and in fact, Microsoft had tried to buy Netscape in late '94 before I got there, and I heard about this later. I heard they offered way too little money, and so, you know, Jim Barksdale and Jim Clark said, "Get out of here," and pound sand. But then they realized, oh, this is going to hurt us because now they're going to copy us. It didn't happen right away. I'm not sure when Gates' Internet tidal wave memo was written. That's the famous memo he wrote when Bill Gates realized that Microsoft was going down this old copy AOL path or copy CompuServe path.
Lex Fridman 23:58 Mm-hmm.
Brendan Eich 23:58 A project called Blackbird, presumably after the SR-71, I don't know. But they were gonna make a, you know, dial-up service with a custom content language stack and custom rendering.
Lex Fridman 24:08 Mm-hmm.
Brendan Eich 24:09 It wasn't the web. Um, and you know, they could have content partners, uh, they have a lot of money, but it still wasn't to scale of the web. It wasn't gonna be compelling. And Gates realized this, and he turned the company on a dime, and they-... couldn't buy Netscape. Uh, again, I'm not sure of the timing, so they decided to copy it. And once we realized that, everybody inside Netscape felt even more urgency and more of a frenetic mood. And so my chance to do Scheme disappeared when the Java deal started brewing, but there was still a chance to do a, a companion language to Java because Java was a compiled... is a compiled language.
Lex Fridman 24:42 Mm-hmm.
Brendan Eich 24:42 It's evolved and improved quite a lot since then too, but it was for sort of, uh, serious advanced programmers that cost a certain salary or hourly rate.
Lex Fridman 24:51 (laughs)
Brendan Eich 24:52 And people observed, Bill, Bill Joy observed and, and I-
Lex Fridman 24:54 Yeah.
Brendan Eich 24:54 ... Marc Andreessen and I observed that in a mature stack like Microsoft, you really benefit from having a scripting language like Visual Basic-
Lex Fridman 25:01 Mm-hmm.
Brendan Eich 25:01 ... which became Visual Basic Script in IE3, but didn't take on... didn't take over, uh, kill JavaScript, that you need two languages. One is for the component writers who are higher price and more expert, and the other is for, uh, scripters, Certified Public Accountants, uh, designers, graphic designers with some programming inclination. Anybody. Amateurs. Doesn't matter. There's a much more demotic, uh, approach there for programming the components together, gluing them together. Some people say "duct tape language," which I don't really like, but we saw... Bill Joy and Marc Andreessen and I, we saw the need for a companion language. And the gleam in our eye was to call it JavaScript, though I didn't like it. That was marketing's plan. Marc called it Mocha, which I liked, and-
Lex Fridman 25:45 Nice.
Brendan Eich 25:45 ... Netscape Marketing, I think, didn't like that, so they said, "Oh, there's some trademark in some software somewhere that uses Mocha, so we can't use that." And they tried LiveScript in August, and that didn't last, and then finally we got the trademark license in December 1995. But the work I did to prove that it could be done was important because I, I came in in April and even then Netscape was growing so fast that they couldn't find an open hiring requisition in the client team for me, so they hired me into the server team.
Lex Fridman 26:13 (laughs)
Brendan Eich 26:14 And I worked for a month on the server team on what became HTTP 1.1. So I was actually... I had done protocol work at Silicon Graphics with Greg Chesson, uh, former Bell Labs intern, grad student intern, who knew all the UNIX founders, and Greg was very interested in taking, um, protocols to the next level with VLSI, uh, 'cause he thought that CPUs wouldn't, wouldn't scale up. He, he was mistaken in that, unfortunately. Moore's law more than kept up, and you have, you know, gigabit Ethernet running with conventional processors. But I worked on protocols at SGI as well as UNIX kernel hacking and NFS and things like that. So I, I came into Netscape to work on the (laughs) server side for a month, but I was, I was thinking the whole time, "What should this language be like? Should it be easy to use? Might its syntax even be more like natural language, like," um, "HyperTalk," which is Bill Atkinson's language in HyperCard, if you have ever used HyperCard on an early Mac. Uh, and I thought, uh, "Well, I'd like to do that, but my management is saying, 'Make it look like Java.'"
Lex Fridman 27:14 (laughs)
Brendan Eich 27:15 Which looks like C from a distance. Yeah.
Lex Fridman 27:17 Wha- what does that mean? Is it braces? We're talking about visually?
Brendan Eich 27:20 Yeah.
Lex Fridman 27:20 Does he mean, like, uh, w- what... M- management, do they understand what-
Brendan Eich 27:24 They don't.
Lex Fridman 27:24 ... they think about but-
Brendan Eich 27:24 Marketing didn't know, but, but management did. Like, Rich Schell of V- VP of Engineering knew, and we had a plan even th- that was if you have this companion language, you're going to glue things together between Java and JavaScript, so you're going to have commerce in memory, in the heap with data types.
Lex Fridman 27:40 Oh, interesting.
Brendan Eich 27:40 So you're gonna want some of the data types in Java to reflect in the JavaScript. You're gonna want the primitive types that Java unfortunately separated from objects, so at least some of them, number, dou- uh, double, let's call it in Java's terms, from the C term for double precision floating point. Um, or strings or Booleans, um, and objects, and so right away, there was this constraint. Looking like Java meant kind of a C curly brace syntax, but also some of the data types and objects.
Lex Fridman 28:09 Like objects and so on.
Brendan Eich 28:10 Yeah.
Lex Fridman 28:10 All that kinda stuff.
Brendan Eich 28:11 Dotted calls.
Lex Fridman 28:12 Comparison operator, all that kind of-
Brendan Eich 28:13 Garbage collection. All that stuff, yeah.
Lex Fridman 28:14 Yeah, garbage collection. Yeah.
Brendan Eich 28:15 Uh, even the bitwise operators and the shift operators, including the unsigned right shift, which Java had because it didn't have unsigned integer types, it s- it said, "If you wanna do unsigned operations, use an operator," and that turned out to be important much later. I'll, I'll tell that story if I have time, but, um, JavaScript inherited a set of, uh, operators, the expression grammar, the statement grammar up to a point, from Java, but I wanted a functional language. I wanted Scheme, a little bit of Scheme, even though it wasn't as clean as Scheme. I wanted-
Lex Fridman 28:44 So you had a love story to interrupt. You had a love for Scheme and Lisp, but that- that- that- that functional language landscape.
Brendan Eich 28:49 Yes. I wanted first-class functions because I, I saw the need for callbacks in the browser where it's a single-threaded program.
Lex Fridman 28:55 Wow.
Brendan Eich 28:56 All the early browsers were single threaded, and it's the right model for users. Most users weren't ready for mutual exclusion-
Lex Fridman 29:00 Yeah.
Brendan Eich 29:01 ... and threading. So in a single-threaded world, you, you cannot block the user interface, so you have to use a callback and run later. And the... Without getting too fancy and trying to capture the continuation like CallCC does in Scheme, I thought, "I'll just make it easy to have fun arcs, first-class functions you pass, you know, downward, and it can call back, be called back." Um, and Java didn't have that at the time. It, it had... it took forever to get proper first-class functions, uh, lambdas now into, into Java, Java 7 or 8, I think.
Lex Fridman 29:30 It did have concurrency, right? From-
Brendan Eich 29:32 Yes.
Lex Fridman 29:32 ... from the, from the very beginning, but you're, you were thinking that the, uh, JavaScript in the browser would not have the luxury of being concurrent.
Brendan Eich 29:39 That's right, and the reason was Java was gonna run in a plug-in, so it could fork threads and go, go to town, but the main action in the browser was in a single-threaded program, in a single UNIX process on, on UNIX or Windows, uh, and it was where you had to service the event loop and then go, you know, do things, respond to the network, lay out some HTML, render it, turn, you know, widths into heights by filling containers, boxes, uh, the early... what became the CSS box model, uh, and run scripts to, you know, m- m- make the thing livelier, respond to user input. Uh, and all that event-driven programming was, in part, like HyperCard because HyperCard had this on-event-name syntax.
Lex Fridman 30:19 Mm-hmm.
Brendan Eich 30:19 And so that's why you have in JavaScript onclick run together as the name of the event handler, um, and there's some funny ones, onmouseover and onmouseout. People still complain about those, but, you know. Um, there are many more events now over the years standardized, but...... it was a mix of event-driven, single-threaded programming because it had to run in the main thread of the browser where the action is. And Java never got there, which meant Java could not interact easily or quickly or m- n- in a nested way with the document, with the objects reflected from the HTML document, with the tables and forms and so on. And that, that is one of the reasons I think JavaScript survived and Java kind of died. Java was in this plug-in prison. It essentially was confined to a rectangle, the Apple rectangle. And while we, we even built, uh, next year, uh, Nick Thompson, a friend from SGI who was an intern, grad student at CMU at the time, built the first version of LiveConnect to glue Java and JavaScript together-
Lex Fridman 31:12 Mm-hmm.
Brendan Eich 31:12 ... to deliver on that vision where you do have commerce between the, the data types and the heap. Um...
Lex Fridman 31:18 Did it work?
Brendan Eich 31:18 It worked, but y- y- you were, Java was in charge. Uh, JavaScript was in charge and Java was just these components, these helper objects.
Lex Fridman 31:24 Ah, so you might as well do everything in JavaScript.
Brendan Eich 31:25 And what happened over time, it's like an evolutionary filter. It just kind of, who needs the plug-in? And in fact, Sun mismanaged Java as a plug-in. They, they thought, "Oh, Netscape for, is giving us the distribution vehicle and we don't care about the browser, it's just about getting Java out there." And that was a big miscalculation. They then tried, because Microsoft was killing Netscape after a few years-
Lex Fridman 31:44 (laughs)
Brendan Eich 31:44 ... they tried getting into Microsoft. And you may remember, there was a Sun Microsoft deal which famously blew up.
Lex Fridman 31:50 Oh.
Brendan Eich 31:50 (laughs) And, and, uh, Microsoft kicked Java out of Windows, and that's when they really pulled the trigger. I think they'd already evaluated it and liked it on Anders Hejlsberg's .NET in, you know, C# and decided, "We're gonna just not have Java. We don't want, you know, any of that Sun stuff. We don't want the patent risk. We don't want..." I'm not sure what, what the fights were about, there was some patent angle to it, I think. And up till then, Microsoft had been using Java components like in Outlook Web Access, th- which had a lot of JavaScript to be a webmail-like, Hotmail-like user interface. They had to call the we- the mail server through, uh, HTP and they, they used a, a, a Java object to do this.
Lex Fridman 32:31 Mm-hmm.
Brendan Eich 32:31 And when they gave the boot to Sun, they, suddenly other, you know, the left hand gave the boot and the right hand said, "We better do something else in Outlook Web Access. What are we gonna do?" And they said, "Let's just add an ActiveX component," which is their own na- native way of embedding things in languages, "and we'll make it, uh, it'll be what became XMLHttpRequest, which is now a web standard for calling asynchronously." And it's been replaced by the Fetch API in HTML5 or HTML Living Document. But this whole lineage goes back to, uh, Java being successfully the loser and getting kicked out.
Lex Fridman 33:05 (laughs)
Brendan Eich 33:05 And after Microsoft kicked it out, it was a plug-in, and you would find it required for, like, e- smart card banking in-
Lex Fridman 33:11 Right.
Brendan Eich 33:11 ... in Nordic countries where that was mandated by law but really didn't get used much. Or, you know, there were pilots who used it for, um, flight information. Um, but Flash, which Netscape could have bought but fortunately didn't, the early-
Lex Fridman 33:25 Fortunately didn't? (laughs)
Brendan Eich 33:26 Yeah, that we, we would have screwed it up. I mean-
Lex Fridman 33:28 What year are we talking about with Flash? When was-
Brendan Eich 33:29 I think after the IPO, so it was probably late '95 and-
Lex Fridman 33:32 Oh, Flash was around. Was it Adobe? No, it wasn't.
Brendan Eich 33:34 No, it was-
Lex Fridman 33:35 It was M-
Brendan Eich 33:35 ... it was called FutureSplash and it was, uh, these brothers, Jonathan Gay I think his name was, and he, he, uh, came knocking and the marketing guy at Netscape who was screening the technology partners or wannabe acquisitions was brutal and just everybody wanted to get in on the Netscape, you know, stock gravy train and he sent them packing. And they f- they ended up selling to Macromedia, and Macromedia was where Flash was created. And the good thing about Macromedia was it was a, um, tool company, so it invested in, you know, the best ideas, I think, which are still l- somewhat lost to us at Flash. The timeline, animation is sort of an immutable function th- uh, over time.
Lex Fridman 34:13 They, they had the tooling around that too, like they had Dreamweaver, there was a Flash-
Brendan Eich 34:17 Flash Director, there were a bunch of them.
Lex Fridman 34:18 Yeah. I mean, yeah, they, that was a great-
Brendan Eich 34:20 Flash Builder was one of the last ones. The- these tools were used by real artists and, you know, special effects people and designers. All the restaurant websites around 2005 were done in Flash, which was, you know, we were trying to do HTML5 at the same time. That was the Firefox era. We were trying to make the web capable enough that you didn't need Flash, but if you recall, you'd go to a restaurant, it's like, this is kind of like a game or something. It's like a Flash-
Lex Fridman 34:43 Yeah.
Brendan Eich 34:43 ... all the font looks small and-
Lex Fridman 34:44 So you didn't like Flash from the beginning? You're like, "This is, this doesn't feel right."
Brendan Eich 34:47 N- n- not really. I, I actually admire Flash's technology and I'm, I'm pretty pragmatic about these things and I, I realized that, you know, it doesn't matter if you're dealt a bad hand like JavaScript was a rush job or if you have Flash as a plug-in and you can invest in the tools and make it pretty good. Uh, you should, you should make it better for your users and grow it as best you can. And what happened with the browser due to Microsoft's monopoly abuse, for which they were convicted, and, you know, um, even after that until I think Firefox and then Chrome was people kept saying, "Oh, the web can't do X, it can't do Y."
Lex Fridman 35:21 Yeah.
Brendan Eich 35:21 "We'll have to have a plug-in. We'll have to have a new approach. We'll have, we- we'll, we'll clean the slate and have a new web." And everyone who said that failed, and the reason they failed is because there's too much value in the web, this huge network, and the worse is better principle means that you can not only start bad, which they all sneer at, but get on first and get wide distribution, get sort of an evolutionary advantage in priority of place, but you can also improve it over time.
Lex Fridman 35:49 Yes.
Brendan Eich 35:49 And so if you're gonna improve Flash, and for some reason Flash is now out of favor, Steve Jobs said, "You can't have Flash on the iPhone," that was probably the death knell, put your energy into JavaScript. And that happened, right? So we, we did things at Mozilla with Adobe to improve, which bought Mac- Macromedia, to improve Flash and to improve the version of JavaScript that was in Flash. We tried to standardize that.
Lex Fridman 36:09 Oh, that's right.
Brendan Eich 36:09 I'm getting ahead of myself but that was-
Lex Fridman 36:10 You can program Flash-
Brendan Eich 36:11 ... PS4, yeah.
Lex Fridman 36:11 That's, that's right, that's right.
Brendan Eich 36:12 PS3.
Lex Fridman 36:13 Can, can we just rewind to the magical-
Brendan Eich 36:15 Yeah, sure.
Lex Fridman 36:15 ... like, you know,
JavaScript was created in 10 days
Lex Fridman 36:16 (laughs) it's a special moment in the history of all of computing. It's, uh, we'll talk about it later, but it's arguable, it's possible that the entirety of the world will run on JavaScript at some point. (laughs)
Brendan Eich 36:27 Yeah. (laughs)
Lex Fridman 36:27 So like, it, it's like those are, those days, it would be, it would be interesting if you could just describe-... actually zooming in on the how the cake was baked, uh, from the, you know, the- the several days that you were working on it, what was in your mind, uh, how much coffee were you drinking?
Brendan Eich 36:45 (laughs) Yeah.
Lex Fridman 36:45 Were you nervous? Why, uh, freaking out?
Brendan Eich 36:47 I'll try to remember it. I mean, you're right. There were these pregnant moments you see in hindsight, maybe they're overrated. But like, Hegel sees Napoleon on horseback-
Lex Fridman 36:54 Right.
Brendan Eich 36:55 ... at Yena and says, "There's the world's spirit-
Lex Fridman 36:58 (laughs)
Brendan Eich 36:58 ... uh, on- on horse." Um, and, uh, I knew that there was a chance to do it. Mark knew, and he was my, um, you know, executive sponsor and he was the one, you know, sort of brainstorming how the JavaScript should be right there in the page. That was important for him to say that, 'cause I- I thought so too, but a lot of people were like, "Oh, you can't write programming language in the middle of the markup."
Lex Fridman 37:20 Mm-hmm.
Brendan Eich 37:20 And indeed there are problems. If you did it naively, you'd see the code laid out as like-
Lex Fridman 37:24 Yeah.
Brendan Eich 37:24 ... random gibberish. So I had to figure out how to hide that, and that was a challenge.
Lex Fridman 37:28 Wait, is that- is that a breakthrough idea? I mean, so you and Mark thinking about this idea that you just inject code in the middle of the markup?
Brendan Eich 37:36 Of the webpage? Yeah, it was considered kind of heretical. There was an SGML guru, I forget his name, but he corresponded with me. And at first he was angry. He's like-
Lex Fridman 37:42 (laughs)
Brendan Eich 37:43 ... "You- you should've used a marked section. Why didn't you use a marked section?"
Lex Fridman 37:45 Yeah.
Brendan Eich 37:45 And I said, "Well, SGML marked sections are not part of HTML by the way, and they're not supported in the browser."
Lex Fridman 37:50 Yeah.
Brendan Eich 37:50 And so I- I did some hack that was equivalent, and over time you could do the proper SGML thing. But he eventually came around and it- it was again sort of an evolutionary necessity. It was almost like introgression, like- like, you know, the idea, um, which Lynne Margulies, I think helped get across that, uh, we have to consider mutualism in biology that maybe, you know, mitochondria were ancient, uh, prokaryotes that got into s- the cell and became-
Lex Fridman 38:16 Yeah.
Brendan Eich 38:16 ... beneficial.
Lex Fridman 38:16 Yeah.
Brendan Eich 38:17 Um, somehow, uh, the- the same sort of thinking applies, uh, you have to embed JavaScript in HTML. It- it's gonna be a good virus (laughs) . It won't hurt you.
Lex Fridman 38:25 So the code, uh, the code becomes data in a sense, it just gets carried, uh, car-
Brendan Eich 38:29 It gets carried.
Lex Fridman 38:29 ... car- carried along. But-
Brendan Eich 38:30 Yeah.
Lex Fridman 38:30 ... is there- is there a s- the side of the... So you were focusing on Netscape at that time? Doesn't the browser have to support interpret correctly this, a mix of HTML-
Brendan Eich 38:40 Yeah.
Lex Fridman 38:40 ... and whatever code?
Brendan Eich 38:41 I had to hide it from old browsers, including Netscape 1.1 which was predominant then. So I used, uh, an HTML comment, but the, inside the container that comment lived in, the script tag, which is a new element, I could make different semantics in Netscape too-
Lex Fridman 38:54 Mm-hmm.
Brendan Eich 38:54 ... where those HTML comment delimiters, instead of being multiline brackets, became one line, or essentially one line.
Lex Fridman 39:00 You just... So you wrote this, so JavaScript was written, the programming language was written as a comment?
Brendan Eich 39:05 Yeah, a comment for all browsers and then a- a set of, uh, brackets that were ignored with real code for new. And it was this two-way comment hiding hack, as I called it, that was absolutely necessary for us to get off the ground. We couldn't have bootstrapped JavaScript without it. We didn't have w- scripts that were loaded from a separate file. The only scripts in Netscape too were inline in the document.
Lex Fridman 39:22 What were the challenges here? What- what, like what, uh, you know, typing, uh, uh, uh, what were the choices you were thinking about?
Brendan Eich 39:30 Garbage collection.
Lex Fridman 39:30 With the design for the garbage collection?
Brendan Eich 39:31 I didn't have time to write a garbage collector, so I just, I didn't at first. So the thing was using essentially arenas or what GNU calls obj pools, and just would run out of memory eventually. And I added reference counting in a hurry after the 10 days in which I hacked. So after I was in the server team doing HTTP 1.1 and thinking about the language, I finally got transferred to the client team in early May. And that's when I, you know, I got the go sign from Mark and it was like, "We- we can't wait, because people inside Netscape are doubting, even people, uh, inside Sun are definitely doubting." Bill Joy was the champion but he was like alone in that, in seeing there was a role for JavaScript as the- the, as I call it, the sidekick language, robbing the boy hostage (laughs) .
Lex Fridman 40:12 (laughs)
Brendan Eich 40:12 Frank- Frank Miller qu- put it in The Dark Knight Returns, um, that, uh, there was this silly little language that would be the glue language and it could become important over time. And- and you were better off having that complementarity, that pairing of languages just like Microsoft Stack did with visual C++ and Visual Basic.
Lex Fridman 40:28 So what was the big moment of, uh, "I'm done"?
Brendan Eich 40:33 So I had to do a demo. I- I- I forget the dates, I- I think I, for a history of programming languages paper that Allen West Brock did with my help, he did a lot of the writing. Um, I think it was the 10 days from like Thursday evening through to the following m- m- weeks, uh, you know, up the whole of that week and then into the Monday.
Lex Fridman 40:52 Did you get sleep?
Brendan Eich 40:53 No- no, not enough. And I was really, uh, going fast because I had already used a lot of, um, C compiler and front end compiler knowledge that I'd gained from undergraduate school. When I started getting into computing, uh, (laughs) as a renegade physics major, uh, people were formalizing more efficient, uh, bottom up grammars, parsers for bottom up languages. Uh, really, uh, LALR (1) was the big thing. And I studied all this and learned how to parse them. And in the end, uh, if you're doing C languages, you often do what, um, what- what, uh, Dennis Ritchie did anyway which is a recursive descent, uh, parser, so you can hand code it. And, um, I did that for JavaScript in a blazing hurry. Mostly got it right. I didn't, you know, have precedence inversion problems or other bugs, but I copied a lot from Java and C. And I tried to keep things simple, like the equality operator in those 10 days sprint between two objects of different dynamic type said, "No, they're not equal. Their types are different."
Lex Fridman 41:53 Mm-hmm.
Brendan Eich 41:54 And then after that, I had internal early adopters and- and they were using JavaScript to like match a number against a database field that had been stringized and they said, "Oh, can't we just have implicit conversion?" And like an idiot I agreed. I gave them what they wanted. I was trying to please them and get adoption. And that, you know, broke what- m- m- what equivalence relation, um, nature there was to the- the double equal, uh, you know. There's some for- edge cases with not a number that break that up too, but-
Lex Fridman 42:23 Mm-hmm.
Brendan Eich 42:23 ... it really broke it, um, having implicit conversions in the operator is something that people still roast me over.
Lex Fridman 42:29 So let's- let's talk about two things. One, it sounds like the comparison operator, the equality operator is the thing that you regret? So maybe you can you-
Brendan Eich 42:39 Make- making it sloppy, yeah.
Lex Fridman 42:40 Making it sloppy. So w- what is the biggest thing you regret in those 10 days? And what is the biggest thing you're proud of? Okay?
Brendan Eich 42:47 So that- that making it sloppy came after the 10 days, and my lesson there which I've tweeted is-When people come to you saying, "Can you please make it sloppier? Add this cute feature?" The answer should be no. And I should have known that because I think Niklaus Wirth, one of my heroes, said, "The essence of design is leaving things out." Um, but during the 10 days, I also, like I said, I was in such a hurry I left out garbage collection. It came back to haunt me, but I got reference counting in, in time, that people, um, weren't running out of memory right away on, on long-lived JavaScript.
Lex Fridman 43:15 Wait, what happens when you don't have garbage collection and you have objects, like-
Brendan Eich 43:18 Well, you just run out of memory.
Lex Fridman 43:20 (laughs)
Brendan Eich 43:21 And, you know-
Lex Fridman 43:21 I love it.
Brendan Eich 43:22 ... at first, you write a short script and the page doesn't last long or it doesn't do a lot, and it's okay.
Lex Fridman 43:26 Oh, I see. Yeah, yeah.
Brendan Eich 43:27 But if you're writing a game or something and you're doing event-based allocation, you run out of memory.
Lex Fridman 43:31 Got it.
Brendan Eich 43:31 And this was noticed in the summer of 1995, and people were like, "What's going on?" I said, "Oh, yeah, I gotta get, I better go back and do reference counting." And then the ref- problem with reference counting is you're writing the language in, the runtime in C, an unsafe language, and if you're reference counting and you overflow the counter, you mismanage it so it goes high, it gets stuck high, you leak memory again, and you run out. If you underflow it, you free memory that's still in use.
Lex Fridman 43:55 Mm-hmm.
Brendan Eich 43:56 And even then, we knew what all the, the security hackers came to know, that you therefore have a, potentially a remote code execution vulnerability. 'Cause this was before things like, um, non-executable, um, heap memory and, um, stack defenses against taking over memory. So if you can, from the, the remote side, write some HTML and JavaScript that just happens to exploit a bug in memory safety, like it causes JavaScript to underflow reference counter, and the script still has its hands on that object and it's trying to call a method on it and there's some kind of look up function table in the object, but you managed to stuff the heap with strings that forge their own lookalike for the function table, you can call some other code. And this was a problem right away. So security, you know, JavaScript upped the ante. Java had this problem too, but in its own VM, and it just was, you know, a separate headache for Sun to worry about. We had this problem in Netscape right away. So Netscape 2 came out after my 10 days and after these, you know, follow-on work to embed, um, JavaScript better in the browser-
Lex Fridman 45:03 Mm-hmm.
Brendan Eich 45:03 ... and to add garbage collection through reference counting, really. I, I call it reference counting. And get it shipped. We had a bunch of Daught releases where we fixed security bugs like maniacs. (laughs)
Lex Fridman 45:13 But what is the thing you're... You know, when you sit back on a porch and just look out into the sunset, what are you most proud of from those 10 days?
Brendan Eich 45:22 I think the first-class functions shines. I think, es- especially since Java didn't have it and it was somewhat unusual.
Lex Fridman 45:27 Scheme made it in somehow, uh, at the end of the day.
Brendan Eich 45:30 In spirit, in spirit. I mean, people complain because Scheme has, you know, minimalism. It has, you know, six or seven special forms. It has hygienic macros. It has Call/CC. It has some sort of beautiful, uh, complete, um, set of forms to make the lambda calculus pleasant to use in, in practice. Um, and JavaScript is, you know, kind of, uh, multi-paradigm or shambolic. (laughs)
Marc Andreessen
Lex Fridman 45:56 Just on a small tangent, you mentioned Marc Andreessen. It sounds like, and Bill Joy, but staying on Marc, it sounds like he had an impact on you in that he sort of believed in what you were doing there.
Brendan Eich 46:08 Mm-hmm.
Lex Fridman 46:09 Can you, can you talk about, like, what role Marc had in your life?
Brendan Eich 46:11 Yeah, we, we would meet at the, um, the Pensula Creamery in downtown Palo Alto. And Marc was just fresh out of, you know, grad school or whatever he was doing, and he was big dude, and (laughs) he got fitter later. Uh, he had hair. He, he would order giant milkshakes and burgers. And we would meet there and brainstorm about what to do, and it was very direct because we didn't have much time. The f- the... Sort of, we didn't talk about it, but the implication was Microsoft was coming after us. Marc was saying things boldly, uh, pre-IPO, like, "Netscape plus Java kills Windows," right? This was-
Lex Fridman 46:45 Wow. It's ambitious.
Brendan Eich 46:45 Make, make a browser programmable, it becomes the new runtime for programs.
Lex Fridman 46:48 Wow.
Brendan Eich 46:48 You don't... It's the meta OS or it's the replacement OS. Um...
Lex Fridman 46:52 But he still saw value in JavaScript.
Brendan Eich 46:54 Yes. Bec- even though he was saying that, and Java was the big name, hence the trademark license, uh, he saw JavaScript as important. And he even thought, "What if we got..." (laughs) I told this in other interviews so I can say it. He thought, "What if we had..." Uh, my friend Kip Hickman, who'd been at Netscape from the beginning and who was a kernel hacker at SGI when I joined, he started writing, uh, his own JVM before we consummated the Sun deal and got our hands on their code. And the Java compiler, Java C, which, uh, Arthur Van Hoff had written very nice code, was all written in Java. It was self-hosted or so-called bootstrap.
Lex Fridman 47:26 Mm-hmm.
Brendan Eich 47:26 And so we could use that as soon as Kip's Java VM could run the byte code, eh, from the J- the Sun, uh, JVM running j- the, the self-hosted compiler to emit the byte code. So once we could bootstrap into Kip's VM, we wouldn't need Sun, and Marc was like, "Well, maybe we can just d- you know, ditch Sun, we'll have Kip's Java VM, we'll have your JavaScript VM." We... Well, now we need graphics. So Marc was thinking far ahead because he knew you could do things with HTML and images, but at some point you really want this-
Lex Fridman 47:55 Like, dynamic graphics or three-dimensional?
Brendan Eich 47:57 Yeah, like, like, even SGI had already started its downfall because the first floor DLSI team there had gone off to do 3Dfx and all these other companies that made the graphics card on your PC, right?
Lex Fridman 48:07 Mm-hmm.
Brendan Eich 48:07 Doom was, was big, and Quake, and so you were, we were all playing Quake. I was old, so I was terrible. Um, but-
Lex Fridman 48:13 (laughs)
Brendan Eich 48:13 ... why not put that graphics capability on the web? And in fact it finally happened, uh, at Mozilla with Firefox era with, uh, Vlad Vunkic. Taking OpenGL ES and reflecting it as WebGL. But OpenGL ES is the mobile version of OpenGL, which is a standard based on SGI GL. So there's this whole lineage of graphics libraries or really graphics languages for the, what became the GPU, and Marc was thinking ahead. He's like, "We need graphics too," and I thought, "Okay, I can, I can try to get somebody I knew at SGI," but he's a grad student at MIT. He was studying under Barbara Lisakov. He laughed when he heard about this later. Andrew Myers, he's at Cornell long time. I think he's a full professor. And (laughs) Marc said, "Great, we'll get him," and I thought, "I'm not sure he's gonna come. We'll throw money and we'll stock options." We never did it. And they did the Sun deal, so Kip nobly put aside his own JVM and we used the Sun JVM. So that was an ambitious period, and Marc was very generative because he was pushing hard, he was ambitious, and he wanted to have Netscape at-... possibly be in control of the ball.
Internet Explorer
Lex Fridman 49:13 Maybe you can speak to the, this dance of, uh, Netscape versus Internet Explorer.
Brendan Eich 49:20 Mm.
Lex Fridman 49:20 You've, uh, you've, uh, thr- thrown some loving words towards Microsoft throughout this conversation, but that's a theme with, uh... I mean, Steve Jobs had a similar sort of commentary. From a big sort of philosophical principle perspective, can you comment on, like, the approach that Microsoft has taken with Internet Explorer from IE1 to Edge today? Is there something that you see as valuable that they're doing in the, in the occasional copying and that, that kind of stuff? Or is it, um... Is the world worse off because Internet Explorer exists?
Brendan Eich 49:55 So, I- I'm gonna segment this into historical eras, because I think Microsoft of today with Satya is quite a different company.
Lex Fridman 50:00 Yes.
Brendan Eich 50:00 And what they're doing with Edge is different. But back then, um, Gates, you know, aggressive character, not really original in my view, (laughs) uh, not an originator. Steve Jobs famously said once, "He doesn't have any taste. And I don't mean this in a small way."
Lex Fridman 50:13 (laughs)
Brendan Eich 50:14 "He has no taste." Uh, you can see this, right-
Lex Fridman 50:15 (laughs) Boy.
Brendan Eich 50:15 ... with Apple at the time had-
Lex Fridman 50:17 (laughs)
Brendan Eich 50:17 ... had beautiful typography and, you know, ligatures and kerning and the fonts looked great.
Lex Fridman 50:22 Yep.
Brendan Eich 50:22 And Windows had this sort of ugly system font that was carefully aligned with Pixel so it didn't get anti-aliased.
Lex Fridman 50:28 Why, why, why is it... I'm sorry to keep interrupting, but why did, why was Internet Explorer winning throughout the history of these competitions?
Brendan Eich 50:34 Distribution. Distribution matters-
Lex Fridman 50:36 Ah.
Brendan Eich 50:36 ... more than anything. And this is why, um, you know, even now we're seeing the browser wars, Edge doing better, because it's being foisted on people who have Windows. We have Windows 10 boxes at home. We have some Windows 7 boxes we, or laptops we keep running too, because we, we don't connect them to the internet generally. But, um-
Lex Fridman 50:52 (laughs)
Brendan Eich 50:53 ... but, but, uh, once you have that operating system to-
Lex Fridman 50:55 Yeah.
Brendan Eich 50:56 ... hold, you can, you can force, you know, Edge.
Lex Fridman 50:57 Yes.
Brendan Eich 50:57 And, and Apple did it with Safari too. It's not unique to Microsoft.
Lex Fridman 51:01 That's sad in a way.
Brendan Eich 51:02 But, uh, distribution matters, and that's why, uh, I think IE was going to win, and that's why everybody at Netscape felt we're doomed. This was something Michael Toy and Jamie would say, "We're doomed." Um, but for a while there, we had a chance and we innovated in Netscape 2.0. We did the big platform push, Java and JavaScript and, uh, plug-ins, more plug-ins and, um, you know, more HTML table features and, and really started making a programmable stack out of what were pretty static web languages.
Lex Fridman 51:30 Mm-hmm.
Brendan Eich 51:31 And even in the beta releases of Netscape 2.0, people were using JavaScript to build what you would call single-page applications, like Gmail.
Lex Fridman 51:37 Mm-hmm.
Brendan Eich 51:37 And they were using JavaScript locally to compute things and to call the server on a hidden frame in the background. So, it was prefiguring a lot of what came later as AJAX or dynamic JavaScript, dynamic HTML.
Lex Fridman 51:48 So, people saw that-
Brendan Eich 51:49 Yeah, they saw it. Yeah.
Lex Fridman 51:51 That's kind of, I don't know. From my perspective, that seems quite brilliant. This, it seems, like, really innovative that you would have code run in the browser. It-
Brendan Eich 51:59 It did impress me with something, um, which I learned later about from Eric von Hippel of MIT, which is l- user innovation networks, lead user effects.
Lex Fridman 52:07 Mm-hmm.
Brendan Eich 52:07 That throwing out JavaScript, even though we weren't doing open source, we were doing beta releases early and permissively with Netscape. Getting early developer feedback, absolutely critical. I loved it. I did some of that with SGI with some of the products I worked on, but it really came to the fore in Netscape, and that, you know, culminated in Mozilla where you're dealing with developers all the time and early adopters, lead users. But the lead users helped improve JavaScript even in those last few betas where I could hardly change things. I was under pretty rigid change control.
Lex Fridman 52:34 So, we're talking about just a small collection of individuals that are-
Brendan Eich 52:37 Yes.
Lex Fridman 52:37 ... just, like, upfront using-
Brendan Eich 52:38 A guy named Bill Dortch. You can find his work in the web archive still from 1996. It's a single-page application. It's a artist gallery for- of mountain art. Uh, it doesn't-
Lex Fridman 52:46 He used JavaScript in-
Brendan Eich 52:47 It doesn't quite work. He uses JavaScript locally. He uses a local database. What you-
Lex Fridman 52:50 Damn.
Brendan Eich 52:50 ... would think of now as JSON, but it's all pure JavaScript code, a bunch of objects being constructed.
Lex Fridman 52:55 That's so cool.
Brendan Eich 52:56 Yeah.
Lex Fridman 52:56 (laughs)
Evolution of JavaScript
Lex Fridman 52:57 So, how is the... If you can do sort of a big sweeping progress of JavaScript, how has JavaScript changed over the years in your view from those early 10 days with the quick add- addition of garbage collection and fixes around security? How has this evolution that now it's taken over the world?
Brendan Eich 53:14 It, it... In this... It- it's been a bumpy ride, because the standards body got shut down after Microsoft, I think, um, took over the web and then felt punished by the US v. Microsoft antitrust case.
Lex Fridman 53:25 Can you speak to the standards body? Like-
Brendan Eich 53:27 (laughs) That was a fun ride too, because Netscape had, uh, taken the lead with the web and HTML innovations like, um, frames and frame sets, tables, and the W3C was sort of off even then sort of in SGML land heading toward XML la-la land (laughs) . I'm gonna be a little harsh on it, because-
Lex Fridman 53:44 What's SGML? I'm sorry.
Brendan Eich 53:45 SGML was the, the precursor markup language to HTML. It- it was sort of the more extensible, um, standard-
Lex Fridman 53:52 So some mix of X-
Brendan Eich 53:52 ... generalized markup language. It was, it was a-
Lex Fridman 53:55 XML-like, like-
Brendan Eich 53:55 ... pointing brackets, but it had-
Lex Fridman 53:57 Yeah.
Brendan Eich 53:57 ... all sorts of elaborate syntax for doing, uh, different semantics. And this is why I think, uh, you know, TBL and others who wanted to do this semantic web then took XML, um, forward. But they had this, uh... Or some of them anyway, had this strange idea they could replace the web with XML or that they would upgrade the web to be XML, and it couldn't be done. Uh, worse is better had concrete meaning. The web was very forgiving of HTML including sort of minor syntax errors that could be error corrected. Like, error correction isn't generally done in programming languages because-
Lex Fridman 54:29 Right. That's another amazing thing about HTML is, like, it's more like biology than programming.
Brendan Eich 54:34 Yeah. Exactly.
Lex Fridman 54:36 (laughs)
Brendan Eich 54:36 And, and so, uh, XML was, in its standard form, super strict and could never have admitted, you know, the kind of users who were committing these errors. And the funniest part was Microsoft said, "Hey, we're doing XML," but the way they put it in Internet Explorer under the default media type put it through the HTML error corrector (laughs) .
Lex Fridman 54:54 Oh, wow.
Brendan Eich 54:55 So, they kind of bastardized it to make it popular and usable and accessible. And so XML as a pure, um, you know, thing was never gonna take over. Um, and the W3C was kind of not fully functional because Netscape wasn't co- cooperating with them. We thought about where to take JavaScript, and we realized... Our standards guru, Carl Cargill, realized there was a...... European standards body that had already given Microsoft fits by standardizing parts of the Windows 3.1 API, which European governments insisted on. They said, "Microsoft, we can't use your operating system without some standards." And Microsoft said, you know, "Here's our docs." And, and the government said, "No, we need a European standard." So this body called the European Computer Manufacturers Association, ECMA, which eventually became global and became a proper noun instead of an acronym.
Lex Fridman 55:41 Right. It's, uh, it's just one capital E now-
Brendan Eich 55:43 Yeah.
Lex Fridman 55:43 ... with a lowercase CMA.
Brendan Eich 55:44 Right. And as, uh, one of the early Microsoft guys I met when we first convened a, a working group to talk about JavaScript said, "It sounds like a skin disease." (laughs)
Lex Fridman 55:53 But it gave, uh... I mean, maybe you'll speak to that, but it gave the name to JavaScript of ECMAScript.
Brendan Eich 55:59 That was the standard name because Java was a trademark of Sun's. They were so aggressive, they were sending cease and desist letters to-
Lex Fridman 56:06 Oh, yeah.
Brendan Eich 56:06 ... people whose, you know, Middle European heritage meant their pr- their surname was Javanko, and they called their website javanko.com. And Sun would... sent them a letter saying, "You're using J-A-V-A at the start of your domain name, you must cease and desist." (laughs)
Lex Fridman 56:19 I love marketing more than anything else in this world. Uh, d- so (laughs) so ECMAScript, and now is popularly named as ES-plus version.
Brendan Eich 56:27 I would say people use JS more than anything. People still say JavaScript.
Lex Fridman 56:31 Oh, right, right.
Brendan Eich 56:31 JavaScript is in all the books.
Lex Fridman 56:32 So, I mean, when you're referring to it's usually JavaScript, and when you wanna refer to a version of JavaScript you'll say ES6, ES5 or-
Brendan Eich 56:39 Yes, or now they've gone to years, which is kinda confusing 'cause it's an offset of 2009. ES6 is ES- 2016, uh...
Lex Fridman 56:50 Yeah, it doesn't match the years perfectly.
Brendan Eich 56:52 2015 year, yeah.
Lex Fridman 56:52 Yeah. So, so what, uh, what, what were the choices made, and how did, uh, JavaScript evolve here?
Brendan Eich 56:58 So, we, we took this to this, this new standards body who, which had, we thought, a sort of a proven record of standing up to Microsoft. But Microsoft sent a lot of people. They sent some, some people who were pretty good, and then when they realized that I was there and Netscape was not gonna, you know, just bend over and do whatever they wanted, they sent somebody really good. And he was a smart guy, he did a lot of the work on the first draft of the spec, uh, Shawn Katzenberger. He's left Microsoft. He even did what I sort of did, he told his bosses, "I... Stop bugging me to do other things, I'm focused on this." 'Cause it took a lot of focused work to create the first draft of the spec. And I was still holding... I was spinning almost all the plates. I had, like, part-time help in certain areas, and on the front-end integrations I had the front-end guys. But I, I couldn't take as much time as Shawn was to write the draft spec, but I had to participate because I was essentially helping write down what the language did. And in areas where we didn't like what it did and Microsoft didn't agree, we sometimes, you know, got away with slight changes. And that's the story of standards. You have different implementations, and depending on their market power, they inter-operate where you have agreement, and where they don't, the dominant one usually sets the s- de facto standard.
Lex Fridman 58:05 Mm.
Brendan Eich 58:05 And then you should probably reflect that into the de jure standard. And this happened with JavaScript, uh, over time as Netscape went down and Microsoft went up. We did the first edition of the standard, um, codified in 1997 in France. We had a trip to Nice, uh, which was very memorable.
Lex Fridman 58:22 For any interesting reason or just because it's Nice?
Brendan Eich 58:24 And, and ECMA's European, and IBM and others were, you know, there. Uh, Mike Cowishaw, an IBM fellow, was a Britisher. And we... The, the, the guy who ran ECMA at the time, Jan van den Belt, was quite a, uh, a raconteur and a, a very fun guy, and he had us out for, you know, the great, you know, ƒuit de mer, the ʋɔ̿̈ːbɛ̃ ʋɔ̿̈ː and...
Javascript standardization
Lex Fridman 58:43 Was this standardization process beautiful or painful, that th- those early days, you as the designer of the language?
Brendan Eich 58:48 It was painful because it was rushed. Now, Guy Steele was contributed by Sun, so even more than Shawn, you had this giant brain, Guy Steele, helping, bringing some of that Scheme magic. And he even brought Richard Gabriel for fun. And Richard wrote the fourth clause of the ECMA standard, about... which is kind of a intro to what JavaScript's all about. So we had some, some really good people. And we didn't fight too much. There was some tension where I was fixing bugs and I was late to a meeting, and Shawn Katzenberger of Microsoft was actually mad. Like, "Where is he? We need him." And when I got there, I saw that only he saw this sort of off-by-one bug in, somewhere in the spec, and then I saw it too, and I said, "There's a fence post bug there." And then we kinda locked eyes and we realized we were on the same page, and we kinda... he wasn't mad anymore.
Lex Fridman 59:30 What, what were the features that are being, like, struggled over and debated and thought about and ƒeveloped?
Brendan Eich 59:35 It was mainly writing down what worked and what we, we thought should work in the edge cases that didn't inter-operate or that seemed wrong. Uh, but we were already laying the groundwork for the future editions that I was already implementing, 'c-... I was still trying to lead the standard by using the dominant market power-
Lex Fridman 59:50 Mm-hmm.
Brendan Eich 59:50 ... to write the code that actually shipped.
Lex Fridman 59:52 Mm-hmm. Nice.
Brendan Eich 59:52 So the de facto standard would lead the de jure standard, and I was putting in the, the missing, you know, function forms that I didn't have time for in the 10 days, uh, like-
Lex Fridman 1:00:00 So this is the engineering mindset versus the theoretician. So you didn't wanna create the perfect language, but one that was the popular and shipped-
Brendan Eich 1:00:06 Yeah.
Lex Fridman 1:00:06 ... and all that kinda stuff.
Brendan Eich 1:00:07 And you could say there was... y- I was standing on the shoulders of giants, so there was a staged process where I had to hold back things that it, were well-designed by others in other languages and I could imitate, but I couldn't do them all in the 10 days. So they came in, in 1996 and '97, and they came into the n- third edition of the standard, which was final- finalized in 1999. But at that point, Netscape had been sold to AOL and was... which was a decent exit considering... And, uh, you know, had previously been, uh, mercilessly crushed. Th- Netscape was selling the browser along with server software th- that it had acquired after its IPO, and Microsoft was just underpricing it, so there was no way to compete with that. Microsoft was also, you know, it... making Internet Explorer the default browser in Windows-
Lex Fridman 1:00:52 Yeah.
Brendan Eich 1:00:53 ... which is called tying in antitrust law. And they were doing even more brutal things. There's a famous, uh, investor, he did very well on Google so he's a billionaire, Ram Shriram, and he was sales guy at, or head of sales at, at Netscape. And he got off the phone looking ashen-faced after Compaq called, and said, "Uh, Microsoft just told us they're gonna pull our Windows license if we ship Netscape as the default browser."
Lex Fridman 1:01:15 Wow.
Brendan Eich 1:01:15 This is-
Lex Fridman 1:01:15 So there was just some bullying going on.
Brendan Eich 1:01:17 It was totally in- material in the antitrust case. But, but N- JavaScript escaped into the standard-setting where there was fairly good cooperation. Microsoft had a really good guy on it, and, you know, Guy Steele was there for a time and, and there was some good work. But-... after the antitrust case, and, you know, Netscape kind of dissolving into AOL and not really going anywhere quickly, Mozilla took years to really bring up, um, the standard froze. And by 2003, even though they'd been sort of noodling around with advanced versions, JavaScript 2.0, uh, I'd given the keys to the kingdom to another MIT grad, Waldemar Horovitz.
Lex Fridman 1:01:52 Hmm.
Brendan Eich 1:01:53 Very big brain, he's still at Google, I think. He won the Putnam in '86, so he's-
Lex Fridman 1:01:57 Wow.
Brendan Eich 1:01:57 ... yeah, very mathematical.
Lex Fridman 1:01:58 Legit, yeah.
Brendan Eich 1:01:58 Um, he- he- he designed this successor language, JavaScript 2.0, but it- it only showed up in mutated form in Microsoft's ASP.NET server side, and it-
Lex Fridman 1:02:09 What? (laughs)
Brendan Eich 1:02:10 ... didn't last there. And it showed up in Flash, and that's what became ActionScript 3.0-
Lex Fridman 1:02:14 Ah, ActionScript.
Brendan Eich 1:02:15 ... with J. Yeah.
Lex Fridman 1:02:16 Interesting. And then, and then Flash of course declined, and so how do we arrive at ES6, where it's- it's like there's so many... Well, everyone... Okay, there's this history of JavaScript that people would... It was just, like, cool when you're, like, having beers to talk crap about JavaScript.
Brendan Eich 1:02:32 (laughs)
Lex Fridman 1:02:32 Everyone loves to hate. Like, people who are married say, "Ah, marriage sucks," is they just wanna get- let- let off some steam, even though everyone uses the language.
Brendan Eich 1:02:40 Yeah.
Lex Fridman 1:02:40 But ES6, every- it's become this, like, uh, reputa- like, it fixed major pain points, I think, uh -
Brendan Eich 1:02:49 It added things to the language and added something, um, that was already in ES5's strict mode but made it implicit in class bodies and module bodies. It was a big jump, but it accumulated some of the ES4 designs that we'd done with A- Adobe for what we hoped would be the fourth edition of ECMAScript, that were supposed to fold in some of these old JavaScript 2.0 ideas that had come into ActionScript 3.0. So you look at the family tree and you see these forks, and the main ones are the- the ones that go into Adobe Flash, acquired from Macromedia, and the one that went into the server side of Microsoft's stack, which kinda died, um, and then trying to bring them back into the standard and not quite succeeding. ES4 was- was mothballed. But all the good parts that everyone liked made it into ES6, and so that- that was a success. And I- I said earlier I had the wrong year, I think it's 2015, so it's off by...
Lex Fridman 1:03:40 For ES, uh, 6.
Brendan Eich 1:03:41 We want- yeah, it was done, finalized in 2015. It took a little longer than we hoped, but, um... 'Cause ES5 was 2009, and that was a smaller increment from ES3.0. We skipped 4.0 again, we mothballed it.
Lex Fridman 1:03:53 Mm-hmm.
Brendan Eich 1:03:53 And we had a split in the committee where some people said, you know, "ES4 is too big, we're gonna work on incremental improvements." No new syntax, in particular, they- they promised. Not quite true. But, uh, they- they- they added a bunch of interesting APIs. Alan Weir Sprock, my co-author of that HOPL paper, and he was at Microsoft at the time. Ended up hiring him at Mozilla. He wanted to get to Mozilla and- and keep doing the ch- sort of editoring- editor job of- of the JavaScript standard, the ECMAScript. Um, and when we got ES6 done, it was- it was a little late, 2015, and we switched to year numbers. So people still call it ES6., I call it ES6.0-
Lex Fridman 1:04:29 Yeah.
Brendan Eich 1:04:30 ... but if you remember, you know, off by nine plus 2000.
TypeScript
Lex Fridman 1:04:33 Yeah, I mean, ES6 is such a- a big j- I mean, like you said, there's a thread that connects all of it, but ES6 is when it's, like, became this language that is- almost feels ready to take over the world completely. (laughs)
Brendan Eich 1:04:45 More programming in the large features, more-
Lex Fridman 1:04:47 Yeah.
Brendan Eich 1:04:47 ... features you need for larger teams. And it-
Lex Fridman 1:04:49 Yep. Software engineering.
Brendan Eich 1:04:50 Microsoft did something smart too, they, uh, Anders and company, um, Luke Hoban, who's left Microsoft, also did TypeScript, and they realized, uh, something I think that Gilad Bracha has also popularized and- and, uh, he was involved in Dart at Google. If you don't worry about soundness in the type system, you don't try to enforce the type checks at runtime in particular, just use it as sort of a warning system, a tool time type system, you can still have a lot of value for developers, especially in large projects.
Lex Fridman 1:05:19 Mm-hmm.
Brendan Eich 1:05:19 So TypeScript's been a roaring success for Microsoft.
Lex Fridman 1:05:21 W- what do you think about Type- uh, what do you think about TypeScript? Is it, uh, adding confusion or is it ultimately beneficial?
Brendan Eich 1:05:27 I think it's beneficial. Now, it's technically a superset of JavaScript, so of course I love it, right? (laughs)
Lex Fridman 1:05:32 Right.
Brendan Eich 1:05:32 The- the- the shortest, uh, JavaScript, uh, program is still a TypeScript program.
Lex Fridman 1:05:36 Yeah.
Brendan Eich 1:05:36 Any JavaScript program is a TypeScript program, which is brilliant because then you can start incrementally adding type annotations, getting warnings-
Lex Fridman 1:05:42 Yes.
Brendan Eich 1:05:43 ... learning how to use them. Uh, Microsoft's had to kinda look around corners at the standards body and guess how their version of modules or decorators should work, and- and the standards body then may change things a bit. So I think they're obligated with TypeScript either to carry their own version or to bring it back with incompatible changes toward the standard over time, and I think they've played generally fair there. There's some sentiment that, why don't they standardize TypeScript? Well, they've been clear they don't want to. It- they have a proprietary investment, it's valuable, they have control of the ball. And in- in some ways you- you can say the same thing to any of the other big companies in the standards body. Why doesn't Google standardize its stuff? Um...
Lex Fridman 1:06:20 So you- you think it'll continue being like a kind of a dance partner to- to JavaScript, to the base JavaScript?
Brendan Eich 1:06:25 There's a hope that at some point, bec- if they keep reconverging it and the standard doesn't break them and goes in a good direction, we will get at least the annotation syntax and some semantics around them. Because when you're talking about type annotations, they're generally on, you know, parameters and return values and- and variable declarations, they're cast operators. You want that syntax to be reserved and you want it to work the same in all engines. And this is where ideas like Gilad's pluggable type systems might- might be good, though then you could create the same problem you have with Lisp and Scheme, where there's a bunch of macro libraries and they don't agree and you- you know, you have conflicts between them. But- but pluggable type systems could- could be one way
JavaScript ecosystem
Brendan Eich 1:07:04 to standardize this.
Lex Fridman 1:07:05 What do you think about the giant ecosystem of frameworks, uh, in JavaScript? They- it feels like, uh, because, I mean, this is a side effect of how many people use JavaScript-
Brendan Eich 1:07:15 Yes.
Lex Fridman 1:07:16 ... a lot of, um, entrepreneurial spirit, like-
Brendan Eich 1:07:19 Yeah.
Lex Fridman 1:07:19 ... create their own JavaScripts, uh, J- uh, frameworks.
Brendan Eich 1:07:21 Yeah.
Lex Fridman 1:07:22 And they're all actually awesome, uh, in our own different ways. And, uh, that...This is an interesting question about almost, like, philosophically about biological system and-
Brendan Eich 1:07:34 Yes. Yes.
Lex Fridman 1:07:34 ... evolution and all that kind of stuff. Do you see that as good or should it, like, should some of them die out quicker?
Brendan Eich 1:07:40 I, I think that maybe they should. Now, jQuery was a very clever, uh, thing. John Resig made this library that was sort of query and do, and blended sort of CSS selector syntax with JavaScript sort of object graph or-
Lex Fridman 1:07:52 Yes.
Brendan Eich 1:07:52 ... DOM querying, and made it very easy for people to do things almost like they were learning jQuery as its own language-
Lex Fridman 1:07:57 Yes.
Brendan Eich 1:07:57 ... domain-specific language. And, uh, that, I think, reflected in part the difficulty of using the document object model. These APIs that were originally designed in the '90s for Java as well as JavaScript, they were very object-oriented or even procedural. They were very kind of verbose. And it took, like, a constructor call and three different, you know, hokey-pokey dances to do something, whereas in jQuery it's just one line.
Lex Fridman 1:08:20 Yep.
Brendan Eich 1:08:20 Right? So that fed back finally into the standards. It didn't, it didn't mean we standardized jQuery. It wasn't quite that concise. But you find now with the modern standards that we were working on, uh, in the HTML5 sort of, um, effort, that things became simpler. The Fetch API and the Query Selector API, document.querySelector. A lot of things can be done now in raw JavaScript that you would make more concise and terse in, in jQuery, but it's, it's not bad. It's, it's pretty good. Whereas in the old DOM of 15 years ago, it was just too verbose.
Lex Fridman 1:08:52 So, maybe the frameworks were born kind of, uh, because JavaScript lacked some of the features of jQuery. And so, like, uh, now that JavaScript is f- is swallowing what jQuery was, then the frameworks will... Only the ones that truly add value will stick around and the other ones will die out.
Brendan Eich 1:09:09 And that highlights this also, this division between the core language JavaScript, which can show up in other places like Node.js on the server side, and the browser-specific APIs or the document object model APIs, which are even managed by the W3C, the standards body that was off in XML la-la land when we were doing real JavaScript standards in ECMA. And you, y- y- you have this division of labor, division of responsibility, and division of style, and sort of, uh, aesthetics, and also speed. So, the document object model really stagnated after, um, Microsoft kind of de-invested in the web. And Microsoft did something in their haste, in the spirit of Netscape, doing things quickly and getting on first, called DHTML, and some of their innovations that were like an alternative document object model didn't really get standardized until HTML5 when we pragmatists at Opera at the time, uh, Ian Hickson who went to Google, uh, Apple, and Mozilla said, "Let's, let's... XML's not gonna replace HTML. HTML4 is too old. Let's standardize HTML5 based on all this good stuff, including that DHTML variant,
HTML5
Brendan Eich 1:10:14 dynamic HTML."
Lex Fridman 1:10:15 HTML5, it feels like to me, maybe you can correct me, like a beautiful piece of design work. Uh, it was, uh, it's not often with web stuff, I, you have this f- breath of just like, "Oh, whoever did this is..." It, they f- it just feels good. Uh, is there... What, what are your thoughts about HTML? Is there... Am I being too romantic? Uh...
Brendan Eich 1:10:35 A little bit. A little bit. (laughs)
Lex Fridman 1:10:36 Are there flaws, fundamental flaws to it that I'm just not aware of? (laughs)
Brendan Eich 1:10:40 I'm, uh, m- I, um, you know, my old friend, Hicksey, did a great job. He was another renegade physics student. Uh, he, and he was a, basically a QA guy at Opera, but he obviously is a phy- trained physics, you know, uh, student, and, uh, someone who could write, a Britisher. He, he developed test suites and he started thinking about them more axiomatically. Now, this is, this can be good because you can sort of systematize in a way that makes a better HTML, or you can get caught in the pragmatism of saying, "Well, we have to handle all these edge cases, so we're just gonna have sort of a, a test matrix."
Lex Fridman 1:11:12 Mm-hmm.
Brendan Eich 1:11:12 And if the matrix is large, it will not be beautiful by many people's likes. Everyone likes to minimize along their preferred dimensions, the seven special forms in Scheme or whatever. But, um, but reality is y- HTML needs, uh, to be big. It's kind of shambolic. (laughs) It's a creative multi-paradigm. And Hicksey did a good job, I would say, with, uh, uh, a bunch of it. Um, other people came in in the spirit of Ian Hickson to, to do HTML5 work, and they've carried on that effort, and it's, uh... So it's a mix of pragmatism, d- de facto standards from the past being sort of combined or written down for the first time and then rethought in a way that has a simpler syntax like the Fetch API instead of XMLHTTPRequest. Um-
Lex Fridman 1:11:54 This video too as well, it, it, It's ultimately-
Brendan Eich 1:11:56 Yeah.
Lex Fridman 1:11:56 ... it feels like, maybe you can correct me, it feels like it was the nail in the coffin of Flash.
Brendan Eich 1:12:01 Steve Jobs saying no Flash on the iPhone, in my opinion, was the actual-
Lex Fridman 1:12:04 The phone-
Brendan Eich 1:12:04 ... stake to the heart. But, but-
Lex Fridman 1:12:05 Yeah.
Brendan Eich 1:12:06 (laughs) Well, I'm not, I'm not sure what trope you want to use. S- Flash was a zombie for, u- until just this year, right? Or last year. I think last year was the end of Flash in main browsers. Um, but Jobs really did the death blow. And, uh, yeah, you're right. We had to make HTML5 competitive. I still don't think we got that beautiful timeline animation that we want.
Lex Fridman 1:12:26 The timeline things.
Brendan Eich 1:12:27 Yeah.
Lex Fridman 1:12:27 You like the time... I mean, me from a, a, you know, I used to animate all kinds of stuff inside Flash, plus there's the programming element.
Brendan Eich 1:12:34 Yes.
Lex Fridman 1:12:34 It was a little bit... I don't know if you can comment on that, but to me, it was a little bit like go-to statement, like, i- in a sense that it was a little bit too chaotic.
Brendan Eich 1:12:44 Mm-hmm.
Lex Fridman 1:12:44 Like, it didn't, uh, that OCD part of me as a programmer wasn't satisfied by Flash. It feels like there was bugs that were introduced through the animation process that I couldn't debug easily.
Brendan Eich 1:12:55 Yes.
Lex Fridman 1:12:55 Like-
Brendan Eich 1:12:56 I heard that, too. I, I didn't use it, so I'm doing the grass is greener thing here.
Lex Fridman 1:12:59 Yeah.
Brendan Eich 1:12:59 The thing about li- I liked about the animation model was that it was this immutable function of time. So, you could-
Lex Fridman 1:13:04 Yes.
Brendan Eich 1:13:04 ... time warp and you could... If you dodged these bugs or worked carefully, y- you could really make it sing in ways that I think is still a little challenging with w- web, uh, animation standards. But,
The published transcript ends here. Continue watching on YouTube
Episode duration: 2:59:18
In the uListen app, the transcript lights up word by word as you listen. Get uListen
Transcript of episode krB0enBeSiE