Re: Re: What is the status of Weak References?

2017-07-22 Thread Owen
Thank you for the link, I'm glad to see that people have been making progress on it. On Fri, Jul 21, 2017 at 2:16 PM, Isiah Meadows wrote: > This is probably best asked/stated here: > https://github.com/tc39/proposal-weakrefs/ > - > > Isiah Meadows >

Re: Re: What is the status of Weak References?

2017-07-21 Thread Isiah Meadows
This is probably best asked/stated here: https://github.com/tc39/proposal-weakrefs/ - Isiah Meadows m...@isiahmeadows.com Looking for web consulting? Or a new website? Send me an email and we can get started. www.isiahmeadows.com On Thu, Jul 20, 2017 at 6:26 PM, Owen

Re: Re: What is the status of Weak References?

2017-07-20 Thread Owen
I see this is a very old thread, but I was wondering if there have been any new developments/plans? My thoughts are this: I think it's natural, if you're used to seeing people misuse GC, to be suspicious of weakrefs. With GC it's easy to create accidental memory leaks because you think the

Re: What is the status of Weak References?

2013-03-03 Thread Marius Gundersen
In the weakref case, someone has to keep a strong reference to the listener until it's not needed anymore. The decision to cut this last strong reference is exactly the same decision as deciding when not to re-subscribe. Unless there are multiple references to an object, in which case you cannot

Re: What is the status of Weak References?

2013-03-03 Thread Brendan Eich
David Bruant wrote: There is another approach taken by the requestAnimationFrame API rAF is really not analogous to a listener, it is like setTimeout or setImmediate. See http://lists.w3.org/Archives/Public/public-webapps/2013JanMar/0625.html and the whole thread there. /be

Re: What is the status of Weak References?

2013-03-02 Thread David Bruant
Le 02/03/2013 01:58, Rafael Weinstein a écrit : On Sat, Feb 2, 2013 at 11:02 AM, Brendan Eich bren...@mozilla.com wrote: David Bruant wrote: Interestingly, revocable proxies require their creator to think to the lifecycle of the object to the point where they know when the object shouldn't be

Re: What is the status of Weak References?

2013-03-02 Thread Kevin Gadd
I don't understand how the requestAnimationFrame approach (to registering periodic callbacks) applies to scenarios where you want Weak References (for lifetime management) or to observe an object (for notifications in response to actions by other arbitrary code that has a reference to an object).

Re: What is the status of Weak References?

2013-03-02 Thread Jussi Kalliokoski
On Sat, Mar 2, 2013 at 6:11 AM, Kevin Gadd kevin.g...@gmail.com wrote: I don't understand how the requestAnimationFrame approach (to registering periodic callbacks) applies to scenarios where you want Weak References (for lifetime management) or to observe an object (for notifications in

Re: What is the status of Weak References?

2013-03-02 Thread David Bruant
Le 02/03/2013 12:11, Kevin Gadd a écrit : I don't understand how the requestAnimationFrame approach (to registering periodic callbacks) applies to scenarios where you want Weak References (for lifetime management) or to observe an object (for notifications in response to actions by other

Re: What is the status of Weak References?

2013-03-02 Thread Bill Frantz
On 3/2/13 at 3:47 AM, bruan...@gmail.com (David Bruant) wrote: I won't say it's absolutely better than WeakRefs and it may not apply to the data binding case (?), but it's an interesting pattern to keep in mind. Speaking from ignorance here. One advantage of the resubscribe for every event

Re: What is the status of Weak References?

2013-03-02 Thread Marius Gundersen
I won't say it's absolutely better than WeakRefs and it may not apply to the data binding case (?), but it's an interesting pattern to keep in mind. I can't see how this would work in an observer/listener application. The listening object has no way of knowing if it will be deleted when the

Re: What is the status of Weak References?

2013-03-02 Thread David Bruant
I'm still balanced on whether/when/how the one-time listener pattern can be effective, but I feel like it's an interesting idea to discuss. Le 02/03/2013 21:13, Marius Gundersen a écrit : I won't say it's absolutely better than WeakRefs and it may not apply to the data binding case (?), but

