types

Brendan Eich brendan at mozilla.org
Thu Aug 14 00:49:18 PDT 2008


On Aug 13, 2008, at 11:52 PM, Peter Michaux wrote:

>> I see.  To which I say, why not both?
>
> First-class, lexical functions are a _relatively_ easy thing upon
> which to agree and were added to the language before such a large
> process was put in place for evolving the language.

Lambda can do anything, we know this. But that doesn't mean it should  
be the only tool in the belt.

Macros won't be ready for the next major edition. The research on  
well-defined, sound hygiene is just being done now. Then there's the  
lovely C-based syntax. Macros may eventually make it into some future  
edition (my gut says). Recasting sugar added before they arrive, once  
they're there, should be possible.

In the mean time, we have extensions from the *not*-large-process  
Mozilla JS1.x world. We have concrete proposals and sketches from a  
few people on the committee acting more as champions than dictators,  
but not subjecting everything to design-by-committee. And we have a  
pretty high-quality committee.

Nevertheless, I think you are right on to warn:

> A committee agreeing by consensus on a OOP system seems like a
> nightmare that may not happen. The single-inheritance,
> multiple-inheritance, mixins, interfaces, public, private, protected
> mess seems intractable since no one seems to think any language does
> it all perfectly. A CLOS-type system might be best. Who really knows?
> It is a huge problem and perhaps requires dictator-style leadership
> (and that may not work either as multiple implementations must get on
> board.)

We won't get the benevolent dictator, and we won't try for the big  
CLOS-style system (this latter point is part of Harmony). We can't  
iterate the standard too quickly because of intrinsic overhead and  
latency, and the tendency to enshrine mistakes and get painted into  
corners by iterating too quickly (ignoring overhead/latency).

I'm a realist, but I've pushed dialectically against the tendency of  
languages to stagnate and go into decline at high switching cost  
(dying only years later, if ever). To the extent that JS1.x in  
Mozilla, AS3 in Flash/Flex, and ES4 as a love-it-or-hate-it proposal  
have moved the needle away from stagnation, great. Without Firefox  
and Safari growing market share, we probably wouldn't even be talking  
right now about JS futures. Who knew four years ago that any of this  
was possible?

So cheer up! ;-) Things are looking brighter, in spite of the  
inevitable standards-committee setting.


> I use OOP frequently in JavaScript but it isn't usually the style in
> ES3 or class-based like proposed ES4. It's the style I think is
> appropriate to the situation. That may draw a slight performance
> penalty but the code is certainly more robust than the ES3 style.

Sorry, curious again: what do you mean by ES3 style?

/be



More information about the Es-discuss mailing list