Project Tamarin - Adobe's contribution to Mozilla
Friday 10th November 2006Although in effect part of Flash has been open sourced it is important to remember that it's only the scripting component that has been opened. To play Flash in future versions of Mozilla software you'll still need the Flash plugin which is a disadvantage to those who don't run on a platform that flash is supported.
What Tamarin brings to Mozilla is a "just in time" (JIT) JavaScript Virtual Machine that supports the forthcoming ECMAScript 4 language (aka JavaScript 2). ECMAScript is the standardisation of various scripting languages often grouped together as JavaScript but under different names by different vendors (e.g. Microsoft JScript, Macromedia (Adobe) ActionScript, and Coldfusion's cfscript). In this article I'll use JavaScript when referring specifically to Mozilla uses of ECMAScript and ActionScript when referring to the Flash scripting engine. As Tamarin is open sourced and available under the standard Mozilla tri-licence (GPL, LGPL and MPL) this means that it stands a good chance to be the reference implementation of ECMAScript 4 and can be used in other software that requires a scripting ability.
Tamarin is expected to make its Mozilla debut with Mozilla 2. Mozilla 2 is not actually a product release but is the version of the underlying framework. Mozilla 2 is not expected to be ready by 2008 at the earliest. Firefox 3 will be based on the Mozilla 1.9 framework, it is not sure at this time which Firefox release will use the Mozilla 2 framework. As well as the improved scripting engine Mozilla 2 will feature a host of other improvements to the backend which should both improve performance and code maintainability.
Adobe and Mozilla Corporation employees will be actively contributing to this code base and the intention is to use the same code both in Flash and Mozilla. Other companies will be able to use this code as they see fit so it could be possible that we see Tamarin used in a variety of other applications and perhaps other web browsers too.
On the Mozilla side the plan is to integrate to code with SpiderMonkey which is Mozilla's current JavaScript implementation that is written in C. This is needed because Tamarin is not a drop-in replacement for SpiderMonkey as it provides necessary features that are not available in Tamarin. The combined SpiderMonkey with integrated Tamarin should not have any problems with old JavaScript and should show a performance boost for most. However, skilled scripters are sure to find ways of optimising performance to get even more gains. As this, and other Mozilla 2 works, are going to be significant changes then they'll undergo extensive testing before a version of Firefox is released that used any of the Mozilla 2 framework. This will mean plenty of time to learn performance enhancing scripting skills.
Of course, it's unlikely to have been 100% kindness that prompted this decision from Adobe, they will benefit from the extra assistance of the Mozilla contributors, they will probably make Tamarin the de facto ECMAScript 4 implementation and they'll get a fix to their code not being 64-bit clean at the moment (one reason why there's no native Flash player for 64 bit x86-64 machines). On the downside for them, they'll lose some of their own productivity while bringing the Mozilla contributors up to speed.
I've seen some theories on the Internet suggest that part of the deal with Adobe was to remove the native SVG support from Firefox effectively reducing the competition for Flash. This sounds highly unlikely and even if it did happen remember that the Mozilla codebase is open so it can easily be forked and a version with SVG restored could be reproduced. But I doubt that would happen, doing so would destroy a lot of goodwill in the community and Mozilla depends on their supporters. In fact any scripting improvements brought by Tamarin would benefit SVG that's manipulated by JavaScript. The only way I could see them removing SVG support would be if Adobe ever decided to open source the Flash player but even then I could imagine that this would not be a popular move as SVG is an open standard.
The comments written here are based on my understanding of the Tamarin project and this is subject to change in the future. Nothing in this article should be considered official although it is as accurate to the best of my knowledge