Re: What is the status of Weak References?

2013-02-03 Thread David Bruant
Le 03/02/2013 06:21, Brandon Benvie a écrit : Some people would say that garbage collection is the most important advancement in computer science in the last 20 yearshttp://www.codinghorror.com/blog/2009/01/die-you-gravy-sucking-pig-dog.html Don't get me wrong, I didn't say nor didn't mean

Re: What is the status of Weak References?

2013-02-03 Thread Kevin Gadd
On Sun, Feb 3, 2013 at 2:58 AM, David Bruant bruan...@gmail.com wrote: Let's see how the example would be with weakrefs: function Storage(){ var storage = [] return { push(e){storage.push(makeWeakRef(e))}, last(){ var last =

Re: What is the status of Weak References?

2013-02-03 Thread David Bruant
Le 03/02/2013 12:08, Kevin Gadd a écrit : On Sun, Feb 3, 2013 at 2:58 AM, David Bruant bruan...@gmail.com wrote: Let's see how the example would be with weakrefs: function Storage(){ var storage = [] return { push(e){storage.push(makeWeakRef(e))},

Re: What is the status of Weak References?

2013-02-02 Thread David Bruant
Le 02/02/2013 06:41, Nathan Wall a écrit : David Bruant wrote: David Bruant wrote: Garbage collectors have evolved and cycles aren't an issue any longer, weak references or not. Kevin Gadd wrote: Cycles are absolutely an issue, specifically because JS applications can interact

Re: What is the status of Weak References?

2013-02-02 Thread Tom Van Cutsem
2013/2/2 David Bruant bruan...@gmail.com About weakrefs, I've read a little bit [2][3] and I'm puzzled by one thing: the return value of get is a strong reference, so if a misbehaving component keeps this strong reference around, having passed a weak reference was pointless. For use cases

Re: What is the status of Weak References?

2013-02-02 Thread David Bruant
Le 02/02/2013 15:32, Tom Van Cutsem a écrit : 2013/2/2 David Bruant bruan...@gmail.com mailto:bruan...@gmail.com About weakrefs, I've read a little bit [2][3] and I'm puzzled by one thing: the return value of get is a strong reference, so if a misbehaving component keeps this strong

Re: What is the status of Weak References?

2013-02-02 Thread Brendan Eich
David Bruant wrote: Interestingly, revocable proxies require their creator to think to the lifecycle of the object to the point where they know when the object shouldn't be used anymore by whoever they shared the proxy with. I feel this is the exact same reflections that is needed to

Re: What is the status of Weak References?

2013-02-02 Thread David Bruant
Le 02/02/2013 20:02, Brendan Eich a écrit : David Bruant wrote: Interestingly, revocable proxies require their creator to think to the lifecycle of the object to the point where they know when the object shouldn't be used anymore by whoever they shared the proxy with. I feel this is the exact

Re: What is the status of Weak References?

2013-02-02 Thread Kevin Gadd
I'd like to repeat something I wrote in another message: ...a very important point that most developers ignore or forget. GC is an undecidable problem, meaning that there will always be cases where a human being needs to figure out when in the object lifecycle it is not longer needed and

Re: What is the status of Weak References?

2013-02-02 Thread Brendan Eich
David Bruant wrote: A view knows own its lifecycle, it involves adding observers in a bunch of places. When the view lifecycle comes to an end for whatever reason, it only makes sense that it removes the observers it added. The problem is that the notification comes from a model object to the

Re: What is the status of Weak References?

2013-02-02 Thread Brandon Benvie
Some people would say that garbage collection is the most important advancement in computer science in the last 20 years http://www.codinghorror.com/blog/2009/01/die-you-gravy-sucking-pig-dog.html On Sat, Feb 2, 2013 at 4:16 PM, David Bruant bruan...@gmail.com wrote: Le 02/02/2013 20:02,

Re: What is the status of Weak References?

