Making "super" work outside a literal?

Allen Wirfs-Brock allen at wirfs-brock.com
Thu Jun 23 02:56:27 PDT 2011


On Jun 23, 2011, at 7:04 AM, Brendan Eich wrote:

> On Jun 22, 2011, at 4:02 PM, Axel Rauschmayer wrote:
> 
>>> 
>> 
>> 
>> Does the named function expression cost nothing here?
> 
> This is entirely beside the point.
> 
> Dynamic |super| as Sean proposes requires *every call site* to pass the |here| parameter or something derived from it, no way around that.
> 
> Paying for 'super' if you use it, buying by the yard, is not a problem.
> 
> Making *every function call* in the language slow, increasing register pressure, etc. -- absent aggressive inference to identify callees and specialize call sites to them (inlining VMs do this but it can backfire, so there will be a default case that can't do this) -- is a big problem.
> 
> /be

If you don't have actual implementation experience with dynamic languages I think you guys will just have to take Brendan's and my word for this. Dynamic super would have unacceptable overhead on every function call. 

Dynamic super may be conceptually slightly cleaner conceptually in that it eliminates the need for Object.defineMethod.  However, the cost is unacceptably high.

Pragmatically, the choice is between static super and no super. Insisting on dynamic super just pushes the discussion in the no super direction. 

Allen
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20110623/cb5d4cb7/attachment.html>


More information about the es-discuss mailing list