SIDEBAR
»
S
I
D
E
B
A
R
«
JavaScript 2.0, aka ECMAScript 4
June 17th, 2008 by jens

I just discovered that there is an ECMAScript 4—better known as JavaScript 2.0—in development. As a shameless language slut, I immediately dove into the language overview, and it’s pretty neat.

This turns JavaScript into a much more useable language, that I could see doing serious development in. I’m well aware that today’s JS isn’t a “toy”, that it’s got an interesting prototype-based object model under the hood; but I’ve found the language so loose as to be difficult to use. This new version adds a full class model, much better support for iteration, a form of generators/coroutines, and more.

Intriguingly, it also offers type-checking, which has been absent from most mainstream dynamic languages. I know it’s trendy to use “duck typing”, but I find that languages with no compile-time type-checking frustrate me because I make so damn many mistakes that aren’t caught until runtime; which means things I could have fixed in two minutes in C++ or Objective-C take half an hour to fix as I run the program over, and over, and over, discovering and fixing one problem at a time.

Given the concurrent developments in Apple’s JavaScript interpreter, I’m getting pretty excited for JavaScript. I hope that in addition to making it blindingly fast, Apple will also add ECMAScript 4 support, and make it easy to access the language outside of a WebView.


3 Responses  
  • Mark Rowe writes:
    June 17th, 20086:30 PMat

    [..] make it easy to access the language outside of a WebView.

    The JavaScriptCore C API does just that. Is there functionality that you’re looking for which it does not provide?

  • Jens Alfke writes:
    June 18th, 200810:54 PMat

    Mark — Ah, I was not aware that JavaScriptCore had been made public. (It used to be a private framework.) Thanks!

  • Andrew Thompson writes:
    June 20th, 20086:49 AMat

    I just read JavaScript The Good Parts and found it really informative when it comes to navigating which parts of JavaScript it makes sense to use. A book I wish had existed years ago.

    Yes, there’s some padding (amazing given it is actually only 100 pages or so) and some personal opinion, but the rest of the content is outstanding.


»  Substance:WordPress   »  Style:Ahren Ahimsa