On Jul 19, 2013, at 9:31 AM, Andreas Rossberg wrote:

> On 19 July 2013 18:17, Allen Wirfs-Brock <[email protected]> wrote:
>> 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.
> 
> Because they are different. There is no useful unified mechanism for
> exotic objects, at least no efficient one. Every new form of exotic
> object will be a new special case. As I said, the nice spec-level MOP
> abstraction is largely irrelevant at the implementation level.
> 
> I'm speaking from V8 experience here, but I would be surprised if the
> situation is much different in other modern VMs.
> 
>> 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.
> 
> You can't use proxies for symbols -- they are special in parts of the
> semantics (and that includes their wrappers, if we want them to be
> special, too). And I doubt that you will be able to use them for other
> exotic objects we might come up with (e.g. value objects would have
> special equality behaviour that proxies can't simulate).

Note that I was talking about the symbols as exotic objects path, not the 
symbols as new primitive type path so there would be no wrappers.  In what way 
are the object semantics of exotic symbol objects special such that  couldn't 
be represented via a Proxy handler?  

The special behavior of symbols appears, to me to be all ready of operations 
that are not part of the MOP. Hashing for property lookup, comparison during 
lookup, etc. I still don't see why the Proxy MOP dispatch mechanism wouldn't be 
perfectly adequate for their generally pointless application to symbols. 

> 
> Even if you could, I highly doubt that proxy performance will ever be
> up for the task, at least not for an implementation cost that isn't
> much higher than the special casing.

Like I said, I don't see how this is a performance issue for Symbols exotic 
objects because the MOP operations are never important for them.

Allen
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to