I’m pretty unhappy with this transcript of the Ajax Futures Q and A.

In particular, some comments from Douglas Crockford are very misleading. It looks a pretty rough transcript, so I’m not going to use stronger language.

Crockford: [doesn't like ES4...] Undoes the goals of the original design. Switches from prototypical to classical, loose to strongly typed.

That’s just not true. There is no switch occurring, there are only extensions. It’s true that you can simulate a classical inheritance system in ES3. In fact, lots of people do just that, but it’s awkward and slow. ES4 has a faster, built-in way to do it. But remember, all of the new features are optional. You can keep writing JS just as you always have.

You don’t have to take my word for it, either. Download the ECMAScript4 reference implementation by Mozilla, Adobe, Opera, and others. Try things in the shell:

~/Desktop/es4> ./es4
>> function X() { this.foo = "bar"}
>> X.prototype = {"baz":"qux"}
[object Object]
>> function Y() { this.bop = "wibble" }
>> Y.prototype = new X()
[object Object]
>> var z = new Y()
>> z.bop
wibble
>> z.foo
bar
>> z.baz
qux

Also, in response to the question “Who wrote the ECMAScript 4 spec?” the transcript says Crockford answered “- Adobe, Mozilla, Yahoo and Microsoft. The first to support it, the later two oppose it.” That is pretty misleading as well. The TG1 group is bigger than four members, so it’s not an even split. Only Microsoft and Yahoo are engaging in this transparent application of FUD and stop energy. That is because they are falling behind.

For more accurate information on ES4, check out this Lambda the Ulimate thread.

5 Responses to “ECMAScript4, the Language of the Web”

  1. Al Billings Says:

    I found this odd post today on a blog that I usually read for completely non-technical posts. The author seems to really dislike the new spec.

    http://www.numenware.com/index.php?id=565

  2. Brendan Eich Says:

    I commented on that blog; hope it helps.

    Note how the MS/Doug cohort in TG1 really does want to impose its narrow (or just anti-competitive) vision on all users of the language.

    The majority TG1 cohort, in contrast, is imposing nothing on JS authors who prefer to avoid types.

    An indirect argument about how all JS authors will be forced over time to use classes does not wash on the Web. The structural type system with ‘like’ and ‘wrap’ is for API boundaries, classes are for siloed toolkits, optimized graphics libraries, and in general any instance that should not pay ‘wrap’ costs when flowing through an API.

    JS2 really is a best of both (or three: structural types and multimethods are from lost worlds such as Modula 3 and Dylan or Cecil) worlds language.

    The web is too big for one-size-fits-all thinking. Crockford will never concede this, he’s convinced he will teach the world to use lambda programming to the hilt. He won’t, and it is not always the right hammer for all nails anyway.

    /be

  3. Kris Gray Says:

    Rob, I’m not quite sure what your unhappy about. Is it that I misquoted Mr Crockford?

    Bey Brendan, your name came up a lot, it would have been great to have you there.

  4. Brendan Eich Says:

    Kris: sorry I missed TAE Boston, new baby (still in hospital). I’m pretty sure Rob is not unhappy with you, rather with Doug.

    /be

  5. snellspace.com » Blog Archive » ES4 Says:

    [...] been wondering what was going to be keeping me entertained now that the OOXML stuff has died down a bit. Somehow, Microsoft never [...]