Mascara is not for people who hate JavaScript
Tuesday, June 10, 2008 at 01:54PM
Olav

Mascara is not the only project which cross-compiles to JavaScript.
If you for some reason don't like JavaScript or ECMAScript 4, these project may be more to your liking:

Google Web Toolkit - compiles Java to Javascript
Script# - compiles C# to JavaScript
HotRuby - compiles and interprets Ruby in JavaScript
CoffeePie - compiles Python to JavaScript
haXe - compiles the Haxe language to JavaScript
JSC - compiles MSIL to JavaScript
...and probably numerous others.

These projects makes totally sense if you work in a pure-Java or pure-.Net environment, and don't really want to learn a new language just because you have to to some client-side programming. Or if you simply don't like to work with JavaScript.

Mascara has a different approach, because we actually like JavaScript. The core of JavaScript is well-designed, powerful and flexible, and in many ways a more modern design than C# and Java. ECMAScript 4 is not a replacement for JavaScript, rather it is a set of powerful extensions to the base language, while still fully backwards compatible with classic JavaScript.

This means you can keep using all your existing JS-code, or gradually upgrade your code step-by-step to ES4. ES4 is actually specifically designed to allow gradual upgrade from classic JavaScript to ES4.

You can keep using your favorite JavaScript libraries like jQuery, Prototype or YUI and the immense amount of JavaScript code available on the web, while still making your own code more robust and structured by utilizing the ESMAScript 4 type verification and constructs like classes and namespaces.

JavaScript have gotten a reputation for incompatibilities across browsers. This is somewhat unfair, since JavaScript the language is quite consistent across browsers. The incompatibilties are caused by differences in the DOM and CSS implementions, which indeed are frustratingly inconsistent across browser. But that problem is not solvable at the language level, but rather at the library level, where jQuery or the alternatives will hide the browser incompatibilities for you.

So, if you like JavaScript, but want more of it, ECMAScript may be for you.

Article originally appeared on Mascara - The JavaScript of the future, today (http://blog.mascaraengine.com/).
See website for complete article licensing information.