Home Lex Fridman Episode
Lex Fridman · 2021-02-12

Brendan Eich: JavaScript, Firefox, Mozilla, and Brave | Lex Fridman Podcast #160

JavaScript creator Brendan Eich on the language's frantic 10-day birth, the browser wars, and Brave's fight to fix the broken privacy economy of the web.

Brendan Eich: JavaScript, Firefox, Mozilla, and Brave | Lex Fridman Podcast #160
The guest

Brendan Eich: Creator of the JavaScript programming language, co-founder of Mozilla (which made Firefox), and co-founder and CEO of Brave Software (the privacy-focused Brave browser).

What this episode covers

Brendan Eich traces his path from physics and Pascal to Netscape, where in 1995 he wrote the first version of JavaScript in about ten days as a 'sidekick' scripting language to Java. He explains the design choices, regrets (the sloppy equality operator, deferred garbage collection), and how the 'worse is better' principle plus first-mover advantage made JavaScript dominate. The conversation covers the browser wars (Netscape vs. Internet Explorer vs. Firefox vs. Chrome), the deep coupling of search engines and browsers as revenue sources, and the accidental rise of cookie- and script-based tracking. Eich then lays out Brave's mission: blocking trackers by default and using the Basic Attention Token to reconnect users, creators, and advertisers with a private, local machine-learning ad system. He closes on monopoly, censorship, leaving California, and his belief that small stubborn minorities can transform the web.

Recommended on this episode

ProductRecommended

HP calculators

Hewlett-Packard

“really strongly built ... they were awesome calculators”
“i was really into uh the hp calculators of the early mid 70s these were the rpn they were really strongly built”— guest

The guest's own work

ProductBy the guest

JavaScript

Brendan Eich

“today javascript is the most popular language in the world why by many measures why do you think that is”— guest
ProductBy the guest

Firefox

Mozilla

“but like i remember i fully switched to firefox the moment it was i i remember like the moments of first using tabs in firefox”— guest
ProductBy the guest

Brave

Brave Software

“if you give the users a better browser that's faster then you'll get enough users to to give back or support publishers”— guest

Also referenced (named, not recommended)

ProductReferenced

Commodore PET

Commodore

“i had a friend who had a commodore pet and after we saw star wars he said hey let's make a basic uh program that does the death star trench run”— guest
MediaReferenced

Star Wars

George Lucas

“i had a friend who had a commodore pet and after we saw star wars he said hey let's make a basic uh program that does the death star trench run”— guest
MediaReferenced

Goldfinger

United Artists

“as alright goldfinger instead of gold divinely heavy there's probably some gold in them too gold metallization but they were awesome calculators”— guest
MediaReferenced

Die Hard

John McTiernan

“i have bruce wallace crawling through the duct and die hard he's like come out to the coast have a lot of fun come on do scheme in the browser”— guest
MediaReferenced

The Dark Knight Returns

Frank Miller

“the sidekick language robin the boy hostage frank miller put it in the dark knight returns”— guest
MediaReferenced

Quake

id Software

“doom was was big and quake and so you were we were all playing quake i was old so i was terrible”— guest
MediaReferenced

Doom

id Software

“doom was was big and quake and so you were we were all playing quake i was old so i was terrible”— guest
ProductReferenced

Unreal Engine

Epic Games

“in four days they had unreal engine ported by pressing a compile button right they had but they had to have webgl”— guest
MediaReferenced

Serenity

Joss Whedon

“the scene from uh josh whedon's film uh serenity at the end where the actual piece and the score by david newman is called love”— guest
ProductReferenced

Robinhood

Robinhood Markets

“the amazing thing is you have robinhood app which was again supposedly for the demos for the people yeah and eliminated the fee”— guest
ProductReferenced

Coinbase

Coinbase

“we helped them out by embedding a coinbase buy widget and they had the income to buy but it was hard”— guest
MediaReferenced

Who Framed Roger Rabbit

Touchstone Pictures

“they got rid of public transportation in l.a like the who framed roger rabbit cartoon show they used to have trolley cars”— guest
MediaReferenced

Elysium

Neill Blomkamp

“what's the movie by the south african director nell's jody foster up in the space colony uh matt damon is the guy on the earth”— guest

Big reveals from this episode

  • Eich admits JavaScript's loose double-equals operator was added AFTER the 10-day sprint to please early adopters, calling agreeing to it acting 'like an idiot.'
  • He names the equality operator and skipping garbage collection (forcing a rushed reference-counting fix) as his biggest regrets from the original build.
  • He says he's proudest of first-class functions, which Java lacked at the time and which helped JavaScript survive.
  • The asm.js breakthrough let Unreal Engine be ported to the browser in four days just by pressing compile, paving the way for WebAssembly.
  • A Microsoft engineer told Eich on a plane they 'should have just killed Firefox in the cradle' with pop-up blocking and tabs.
  • Brave's Basic Attention Token aims to give users 70% of ad revenue in a three-sided, tracker-free ecosystem built on Ethereum.
  • Eich calls Parler's takedown 'egregious' and selective, contrasting it with violent tweets that stay up on Twitter.
  • He reveals the core, slightly sad truth that browsers' main revenue source is the default search engine deal.

Worth remembering

  • Mozilla is named for 'Mosaic killer', the monster meant to slay the Mosaic browser.
  • Microsoft's XMLHttpRequest (the basis of AJAX and the modern fetch API) was created for Outlook Web Access after Sun's Java was kicked out.
  • JavaScript was standardized at ECMA, giving rise to the name 'ECMAScript', which one Microsoft attendee said 'sounds like a skin disease.'
  • Eich hid early JavaScript inside HTML comments via a 'two-way comment hiding hack' so old browsers wouldn't show code as gibberish.
  • Firefox was called Phoenix, then Firebird, then Firefox after trademark disputes; 'firefox' is a nickname for the red panda.
  • An asm.js / Unreal Engine demo at GDC 2013 stunned developers by running Unreal Tournament in a browser with no plugin.
  • The Guardian once bought its own ad space for a pound and received only 30 pence back, the other 70% lost to ad-tech intermediaries.
  • Brave's private ad matching uses lightweight local ML (SVMs and naive Bayes), not heavy frameworks like TensorFlow.
  • The episode closes with Jeff Atwood's law: 'any app that can be written in JavaScript will eventually be written in JavaScript.'
  • Eich's lesson: when people ask you to make a language sloppier with a cute feature, the answer should be no, design is leaving things out.