Harmony comes to JavaScript, but Not Everyone's Singing

By Kurt Cagle
August 18, 2008 | Comments: 5

A long and contentious struggle came to an end this week as ECMA Technical Committee 39, responsible for the development and maintenance of ECMAScript (known universally everywhere else as JavaScript), voted to establish ECMAScript 3.1 as the next "trunk" branch for the venerable web browser language, rather than the more ambitious (and contentious ECMAScript 4.0). While the breaking of the deadlock is a momentous achievement, not everyone is happy with it.

ECMAScript 3.1 (ES3.1) is an incremental change to JavaScript 3.0, the de facto JavaScript standard that has not been revised in nearly a decade. This particular change is largely a backwards looking approach to revising the language, incorporating several key innovations that have appeared within various browsers over the last several years, such as expanded array methods, closures, iterators and generators (used for creating enumerations), getters and setters, destructuring and related core enhancements to the language.

The changes that Mozilla and Adobe in particular were hoping to implement in their proposal for an ECMAScript 4.0 (ES4) made more than a year ago were considerably more sweeping, and to a significant extent involved introducing early binding and Java-like inheritance into the model, while at the same time taking a cue from lambda function languages such as LISP or Haskell to more effectively implement features such as monads into the language itself.


book coverbook coverbook cover
For a complete list of allthings JavaScript,
visit javascript.oreilly.com


The scope of changes introduced with ES4 were considered too radical a departure from the existing specification by a number of individuals and organizations, including Microsoft's Chris Wilson, architect for Microsoft Internet Explorer and Yahoo's Douglas Crockford, the creator of the JSON format and a key evangelist for the AJAX movement. Their argument was simple - JavaScript is one of the most heavily utilized programming languages in the world, and changes to this specification should be made slowly and with great deliberation. The changes introduced by ES4 would have created a two-tiered programming model that would have been difficult to manage, and would have introduced too many changes that would break a significant proportion of the web.

This dissatisfaction with the proposal manifested itself as a very public dissension between the pro and anti-ES4 factions, including the publication of open letters on both sides of the argument trying to rally support for one or the other view and accusations of obstructionism on one hand and a blindness to adequately field test concepts on the other.

In late July 2008 the technical committee principals met in Oslo to try to come to some accord, as it was evident to everyone that the hope for any advancement of the specification was at a stand-still. Accordingly, representatives from Google, Mozilla, Microsoft, Yahoo, Opera, Adobe, Apple and others all met with the idea of finding a way to break the deadlock. After a series of meetings that Waldemar Horwat of Google described as "seminal", they apparently have succeeded.

BEich.jpgIn a diplomatic online letter, Brendan Eich, Chief Architect for Mozilla, made the announcement that the technical committee had chosen to standardize upon the ES3.1 branch for now - and making the proposal that the internal name for the specification be changed to Harmony. In the letter, he agreed that namespaces and early binding, both key features of the ES4 proposal, did not fit into the underlying model that JavaScript currently uses (and that developers have gravitated toward).

Certain advancements, such as the use of a friend descriptor and Object.freeze, were still on the table, as well as the use of the class keyword for modularity and the use of a Name attribute for type determination that would exist outside of the enumeration of properties for a given JavaScript object.

Early binding, however, was seen as imposing too heavy a performance cost on the system (especially for existing browser implementers beyond Mozilla and Adobe) and didn't work well with the late-binding mindset that is seen in the AJAX development community. Namespaces similarly were perceived by many as adding a fairly hefty complexity cost without necessarily providing adequate value for that complexity.

The adoption of ES3.1 as the new trunk for development impacts Mozilla somewhat, but it has been an especially bitter pill for Adobe to swallow, as they had built ActionScript 3.0 (as well as the open source Tamarin engine which they had donated to Mozilla last year) based upon the ES4 draft. The most immediate consequence of this is that Flash and Flex (along with next generation tools such as Mars and Adobe Air) are now no longer compliant with the new ECMAScript engine, and with specific paths of development now likely permanently closed, there is no chance that they will be in the future.

This forces Adobe's CEO, Shantanu Narayen, into one of two equally unpalatable options - perform a product wide refactoring of their core technologies in order to stay compliant, or to officially fork the development tree and proceed independently with a now non-canonical ActionScript implementation. No decision had been made at the time of this writing.

The announcement of "harmony" between the factions likely will lead, Adobe aside, to a fairly rapid adoption of a new JavaScript that will officially standardize upon a mixture of existing Mozilla Firefox, Safari Webkit and Microsoft Internet Explorer innovations. Longer term, this may also lead to standardization upon generic interfaces for other common objects, such as internal offline databases (such as are used by Google Gears and Mozilla) and the nearly complete synchronization of the XMLHttpRequest object across platforms, though these are obviously external to the JavaScript language itself.

