Re: [JS-internals] Weak references

2013-11-01 Thread Jason Orendorff
On 11/1/13 1:52 PM, David Bruant wrote: > In any case, I've stopped being against weakrefs after a message by > Mark Miller[...] I am now going to try to convince you that you shouldn't have been convinced by this use case. :) > To keep the object granularity across machines, in E, they've created

Re: [JS-internals] Weak references

2013-11-01 Thread Terrence Cole
On 11/01/2013 08:26 AM, Jason Orendorff wrote: > This proposal is before TC39 for inclusion in the next ECMAScript spec > edition following ES6: > http://wiki.ecmascript.org/doku.php?id=strawman:weak_references > > Mozilla GC hackers are opposed, for reasons they can articulate; I'm > opposed be

Re: [JS-internals] Weak references

2013-11-01 Thread Andrew McCreight
- Original Message - > Why so? > > function f(e){} > > (function(){ > var iframe = document.getElementByTagName('iframe')[0]; > iframe.addEventListener('someEvent', f); > })() > > In this case, f doesn't hold a reference to anything besides itself, not >

Re: [JS-internals] Weak references

2013-11-01 Thread Steve Fink
On 11/01/2013 11:52 AM, David Bruant wrote: > That requires weakrefs in some way, I'm afraid. I'm interested if > other solutions can be proposed to achieve object-granularity > communication across machines (I'm sure Mark Miller will be interested > as well). > Good use case. What if you had a se

Re: [JS-internals] Weak references

2013-11-01 Thread Boris Zbarsky
On 11/1/13 3:10 PM, David Bruant wrote: Why so? function f(e){} (function(){ var iframe = document.getElementByTagName('iframe')[0]; iframe.addEventListener('someEvent', f); })() This is very fragile. It assumes that nowhere up the scopes that f is closing o

Re: [JS-internals] Weak references

2013-11-01 Thread David Bruant
Le 01/11/2013 19:34, Andrew McCreight a écrit : 3. Finally, though I'm generally opposed to weak references, as they are complex to implement, I do understand that there's a need for them. When working on the leaks in bug 893012, to fix some of the individual leaks, like bug 894147, we had to

Re: [JS-internals] Weak references

2013-11-01 Thread David Bruant
[sorry for previous early send error] Hi, Le 01/11/2013 16:26, Jason Orendorff a écrit : This proposal is before TC39 for inclusion in the next ECMAScript spec edition following ES6: http://wiki.ecmascript.org/doku.php?id=strawman:weak_references Mozilla GC hackers are opposed, for reasons

Re: [JS-internals] Weak references

2013-11-01 Thread Andrew McCreight
I have a few disjoint thoughts here. 1. Here's a link to a previous ES-discuss thread about somebody trying to create an exploit by combining observable weak references with conservative GC. https://mail.mozilla.org/pipermail/es-discuss/2013-March/029489.html I think the basic idea is that yo

Re: [JS-internals] Weak references

2013-11-01 Thread Steve Fink
On 11/01/2013 09:42 AM, Bobby Holley wrote: > From the proposal: > > Note that makeWeakRef is not safe for general access since it grants access >> to the non-determinism inherent in observing garbage collection. > > What does that mean? That they don't expect this to be exposed to the web? > In th

Re: [JS-internals] Weak references

2013-11-01 Thread David Bruant
Hi, Le 01/11/2013 17:42, Bobby Holley a écrit : From the proposal: Note that makeWeakRef is not safe for general access since it grants access to the non-determinism inherent in observing garbage collection. What does that mean? That they don't expect this to be exposed to the web? In tha

Re: [JS-internals] Weak references

2013-11-01 Thread Bobby Holley
>From the proposal: Note that makeWeakRef is not safe for general access since it grants access > to the non-determinism inherent in observing garbage collection. What does that mean? That they don't expect this to be exposed to the web? In that case, why bother speccing it, and why would we nee

[JS-internals] Weak references

2013-11-01 Thread Jason Orendorff
This proposal is before TC39 for inclusion in the next ECMAScript spec edition following ES6: http://wiki.ecmascript.org/doku.php?id=strawman:weak_references Mozilla GC hackers are opposed, for reasons they can articulate; I'm opposed because I can't stick the nondeterminism and because the tota