I had a bit of help, even at the start, that I’d like to acknowledge again. Ken Smith, a Netscape acquiree from Borland, ported JDK 1.0-era java.util.Date (we both just drafted off of the Java truck, per management orders; we did not demur from the Y2K bugs in that Java class). My thanks also to Netscape 2’s front-end hackers, chouck, atotic, and garrett for their support. EDIT: can’t forget spence on the X front end!
That was 1995. Engine prototype took ten days in May. Bytecode compiler and interpreter from the start, because Netscape had a server-side JS product in the works. The rest of the year was browser integration, mainly what became known as “DOM level 0”. Only now standardized in HTML 5 and Anne’s wg. Sentence fragments here show my PTSD from that sprint :-/.
In 1996 I finally received some needed assistance from RRJ, who helped port David M. Gay and Guy Steele’s dtoa.c and fix date/time bugs.
Also in summer 1996, nix interned at Netscape while a grad student at CMU, and wrote the first LiveConnect. I am still grateful for his generous contributions in wide-ranging design discussions and code-level interactions.
At some point in late summer or early fall 1996, it became clear to me that JS was going to be standardized. Bill Gates was bitching about us changing JS all the time (some truth to it; but hello! Pot meet Kettle…). We had a standards guru, Carl Cargill, who knew Jan van den Beld, then the Secretary-General of ECMA (now Ecma). Carl steered our standardization of JS to ECMA.
At that first meeting, I think I did well enough in meta-debate against the Microsoft team that they sent their A-team to the next meeting. This was all to the good, and Microsoft in full-blooded compete mode, but also with individual initiative beyond the call of corporate duty by Shon Katzenberger, materially helped create ES1. Sun contributed Guy Steele, who is composed of pure awesome. Guy even brought RPG for fun to a few meetings (Richard contributed ES1 Clause 4).
Meanwhile, in fall 1996, I was under some pressure from Netscape management to write a proto-spec for JS, but that was not something I could do while also maintaining the “Mocha” engine all by myself in both shipping and future Netscape releases, along with all of the DOM code.
This was a ton of work, and on top of it I had to pay off substantial technical debt that I had willingly taken on in the first year. So I actually stayed home for two weeks to rewrite Mocha as the codebase that became known as SpiderMonkey, mainly to get it done (no other way), also to go on a bit of a strike against the Netscape management team that was still underinvesting in JS. This entailed garbage collection and tagged values instead of slower reference-counting and fat discriminated union values.
Also in fall 1996, chouck decided to join me as the second full-time JS team-mate. He and I did some work targeting the (ultimately ill-fated) Netscape 4 release. This work was ahead of its time. We put the JS engine in a separate thread from the “main thread” in Netscape (still in Mozilla). This allowed us to better overlap JS and HTML/CSS/image computations, years ahead of multicore. You could run an iloop in JS and the “slow script dialog” seamlessly floated above it, allowing you to stop the loop or permit it to continue.
After summer 1996 and the start of ECMA-262 standardization, Netscape finally invested more in JS. Clayton Lewis joined as manager, and hired Norris Boyd, who ended up creating Rhino from SpiderMonkey’s DNA transcoded to Java. This was ostensibly because Netscape was investing in Java on the server, in particular in an AppServer that wanted JS scripting.
I met shaver for the first time in October 1996 at Netscape’s NY-based Developer Conference, where he nimbly nerd-blocked some Netscape plugin API fanboys and saved me from having to digress from the main thing, which was increasingly JS.
I handed the keys to the JS kingdom to Waldemar Horwat, now of Google, in late 1997. Waldemar did much of the work on ES3, and threw his considerable intellect into JS2/ES4 afterwards, but without overcoming the market power and stalling tactics of Microsoft.
True story: Waldemar’s Microsoft nemesis on TC39 back then, at the time a static language fan who hated JS, has come around and now endorses JS and dynamic languages.
Throughout all of this, I maintained module ownership of SpiderMonkey.
A note on V8: I’d learned of it in 2006, when I believe it was just starting. At that point there was talk about open-sourcing it, and I welcomed the idea, encouraging any of: hosting on code.google.com, hosting without any pressure to integrate into Firefox on mozilla.org (just like Rhino), or hosting with an integration plan to replace SpiderMonkey in Firefox. I had to disclose that another company was about to release their derived-from-JS engine to Mozilla, but my words included “the more the merrier”. It was early days as far as JS JITs were concerned.
V8 never open-sourced in 2006, and stealthed its way to release in September 2008. This may have been a prudent move by Google to avoid exciting Microsoft. Clearly, in 1995, the “Netscape + Java kills Windows” talk from Netscape antagonized Microsoft. I have it on good authority that a Microsoft board member wrote marca at the end of 1995 warning “you’ve waved the cape in the bull’s face — prepare to get the horns!” One could argue that Chrome in 2008 was the new red cape in the bull’s face, which begot IE9 and Chakra.
Whatever Google’s reasoning, keeping V8 closed-source for over two years hurt JS in this sense: it meant Apple and Mozilla had to climb the JIT learning curves on their own (at first; then finally with the benefit of being able to inspect V8 sources). Sure, the Anamorphic work on Self and Smalltalk was somewhat documented, and I had learned it in the ’90s, in part with a stint on loan from Netscape to Sun when they were doing due dliigence in preparation for acquiring Anamorphic. But the opportunity to build on a common engine codebase was lost to path dependence.
On the upside, different competing open source engines have demonstrably explored a larger design space than one engine codebase could under consolidated management.
In any event, the roads not taken in JS’s past still give me pause, because similar roads lie ahead. But the past is done, and once we had launched TraceMonkey, and Apple had launched SquirrelFish Extreme, the world had multiple proofs along with the V8 release that JS was no longer consigned to be “slow” or “a toy”, as one referee dismissed it in rejecting a PLDI submission from Andreas in 2006.
You know the rest: JS performance has grown an order of magnitude over the last several years. Indeed, JS still has upside undreamed of in the Java world where 1% performance win is remarkable. And, we are still at an early stage in studying web workloads, in order to synthesize credible benchmarks. On top of all this, the web is still evolving rapidly, so there are no stable workloads as far as I can tell.
Around the time TraceMonkey launched, Mozilla was lucky enough to hire Dave Mandelin, fresh from PhD work at UCB under Ras Bodik.
The distributed, open source Mozilla JS team delivered the goods in Firefox 4, and credit goes to all the contributors. I single Dave out here because of his technical and personal leadership skills. Dave is even-tempered, super-smart, and a true empirical/skeptical scientist in the spirit of my hero, Richard Feynman.
So it is with gratitude and more than a bit of relief, after a very long 16 years in full, 13 years open source, that I’m announcing the transfer of SpiderMonkey’s module ownership to @dmandelin.
Great post, but it lacks an answer to the question: why?
@Dan: You think 13+ years isn’t enough of a reason? 😛
More in the way of an answer in forthcoming posts on what I’m cooking up with Mozilla Research.
(Connoisseurs must click on the “drafted” link.)
(And *everyone* must click the “Hail to the king, baby!” link 😉
You should mention JSSS and how it was used to emulate CSS in Netscape 4. Which reminded me of another question: What if Netscape “Mariner” was not cancelled back in 1998?
Will you have more time to work on ES.next (and ES.next.next)?
It’s amazing to watch your talks on evolving the language, and what you see ES coming to soon. Can’t wait to hear the next chapter!
@Yuhong: JSSS was a dirty hack on top of Netscape’s pre-CSS layout engine. Sorry, not worth the mention IMHO. For all its issues, CSS was destined to win.
@Justin: I’m spending a lot of time on ES.next and the larger Harmony agenda/process, as recent talks including at #txjs indicate.
Brendan – job well done and good luck to Dave.
Brendan Eich: Yes, but what I was thinking was the CSS-to-JSSS translation, which was even worse. And almost nobody mentioned that the source code for it is public in the Mozilla Classic codebase:
I should also mention Netscape’s ActionScripts, one of the two first attempts to add JS-based behaviours to HTML elements. I still remember my evaluation of Netscape ActionScripts vs. Microsoft HTCs in Redmond in front of Angus Davis and Vidur Apparao IIRC.
@Daniel: right, ActionSheets. IIRC my name is on the w3c submission ;-).
“IIRC my name is on the w3c submission 😉 .”
Yes, I noticed that on the JSSS submission.
And what is even worse, Netscape cancelled Mariner, and Gecko took years before it was reasonably stable, leaving no new release in time to compete against IE5.
@Yuhong: the Mariner story will have to be told in full another day. I was involved in it, shaver too — it was part of a larger “Hawaii” (5.0, get it) proposal to get back to the market sooner, without a total rewrite. Netscape management, under influence from the Raptor team, did not go for it.
Joel Spolsky has written about this as a big mistake. I’ve called it a good move for opening up Mozilla to standards-focused contributors, who eventually did help get Gecko (neé Raptor) in shape.
It’s hard to say how Netscape would have fared had it shipped a Netscape 5 that was better incrementally but probably not in absolute head-to-head terms against IE. Microsoft had put a lot of extra work (some good) into IE. Netscape was having trouble making money (and once bought by AOL, having trouble justifying the acquisition price).
My belief is that Netscape was going to lose market share no matter what, due to IE bundling. Mozilla needed green fields. The payoff came years later when IE was popup- and malware-infested and stagnated on purpose, and we were ready with Firefox.
“The payoff came years later when IE was popup- and malware-infested and stagnated on purpose,”
And as it happens, IE6 in XP SP2 added a popup blocker and increased security, and was released just before Firefox 1.0, BTW. The rendering and most of the rest was still the same though.
Anyway, don’t forget the WaSP too:
And don’t forget the Netscape 6.0 release in 2000 which was widely considered a disaster.
Netscape 6 played its part too, as a negative result that helped Mitchell and me level the playing field, e.g. by making Netscape new-hires go through the same patch submission / review process as “external contributors” in order to get CVS commit access. We also instituted super-review.
We knew Netscape 6 was going to be bad. So did the rank and file at Netscape, who begged not to ship. It was the upper management that needed to save face with AOL and show that their “Raptor” bet was somehow about to pay off.
Around this time the Mozilla builds, originally made for testers, became as popular as Netscape’s product builds — or more popular.
Don’t forget this which summarize the entire mess:
@Yuhong: you keep writing “Don’t forget… and don’t forget….”
I wish I could forget some of the history!
But things have turned out better and better since Firefox launched.
The fight goes on, new battle lines form. History may rhyme but it won’t repeat, and no point crying over spilled milk.
Deep bow to you, sir.
I have always wanted to be able to thank the universe for gifting me a computer dialect that fits like a second skin. Perhaps you could be so kind as to pass along my message.
A well-deserved respite, and a worthy replacement. Happy hacking, Brendan!
I would like for reading more softs story like this. I think the soft of JS is still not as good as the soft of VB6 but the JS is now the popular soft and will get the better.
While I’m not too great a fan of JS, you certainly did a great job for a 10-day constraint. Did you have any experience in designing languages before JS? It looks like you were inspired by Self and perhaps Scheme.
D’oh. Yes, Action Sheets, not ActionScripts.
My evaluation is (W3C Member only, sorry) in https://www.w3.org/Style/Group/1998/09/f2f.html (look for “* Actions/behaviors”)
note to self: wake up _totally_ before posting comments on blogs…
As always, I have the greatest respect for your work. JS is amazing and many other related things in Mozilla are likewise great, getting done what Sun Java and others ultimately never did, effective client-loadable code. That you and others sometimes made it look so easy adds to the genius and great work involved.
As I glance (for the first time) through the new draft of Anne’s WG, of particular interest to me, the simplifications and cleanup were badly needed. The new draft looks beautiful with significant warts removed, some involving DOM level 0 sacred cows and implementations (however adamant various parties were to preserve things in the past) and also many mistakes of later add-ons that were essential but needed refinement or were not and needed removal. This does not to take anything away from prior Mozilla implementations or standardizations, done by many outstanding developers. It is amazing all the things that were right in Netscape’s DOM Level 0, but getting a standard that moves forward and is really supported has always been quite a messy wrestling match. I am also glad it feels like DOM level 0 to you at this point, however much it may have benefited from improvements and experience of Mozilla and other developers over time.
Different people will focus in on different parts of a specification. I would be interested in knowing what the biggest changes are that make it feel more like DOM level 0 to you, specific things missed or added by DOM levels 1 – 3 that needed to be corrected or removed.
Great to hear this history. Dave just did a talk at Velocity last week on JS engines ( https://velocityconf.com/velocity2011/public/schedule/detail/18087 ). I thought it was one of the best talks of the conference and the comments agree. Dave is incredibly knowledgeable.
Great write-up, Brendan!
Hi Brendan, I think it’s clear why some things work fine and other don’t: amazing to see that mozilla has not only great technical guys but incredible open-minded people commanding their developments.
@Joss: do you mean like the joke home page my Netscape colleagues made for me?
It gratuitously fired up Java via LiveConnect, to add salt to the wound!
Of course, there is also the matter of the fact that the first CSS draft was published in October 1994:
And it certainly didn’t help CSS that IE3 and IE4 did not fully comply with CSS1 either.
Also published on my blog:
As a result of the problems, the early uses of CSS was generally to control the font.