Re: Converting an existing object to a proxy

2011-05-28 Thread LungZeno
On Sat, May 28, 2011 at 2:05 AM, Sean Eagan wrote: > On Fri, May 27, 2011 at 12:43 PM, Sean Eagan wrote: >> Of course you could go the other way, and remove the default trap >> implementations.  All objects could have the same internal method >> implementation regardless of whether or not they ar

Re: Converting an existing object to a proxy

2011-05-28 Thread Andreas Rossberg
On 27 May 2011 19:58, Cormac Flanagan wrote: > What I meant was that by writing the handler functions in the appropriate way, > we can create a proxy that is semantically transparent -- not that all proxies > must be semantically transparent. Well, but how would I create a proxy that is transpare

Re: Converting an existing object to a proxy

2011-05-27 Thread Sean Eagan
On Fri, May 27, 2011 at 1:05 PM, Sean Eagan wrote: > On Fri, May 27, 2011 at 12:43 PM, Sean Eagan wrote: >> Of course you could go the other way, and remove the default trap >> implementations.  All objects could have the same internal method >> implementation regardless of whether or not they ar

Re: Converting an existing object to a proxy

2011-05-27 Thread Sean Eagan
On Fri, May 27, 2011 at 1:05 PM, Sean Eagan wrote: > On Fri, May 27, 2011 at 12:43 PM, Sean Eagan wrote: >> Of course you could go the other way, and remove the default trap >> implementations.  All objects could have the same internal method >> implementation regardless of whether or not they ar

Re: Converting an existing object to a proxy

2011-05-27 Thread Sean Eagan
On Fri, May 27, 2011 at 12:43 PM, Sean Eagan wrote: > Of course you could go the other way, and remove the default trap > implementations.  All objects could have the same internal method > implementation regardless of whether or not they are a proxy.  Within > each internal method there could be

Re: Converting an existing object to a proxy

2011-05-27 Thread Cormac Flanagan
On Fri, May 27, 2011 at 2:26 AM, David Bruant wrote: > On Thu, May 26, 2011 at 5:04 PM, Cormac Flanagan wrote: >> A design goal is that for any object that could be proxified, >> we can replace it with a proxy in a way that is semantically transparent. > > If you provide the ability to put any fu

Re: Converting an existing object to a proxy

2011-05-27 Thread Andreas Rossberg
I'm puzzled about this idea. I thought that one of the main design goals of proxies was that they are transparent, i.e. you cannot tell a proxy apart from a proper object. How can this be maintained for Proxy.createFrom? AFAICS, there is no way you can perform this operation on an object that alrea

Re: Converting an existing object to a proxy

2011-05-27 Thread Sean Eagan
On Fri, May 27, 2011 at 12:18 PM, Sean Eagan wrote: > Thanks, I wasn't aware of that history. > > I'm not suggesting that default handlers or traps even should exist > from an implementation perspective, just that they could be a nice > specification mechanism now that we have proxies.  Otherwise

Re: Converting an existing object to a proxy

2011-05-27 Thread Sean Eagan
Thanks, I wasn't aware of that history. I'm not suggesting that default handlers or traps even should exist from an implementation perspective, just that they could be a nice specification mechanism now that we have proxies. Otherwise we need to separately maintain pseudocode and ES versions of t

Re: Converting an existing object to a proxy

2011-05-27 Thread Brendan Eich
On May 27, 2011, at 8:10 AM, Sean Eagan wrote: > I think the separation between proxies and regular objects is too > much. I would prefer to think of proxies as just a special kind of > object. All objects could be thought of as having a handler ( > [[Handler]] ), and "proxy objects" could be th

Re: Converting an existing object to a proxy

2011-05-27 Thread Sean Eagan
On Fri, May 27, 2011 at 10:10 AM, Sean Eagan wrote: > I think the separation between proxies and regular objects is too > much.  I would prefer to think of proxies as just a special kind of > object.  All objects could be thought of as having a handler ( > [[Handler]] ), and "proxy objects" could

Re: Converting an existing object to a proxy

