What is Mascara?
Mascara is a developer tool that enhances JavaScript with powerful language features like classes, type-verification, namespaces and more.
Mascara compiles this extended JavaScript into baseline JavaScript "object-code" which runs in any browser. This enables developers to use the JavaScript of the future, today.
The language extensions are based on the ECMAScript Harmony specification
(and previous drafts like the ECMAScript 4 draft).
ECMAScript Harmony is the next generation of JavaScript,
and is being developed by ECMA International
with participation by Mozilla, Apple, Adobe, Microsoft and others.)
Benefits
- Classes, packages and namespaces are added to the language. This makes more complex applications easer, less error-prone and more cost-effective to develop.
Object oriented pattens and practices known from other languages can now be applied to JavaScript development.
- Type-verification. Like more heavy-duty languages, Mascara allows type-annotations which enable more self-documenting and robust code, and helps find bugs. The type annotations are optional and specifically designed to allow gradual typing.
- Elegant and concise code - language features like array comprehension expressions, destructuring assignments and lambda-expressions are adopted from dynamic and functional languages, and enables more clear and compact code.
- Backwards-compatibility: Mascara is fully compatible with existing JavaScript code, which allows you to take advantage of existing libraries, and to migrate legacy code to ES4 gradually.
- Browser-independence. The output of Mascara runs everywhere - at least in any browser released for the last 10 years.
- Take control of the future. Some browsers are already implementing parts of ES4 in newer versions. Other browsers have not. However, by using Mascara, you are not dependant on the whims and release cycles of browser vendors.
- Customization - Mascara is implemented in Python, which means that it is quite easy for developers to extend and customize the compiler - for example to implement new language features, or to modify the way the object code is generated.
Limitations
Mascara currently does not have a fancy installer - you have to download it as a zip-file, and install Python 2.5 seperately.
ECMAScript Harmony is not yet a finished standard, and some of the features implemented in Mascara may be changed in the final spec. This is the risk of a life on the cutting edge!
Who will benefit from Masacara?
Mascara will be valuable for:
- Developers or organizations who develop more complex JavaScript-based applications, and who want to reduce the risk and limitations, which often turn
traditional JavaScript applications into unpredictable and buggy.
- Anyone who like to use the most powerful tool available, and not be constrained by the limitations of current browsers.
How is it used?
Mascara can be connected with any text editor and invoked to compile the source ES4 files to output object code, which is then included on web pages.
Alternatively, Mascara can be set up on a web server to compile code on the fly, when a page is requested. This approach yields a quick turnaround during development.
Next steps
More information about the features and use of Mascara in the online documentation..
Download the latest Mascara release and read Getting started
Buy developer licenses for professional use of Mascara.