Tuesday, April 1st, 2008

ECMAScript 4 Update: New Grammar, and No Tail Calls

Category: JavaScript

…. proper tail calls are out of ES4 as of yesterday’s Ecma TC39 meeting, by general (regretful, in Mozilla’s
case) agreement.

This is Brendan talking about the death of true tail calls in JavaScript 2 as the language gets tightened a la:

ES4 has overspent its complexity budget in order to explore a large design space. It is now shrinking to meet practical budgets involving Ecma member consensus, prime mover commitments, fatigue effects, community expectations, and the like. No one working on ES4 wants it to be like Perl 6. We aim to finish this year.

Chromatic jumped on this one.

Francis Cheng posted about the grammar update for ECMAScript 4 which has the following updates:

  • Rename ListExpression to CommaExpression;
  • Make CommaExpression a binary expression in the AST;
  • Change ParenExpression to ParenListExpression in SuperExpression;
  • Rename ParenListExpression to ParenExpression;
  • Remove Path qualified PropertyNames;
  • Mark reserved/deferred features with ‘x’;
  • Remove ‘wrap’;
  • Remove ‘like’ as a type;
  • Add ‘like’ as a binary type operator;
  • Remove LetStatement;
  • Remove UnitDefinition;
  • Fold NullableTypeExpression into TypeExpression;
  • Remove OverloadedOperator from QualifiedNameIdentifier;
  • Add distinguishing syntax for tuples and array types in ArrayType;
  • Add SplatExpression to arguments and array literals;
  • Add RestPattern to array patterns;
  • Add to ReservedIdentifiers ‘type’;
  • Add to ContextuallyReservedIdentifiers ‘external’;
  • Removed from ContextuallyReservedIdentifiers ‘decimal’, ‘double’, ‘generic’, ‘int’, ‘Number’, ‘precision’, ‘rounding’, ‘standard’, ‘to’, ‘uint’, ‘unit’;
  • Add LikedPattern to Parameter;
  • Add ‘like’ predicate to ResultType;
  • Remove ParameterKind and use in Parameter

Posted by Dion Almaer at 6:39 am
5 Comments

++---
2.6 rating from 9 votes

5 Comments »

Comments feed TrackBack URI

This is bad news for Javascript 2 in my opinion. I disagree but understand the motivations. Lets just hope that they keep an open door for future evolutions..

Comment by PedroBatista — April 1, 2008

Chromatic is oversensitive, and wrong to think being paid (part-time — I do other things) do work on ES4 has anything to do with what gets into the standard. Perl 6 also was late because of Larry’s health, and I did not mean to hold that against it. Perl 6 is neat, I like it, but it is (again) late, and if ES4 is that late, everyone loses.

PedroBatista, tail calls could be added later but it gets harder as time goes by to retrofit them. They restrict type checks on return values, e.g. The price of tail calls, though, is generators — generators must be in ES4 or I will use my (unpaid) clout to do something dire.

I’ll blog about all this shortly.

/be

Comment by BrendanEich — April 1, 2008

It was still a bit of a cheap shot Brendan, and I say that as someone who loves both Javascript and Perl, and has a high amount of respect for the contributions both you and Chromatic have made to your respective languages.

Comment by patspam — April 1, 2008

If you say so. “Cheap shot” seems to me to ascribe bad motive, but since I’m a Perl fan (hard these days among the Python and Ruby folks), all I can say is that I wasn’t shooting at anything. The reasons for Perl 6 lateness are peculiar to its history, and some of them even look like good reasons for taking the time to get it right. All I was saying is that ES4, which is definitely in a competitive setting, with a committee (or two), can’t be that late.

/be

Comment by BrendanEich — April 1, 2008

“tail calls could be added later but it gets harder as time goes by to retrofit them.”

So completely disappointing. :-(

Comment by PeterMichaux — April 2, 2008

Leave a comment

You must be logged in to post a comment.