Welcome Mr. Future JavaScript Programmer

Your mission: You are a Web 4.0 programmer from the future. For some reason we cannot possibly comprehend, you have come back to 2008 to impregnate your grandmother.

While you’re here it’s crucial to your mission that you also write a Web 2.0 app. Difficulty? Working in our ancient dialect of JavaScript. Solution? Mascara.

No, you don’t wear it, you use it.

Mascara is a program that translates tomorrow’s JavaScript into today’s JavaScript.

It’s been mentioned in some of the big JS venues like here and here, but I’ve been watching since and the author is really knocking the cover off the ball with new releases. I want to make sure he gets the attention he deserves.

Here’s the site:

http://ecmascript4.com/

And here’s the blog where you can read his changelist:

http://blog.ecmascript4.com/

What’s This All About?

JavaScript moves slowly. Programmers are hesitant to use new features of the language until it shows up in all major browsers. You can’t just decide one day to move to the latest version. The version of JavaScript you have available depends on the browser that your client has installed.

Now, if you’re working on an Intranet, or on a Point-of-Sales system, you can mandate the browser. But for applications written for the web, you have to wait, and wait, and wait. Even after all that waiting, some people still haven’t managed to upgrade from IE6 yet. So you roll your eyes and wait some more.

One solution is to check to see if some language features are missing and provide them yourself (there are JavaScript libraries designed to help you out). That works fine when methods are missing, but it doesn’t work for new syntax.

What Mascara does it take future JavaScript (ECMAScript 4) and translate it into current JavaScript. It also does compile-time error checking.

Way to go We can all be future JavaScript programmers now.

About these ads

2 Comments

  1. alsanan said,

    July 10, 2008 at 7:08 am

    Hi Rhett. I’d like to know your opinion about JS2. Some of the improvements are essential (like the imports). Other ones I see like simply convenient (like types, but only for interface interop). But there are a lot of proposed features that I can’t understand. Javascript is now extremately flexible and I think that injecting so many features only hides the will to bring JS to other no interpreted languages. I think that Javascript doesn’t needs to be like other languages. Its current features are what made it unique. I don’t like Microsoft behaviour about EcmaScript 3.1 and discarding the support to 4.0 but, just for one time, I understand them.

  2. rhettanderson said,

    July 10, 2008 at 3:07 pm

    I like JavaScript as it is.

    The good thing about the proposed changes are that they still leave us with the language that we want to program in.

    The biggest trouble for us (who like it as it is) is that there will be many more ways to do things that we’ll have to recognize and learn if we want to work with other people’s code. I like my languages small so I can understand the code other people write.

    To be honest, I’d rather the changes to JS be more minor and slow. To accommodate people who want to program in other languages, there should be a byte-code interpreter (compatible across all browsers) for JS. People can then target any source language to that byte code. Of course, this means goodbye Open Web, but Flash is already in 95%+ of browsers and people are targeting that.

    Don’t worry, though, this is JavaScript. You have plenty of time to get ready for any changes. :-)


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

%d bloggers like this: