Re: [JS-internals] WeakRefs and weak event listeners

2013-12-02 Thread Jason Orendorff
On 12/2/13 4:27 PM, Bobby Holley wrote: > Moreover, it sounds like revocable proxies can be used by libraries to > achieve the same effects with respect to memory leaks, no? Andrew's response is spot-on, but I still think this is a good point. Revocable proxies are a deterministic feature that we

Re: [JS-internals] WeakRefs and weak event listeners

2013-12-02 Thread Andrew McCreight
As far as I understand it, weak references are useful to avoid leaks when you don't know (1) who is referring to you or (2) what your lifetime should be. Revocable proxies are useful to avoid leaks when you don't know (1) but you do know (2). Of course, if you know both, you don't need either.

Re: [JS-internals] WeakRefs and weak event listeners

2013-12-02 Thread Bobby Holley
Moreover, it sounds like revocable proxies can be used by libraries to achieve the same effects with respect to memory leaks, no? On Mon, Dec 2, 2013 at 12:42 PM, Jason Orendorff wrote: > On 12/2/13 2:18 PM, Jason Orendorff wrote: > > However, I've become unconvinced by the data binding use case

Re: [JS-internals] Transparency of JavaScript Proxies

2013-12-02 Thread Jason Orendorff
On 12/1/13 5:16 AM, schlegel.andr...@gmail.com wrote: > Hello, > > I'm a student at the university of Freiburg. > > I write my master thesis about transparency of JavaScript proxies. > > The topic is, that the proxies are not really transparent, because the > Equal-Operators (== and ===) compare t

Re: [JS-internals] Transparency of JavaScript Proxies

2013-12-02 Thread Tom Van Cutsem
Hello Andreas, I'm not going to give implementation-level advice but as one of the designers of the Proxy API rather some high-level feedback on your proposal: I assume you're working with prof. Peter Thiemann who has been using proxies to implement contracts in JavaScript, so I think I know wher

Re: [JS-internals] Transparency of JavaScript Proxies

2013-12-02 Thread Mark S. Miller
Why not use the identity-preserving membrane pattern? On Mon, Dec 2, 2013 at 10:36 AM, Andreas Schlegel < schlegel.andr...@gmail.com> wrote: > Hello Tom, > > you're right I'm working with prof. Peter Thiemann. > > The intention was to compare the targets not the proxy, if the > isTransparent tr

Re: [JS-internals] WeakRefs and weak event listeners

2013-12-02 Thread Jason Orendorff
On 12/2/13 2:18 PM, Jason Orendorff wrote: > However, I've become unconvinced by the data binding use case. Yehuda > Katz and I discussed it, and after some pointed questions, he gave up, [...] The flavor of my pointed questions was like this: Yehuda said that WeakRefs would be a feature "for libr

[JS-internals] WeakRefs and weak event listeners

2013-12-02 Thread Jason Orendorff
Brendan, After talking it through with more people, I don't think weak event listeners are safer than full WeakRefs. So I retract that suggestion. However, I've become unconvinced by the data binding use case. Yehuda Katz and I discussed it, and after some pointed questions, he gave up, saying "i