2013-02-01 Thread David Bruant
Le 31/01/2013 22:48, Kevin Gadd a écrit : I ask this because the lack of weak references (or any suitable substitute mechanism) comes up regularly when dealing with the challenge of porting native apps to JavaScript, and it leads people to consider extremely elaborate workarounds just to build

Re: What is the status of Weak References?

2013-02-01 Thread Kevin Gadd
On Fri, Feb 1, 2013 at 2:06 AM, David Bruant bruan...@gmail.com wrote: I don't understand the connection between the lack of weak references and emulating a heap in a typed array. For an algorithm that needs weak references to be correct, the only way to implement that algorithm in JavaScript

Re: What is the status of Weak References?

2013-02-01 Thread David Bruant
Le 01/02/2013 12:21, Kevin Gadd a écrit : On Fri, Feb 1, 2013 at 2:06 AM, David Bruant bruan...@gmail.com wrote: I don't understand the connection between the lack of weak references and emulating a heap in a typed array. For an algorithm that needs weak references to be correct, the only way

Re: What is the status of Weak References?

2013-02-01 Thread Brandon Benvie
Indeed, and Continuum uses the same strategy for implementing WeakMap currently. To my knowledge, the circumstances that makes that implementation of WeakMap fail is unlikely to arise except in the case of a membrane. As a polyfill provided to developers devloping with ES5 as a target, this is

Re: What is the status of Weak References?

2013-02-01 Thread Brandon Benvie
And by fail I mean result in a set of objects that next gets collected by the GC correctly despite being otherwise fit to be collected. On Fri, Feb 1, 2013 at 10:12 AM, Brandon Benvie bran...@brandonbenvie.comwrote: Indeed, and Continuum uses the same strategy for implementing WeakMap

RE: What is the status of Weak References?

2013-02-01 Thread Nathan Wall
David Bruant wrote: David Bruant wrote: Garbage collectors have evolved and cycles aren't an issue any longer, weak references or not. Kevin Gadd wrote: Cycles are absolutely an issue, specifically because JS applications can interact with systems that are not wholly managed by the

Re: What is the status of Weak References?

2013-01-31 Thread Tab Atkins Jr.
On Thu, Jan 31, 2013 at 1:48 PM, Kevin Gadd kevin.g...@gmail.com wrote: A search shows some old discussions of the topic mentioning that they might be going in to future versions of the language, etc. But on the other hand I've been told in response to this question before that TC39 has a

Re: What is the status of Weak References?

2013-01-31 Thread Erik Arvidsson
We have yet to find a solution that does not leak information between two actors that are not supposed to be able to communicate. At this point we have a lot of important work to do for ES6 and until someone comes up with a solution to the security issues WeakRefs are postponed. I'm not an expert

Re: What is the status of Weak References?

2013-01-31 Thread Kevin Gadd
Thank you for the detailed explanation of the information leak - I had never seen an explanation of why GC visibility creates an issue. Is there a page on the wiki somewhere that explains why information leaks are such a huge concern in JavaScript? I've never been under the impression that it is

Re: What is the status of Weak References?

2013-01-31 Thread Rick Waldron
On Thu, Jan 31, 2013 at 4:48 PM, Kevin Gadd kevin.g...@gmail.com wrote: A search shows some old discussions of the topic mentioning that they might be going in to future versions of the language, etc. But on the other hand I've been told in response to this question before that TC39 has a

Re: What is the status of Weak References?

2013-01-31 Thread Mark S. Miller
Earlier today I discussed with Arv an approach for doing WeakRefs without compromising security. (FWIW, I also posted this in my message near the end of https://groups.google.com/forum/m/?fromgroups#!topic/nodejs/fV8MDpkBauw. Thanks to Rick for the pointer.) When a WeakRef from Realm A points at

Re: What is the status of Weak References?

2013-01-31 Thread Mark Miller
Hi Tab, not quite. WeakMaps and WeakRefs address mostly disjoint use cases. WeakRefs cannot be used to fully emulate the GC virtues of WeakMaps on the one hand, and WeakMaps cannot be used to make an object accessible only until it is not *otherwise* referenced. We separated the two because the