On Jul 19, 2013, at 6:51 AM, Andreas Rossberg wrote: > On 18 July 2013 17:53, Brendan Eich <bren...@mozilla.com> wrote: >> > >> 3. Value object approach: no Symbol wrapper, typeof says "symbol", spec >> treats symbol as exotic object per latest draft. > > The implementation cost of every new exotic object is fairly > substantial in a modern VM, due to cross-cutting. That's at least my > experience from implementing the ones currently on the ES6 radar, > proxies and symbols (not even considering optimisations). We should be > _very_ conservative about introducing more of these than absolutely > necessary.
You have to be able to support Proxy exotic objects so, I don't see why you won't use that exact mechanism for Symbol objects. In other words, use a self-hosted Proxy-based implementation for Symbol objects. The MOP operations on Symbol exotic objects in all cases either throw an exception or return some predetermined result such as undefined or false. These operations have little application utility (other than object model consistency) so there should be any perf. concerns about using a Proxy to define the symbol MOP behavior. Of course, you would still want to optimize for their use as property keys. While there are a few standard exotic objects that clearly need optimization, I would hope that most future ones could reasonably be implemented using Proxy. After all, that was one of the primary motivations for Proxy. If Proxies are only toys then we have wasted an lot of time on them. Allen _______________________________________________ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss