Featured Posts

Why Do We Need Google Closure? Why Google Closure?When a new JavaScript library arrives, a question is often raised reasonably: “Why does the world need another library?” while we’ve already had too many good ones like jQuery, Prototype, Mootools, YUI… you name it. To find the right answer, just have a look at the package offered by Google under the name of Closure project....

Read more

Simple Web Chat with Meteor Comet Server Comet is not really brand-new (Ajax) term today; however, with most of people how it works remains somewhat mysterious. I have a little hand-on experience with Comet when creating a hobby game project with DWR Reverse Ajax sometime ago. It (DWR) was simple to start and really worked but required a Java web server (Tomcat, Jetty...) that I found rather...

Read more

corMVC: An jQuery-based MVC Framework I know quite a few JavaScript MVC frameworks out there but corMVC is what makes me exited at most for a few reasons. corMVC stands for "client-only-required" Model-View-Controller and that means it does not depend on specific server-side technology. In case you want to demo something, it would be perfect if everything can be done on client side. Of...

Read more

Transparent PNG vs Transparent GIFBest IE6 “PNG Alpha-Transparency” Fixes You are likely living in civilized society with Firefox, Safari, Chrome or Internet Explorer 7/8 installed in your computers. Yet, some are still in the dark with the older Microsoft browsers named Internet Explorer 6 (IE6) or, worse, older versions. One of the most painful facts about IE6 is that it does not natively support PNG alpha-channel transparency. Microsoft...

Read more

  • Prev
  • Next

Is Future of JavaScript in Harmony?

0

Posted on : 08/22/2008 | By : Jimmy Vu | In : JavaScript 2


What is Harmony?

What is Harmony?

Many web developers have felt relief to hear that EcmaScript 4 (ES4) standard project fell apart. Through quite a long post “The Only Thing We Have To Fear Is Premature Standardization“, Douglas Crockford told us why EcmaScript standard must be revised to cope up with changes on modern web but ES4 has not been mature enough to be realized.

In deeper details, John Resig explained how current ES4 will not reach a sensible result and why it should be merged with ES 3.1 to create the next specification (code name Harmony).

The ECMAScript 4 specification development was very ad-hoc in nature (primarily tackled by Adobe, Mozilla, Opera, and Google): Implementors agreed upon a set of features that they wished to implement and a specification was molded out of the remaining consensus. Building a specification tailored by implementation is a very pragmatic means of reaching a reasonable result.

However there was a fundamental split related to how much of the specification should be implemented. Enter ECMAScript 3.1. This working group (lead by Microsoft and Yahoo) set out to implement some minor changes and bug fixes to ECMAScript 3 while remaining as a subset of full ECMAScript 4 functionality.

These two groups continued to work side-by-side but a struggle was inevitable. The ECMAScript 3.1 group wanted to add changes to the language that would affect the result of ECMAScript 4. This struggle over the past year finally came to a head this past month at the meeting of TC39 (the committee responsible for both ECMAScript 4 and ECMAScript 3.1). Dubbed “the Oslo meeting” this discussion between the two groups saw an ultimate conclusion: The two efforts had to be merged, otherwise neither one would succeed.

You may be confused with the “name soup” of JavaScript, JavaScript 2, ECMAScript (3, 4 and 3.1), ActionScript, Tamarin etc. Right? Just find clear explanations of such terms from another post by Alex Russell.

So, now (near) future of JavaScript can be seen via the Harmony project with some new features we can certainly expect:

  1. Classes will be a part of the new language but they will be defined as simply being syntactic sugar for a series of plain methods or conventions
  2. New methods like Object.freeze() — which allows you to pass in an object and “freeze” it, preventing it from being modified any further — to create class-like experience.
  3. JavaScript getters and setters (implemented by Mozilla, Apple, and Opera) will be in the specification.

Maybe other topics like “let” or “expression closures” will be considered but as they require new syntax, it’s more likely that they will be in post-Harmony.

One question: Should we still consider Harmony (specs) as JavaScript 2 or we’ll wait for something better?