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?

Recommended Reading

Learning JavaScript, 2nd EditionLearning JavaScript, 2nd Edition

If you're new to JavaScript, or an experienced web developer looking to improve your skills, Learning JavaScript provides you with complete, no-non... Read More >

Official Netscape Javascript 1.2 Book: The Nonprogrammer's Guide to Creating Interactive Web PagesOfficial Netscape Javascript 1.2 Book: The Nonprogrammer's Guide to Creating Interactive Web PagesBrew Up Instant Scripts--Even if You're Not a Programmer

With this book you can get to know JavaScript; Jump-start your Web Site with ready-to-use scripts; write basic scripts from scratch, add versatility; plus use the interactive lesson plan to try the scripts for yourself.

JavaScript Step by Step (Step By Step (Microsoft))JavaScript Step by Step (Step By Step (Microsoft))

Your hands-on, step-by-step guide to the fundamentals of JavaScript development.

Teach yourself how to program with JavaScript -- one step at... Read More >

Share this :

  • Stumble upon
  • twitter

Comments are closed.