It is perhaps too soon to say that the current harmony of the participants will not break down again into discord, though the timing is fortuitous, as development efforts for the next major versions of nearly all current browsers is still some 18 months to two years out - long enough to make changes in the core libraries of most of these browsers to better work with the emerging specification. The results of those efforts, after fifteen years of hostile rancor among all the participants, may actually be the creation of a common scripting language for use all across the web.


Kurt Cagle is Online Editor for O'Reilly Media and the editor for xml.com. He lives in Victoria, British Columbia with his family, where he spends mornings watching Canadian geese land in his back yard.


You might also be interested in:


5 Comments

I only wish for some small changes,
Having identical event registration in all browsers,
Having a trim function for String core object.
Having a class with true encapsulation, and inheritance mechanisms.

Is this asking for too much?

Adobe killed an awesome JavaScript plugin called JSEclipse (They stopped development as soon as they purchase the company who wrote it)

Microsoft insists not implementing the standard way of event registration

Safari does not take JavaScript seriously and claim be best browser we cannot even implement and test our code easily (Their debugger is very immature)

Mozilla, is taking Venkman not seriously which is a great debugger firebug is great but not a strong and easy to use JavaScript debugger

IE does have a great but very expensive tool called Visual Studio is very helpful but does not work with OS X and Linux.

IE did not upgrade their JavaScript engine for a very long time.

If JavaScript is used this widely you would expect to be updated, and enhanced more frequently. In my humble opinion since none of this companies can control JavaScript they refuse to enhance it. That is the reason we are where we are now. Not a great place if you are a software engineer who does JavaScript.


Nice summary. Thanks!

I agree with Kem Apak here.

Honestly we cannot have truly great JavaScript projects unless there is some consensus across the big players.
"Harmony" does not sound too sweet at the moment, Especially when Adobe Flash is left with a choice of refactoring or non-compliance. Personally, I think non-compliance is going to be the way.

A bit of Early Binding could have gone a long way in making more robust software, but, that is just a personal opinion...

Even if 4.0 is not "the" standard, I think It's important to not just upgrade in small steps, but these small steps MUST sum up into a Giant Leap. Otherwise, it's just a fool-hardy exercise...

Still it's good news that there is "Harmony" :)

I hope they continue to develop the ECMAScript standard.

While it may seem that we need consensus amongst the big players this is mistakenly based on the assumption that they are working together.
It is not in the interests of the big players to have an open usable JavaScript.
MS want to sell us MoonLight tools.
Adobe want to sell us flash tools.

JS4 and SVG would make all of these routes to your bank account vunerable.

Kurt,

Thanks for the article. Here is a question and a few corrections:

You wrote: "...while at the same time taking a cue from lambda function languages such as LISP or Haskell to more effectively implement features such as monads into the language itself."

Sorry, but I wasn't aware that proposed ES4 supported monads.

You wrote: "The adoption of ES3.1 as the new trunk for development impacts Mozilla somewhat, but it has been an especially bitter pill for Adobe to swallow, as they had built ActionScript 3.0 (as well as the open source Tamarin engine which they had donated to Mozilla last year) based upon the ES4 draft."

Just to be clear, AS3 was based on ES3 (ECMA-262), E4X (ECMA-327), some of the ideas in the early Netscape ES4 proposal, and a lot of user testing and feedback that led up to the release of Flash 9 and Flex 2 in 2006.

The recent work on ES4 was an attempt to synthesize AS3 and JS1.7. So it is more accurate to say that ES4 was built on AS3 than it is to say AS3 is built on ES4.

As for swallowing bitter pills, Adobe doesn't have to. We and others tried to produce a language that we truly believed to be good for the web. We didn't have the vendor support we needed to get it done. No hard feelings.

You wrote: "The most immediate consequence of this is that Flash and Flex (along with next generation tools such as Mars and Adobe Air) are now no longer compliant with the new ECMAScript engine, and with specific paths of development now likely permanently closed, there is no chance that they will be in the future."

They are as compliant as they ever were with the current standard ECMA-262 edition 3. And I'm pretty sure we will be able to incorporate the features of ES3.1 and Harmony as they become part of the standard.

You wrote: "This forces Adobe's CEO, Shantanu Narayen, into one of two equally unpalatable options - perform a product wide refactoring of their core technologies in order to stay compliant, or to officially fork the development tree and proceed independently with a now non-canonical ActionScript implementation. No decision had been made at the time of this writing."

I'm guessing Shantanu will let others in his organization handle this one. And let's be clear, standards follow innovation. ES4 was an attempt to follow AS3 and JS1.7. We will continue to evolve ActionScript according to our users needs, and we will continue to participate with standards to which ActionScript has something to offer.

Jd

Popular Topics

Archives

Or, visit our complete archives.

Recommended for You

Got a Question?