2011-05-27 Thread Sean Eagan
I think the separation between proxies and regular objects is too much. I would prefer to think of proxies as just a special kind of object. All objects could be thought of as having a handler ( [[Handler]] ), and "proxy objects" could be those objects whose handler is an actual ES object as oppo

Re: Converting an existing object to a proxy

2011-05-27 Thread Brendan Eich
On May 27, 2011, at 3:04 AM, David Bruant wrote: >> The idea of permitting this "becomes" operation only for extensible objects >> with configurable properties is crucial. > Is it? The first time I heard about the "become" operation was in the context > of the proxy fix trap. Second time was thi

Re: Converting an existing object to a proxy

2011-05-27 Thread Boris Zbarsky
On 5/27/11 5:40 AM, Tom Van Cutsem wrote: 2) IIUC, one of the more interesting uses of observables would be to make e.g. DOM nodes observable. That raises the issue of whether Proxy.createFrom can be applied to Host objects, and of so, how to deal with built-in [[...]] properties. How useful wo

Re: Converting an existing object to a proxy

2011-05-27 Thread Sam Tobin-Hochstadt
On Fri, May 27, 2011 at 5:45 AM, Tom Van Cutsem wrote: >> I tend to agree with David about having a separate observable API, if that >> is indeed the driving use case. That API can be very similar to the Proxy >> API though. Racket's "chaperones" come to mind: a chaperone is a strictly >> less pow

Re: Converting an existing object to a proxy

2011-05-27 Thread David Bruant
Le 27/05/2011 11:35, Brendan Eich a écrit : On May 27, 2011, at 2:26 AM, David Bruant wrote: Le 27/05/2011 04:13, Mark S. Miller a écrit : On Thu, May 26, 2011 at 5:04 PM, Cormac Flanagan > wrote: [documenting/expanding some ideas briefly discussed at today's

Re: Converting an existing object to a proxy

2011-05-27 Thread Tom Van Cutsem
> > I tend to agree with David about having a separate observable API, if that > is indeed the driving use case. That API can be very similar to the Proxy > API though. Racket's "chaperones" come to mind: a chaperone is a strictly > less powerful kind of proxy, one that is not allowed to arbitraril

Re: Converting an existing object to a proxy

2011-05-27 Thread Tom Van Cutsem
Since I gather this proposal is meant primarily to support "observable" objects, two remarks: 1) Are proxies the appropriate building block performance-wise? From the notes, it seems that current proxies are not a good building block because of performance issues. Are the performance issues relate

Re: Converting an existing object to a proxy

2011-05-27 Thread Brendan Eich
On May 27, 2011, at 2:26 AM, David Bruant wrote: > Le 27/05/2011 04:13, Mark S. Miller a écrit : >> >> On Thu, May 26, 2011 at 5:04 PM, Cormac Flanagan wrote: >> [documenting/expanding some ideas briefly discussed at today's meeting] >> >> The current proxy proposal has a method to create a new

Re: Converting an existing object to a proxy

2011-05-27 Thread David Bruant
Le 27/05/2011 04:13, Mark S. Miller a écrit : On Thu, May 26, 2011 at 5:04 PM, Cormac Flanagan > wrote: [documenting/expanding some ideas briefly discussed at today's meeting] The current proxy proposal has a method to create a new proxy: var proxy =

Re: Converting an existing object to a proxy

2011-05-26 Thread Mark S. Miller
On Thu, May 26, 2011 at 5:04 PM, Cormac Flanagan wrote: > [documenting/expanding some ideas briefly discussed at today's meeting] > > The current proxy proposal has a method to create a new proxy: > > var proxy = Proxy.create(handler, proto); > > We could extend this proposal to allow an existing

Converting an existing object to a proxy

2011-05-26 Thread Cormac Flanagan
[documenting/expanding some ideas briefly discussed at today's meeting] The current proxy proposal has a method to create a new proxy: var proxy = Proxy.create(handler, proto); We could extend this proposal to allow an existing object to be converted to a proxy, via: var proxy = Proxy.createFro