Look Ma, no "this" (was: ECMAScript Harmony)

Allen Wirfs-Brock Allen.Wirfs-Brock at microsoft.com
Tue Aug 19 18:05:31 PDT 2008


I thought it was Peter Deutsch who originally said "you can cheat if you don't get caught." regarding Smalltalk implementations

> -----Original Message-----
> From: es-discuss-bounces at mozilla.org [mailto:es-discuss-
> bounces at mozilla.org] On Behalf Of Mark S. Miller
> Sent: Tuesday, August 19, 2008 6:03 PM
> To: Michael Daumling
> Cc: brendan at mozilla.org; es4-discuss at mozilla.org; TC39; es3.x-
> discuss at mozilla.org
> Subject: Re: Look Ma, no "this" (was: ECMAScript Harmony)
>
> On Tue, Aug 19, 2008 at 5:54 PM, Michael Daumling <mdaeumli at adobe.com>
> wrote:
> > Just a side note: The code below would create three Function objects
> per
> > Point instance. Some may argue that the days of having little memory
> are
> > long gone, but we still have small devices plus a garbage collector
> that
> > may need to iterate through live objects, including three Function
> > objects per Point. Long live prototype objects.
>
> Michael, I think you missed the note at the end of the message you're
> quoting:
>
>
> > [...] However, the
> > above technique is impractical today because of the extra allocation
> > cost -- one closure per method per instance. But as Dan Ingalls says
> > "you can cheat if you don't get caught." The above desugaring shows
> > how to define the *semantics* of the class construct. The actual
> > behavior of the class construct must not be observably different from
> > some such desugaring. But in a class-aware implementation, it should
> > of course perform better than you'd expect from this desugaring.
> >
> > In the Caja project, we are exploring whether this optimization can
> > even be provided as a source-to-source translation:
> > <http://google-
> caja.googlecode.com/svn/trunk/doc/html/cajitaOptimization
> > /index.html>.
> > It's not yet clear that the idea is practically implementable by this
> > technique
> > <http://groups.google.com/group/google-caja-
> discuss/browse_thread/thread
> > /df6c8ea9a1ca1aa3>.
> > But none of these problems should impede a more directly implemented
> > optimization.
> _______________________________________________
> Es-discuss mailing list
> Es-discuss at mozilla.org
> https://mail.mozilla.org/listinfo/es-discuss



More information about the Es-discuss mailing list