Linked by Thom Holwerda on Mon 1st Mar 2010 21:56 UTC
Mozilla & Gecko clones "Mozilla, faced with new competitive pressures, has begun work on three separate, significant changes to Firefox. First is a new JavaScript engine that - with a transfusion from the project behind Apple's Safari - should run Web-based programs at least 30 percent faster. Second is a new graphics engine for Windows that will take advantage of hardware acceleration for graphics and text. And third is a programming tool to help bring to fruition a new system for Firefox add-ons."
Thread beginning with comment 411694
To view parent comment, click here.
To read all comments associated with this story, please click here.
RE: JS engines
by ba1l on Tue 2nd Mar 2010 03:02 UTC in reply to "JS engines"
ba1l
Member since:
2007-09-08

Anyone ever wondered why Firefox couldn't just use V8 (from Chrome) or JavascriptCore? Is it because those engines are lagging in Javascript revision they support?


Several reasons.

The most obvious is that you can't just rip code out of one codebase and stick it into a completely different codebase, just because it looks kind of similar. Maybe they have different platform support requirements, different compiler support requirements, or maybe the two are just completely different, and would require enormous changes to Firefox to swap the engines out.

JavaScript is an integral part of Firefox as a whole, rather than just being used for web site scripting. The entire UI is controlled by JavaScript code. It's part of the configuration system. It's a core part of the extension mechanism.

Since neither V8 nor JavaScriptCore support every feature of Mozilla's JavaScript implementation (it's a superset of the ECMA standard version), and since Firefox and extensions make use of those features, it's not possible to switch to a different JavaScript engine without breaking things. The Firefox developers could fix their own code, but they can't fix everyone else's extensions for them.

Mozilla's JavaScript engine is also used in other software. Until very recently, it was the only real choice for embedding a JavaScript interpreter in something, unless you wanted to use JScript (ugh) and be tied to Windows. Then there's all the software based on XulRunner. Mozilla couldn't just stop development on SpiderMonkey (or Rhino, for that matter), because that'd leave all those other developers stuck.

Having multiple competing implementations is also a good thing. Why is it OK for Google to write their own JavaScript interpreter, but not OK for Mozilla to continue improving theirs? It it just because V8 is currently faster?

It's not like Mozilla are lagging behind or anything. They're improving performance at a rate comparable to JavaScriptCore and V8, and it's not like they have the slowest JavaScript engine around, so they aren't preventing developers from doing cool things with JavaScript. IE's JScript engine is doing that.

Reply Parent Score: 9