Mark S. Miller (2013-11-07T02:54:32.000Z)
On Wed, Nov 6, 2013 at 3:23 PM, Oliver Hunt <oliver at apple.com> wrote:

> On Nov 6, 2013, at 3:14 PM, Rick Waldron <waldron.rick at gmail.com> wrote:
>
>
> On Wed, Nov 6, 2013 at 2:15 PM, Domenic Denicola <
> domenic at domenicdenicola.com> wrote:
>
>> Thanks Mark for the education, especially on the pre- vs. post-morterm
>> finalization distinction. I don't think I was specifically advocating for
>> pre-mortem in my OP, since I didn't really understand the difference :P.
>> Post-mortem finalization sounds quite reasonable. What do people think of
>> introducing it into ECMAScript?
>>
>
> This may be a naïve question, but how would the handler know which
> object/weakref had been gc'ed?
>
> You wouldn’t :)
>
> I’m kind of anti-finalisers in JS for all of the reasons people have
> raised - they are extremely hazardous, expose non-deterministic behaviour,
> etc
>
> Given our general desire to avoid exposing internal GC semantics, and the
> difficulty in defining observable GC behaviour (I suspect this would be a
> non-starter in any case), I can’t see any specification that would allow
> useful finalisers or WeakRefs.
>
> If MarkM has an idea for WeakRefs that don’t leak observable GC behaviour
> i’d love to hear,
>

I don't. I don't believe such a thing is possible, almost by definition.
That's why I initially proposed separating the WeakMap and WeakRef
concepts, because the first provides some of the benefits of weakness
without this exposure.



> but in general i’m opposed to both them and finalisers :-/
>

They go together anyway. I am for both of them in ES7, because they have
large benefits and we now have an idea (previously posted to the list) of
how to retain the portion of these benefits that matter, while limiting the
leakage in ways that let us still build secure systems and reason about
their security.

More later...


> —Oliver
>
> Rick
>
> _______________________________________________
> es-discuss mailing list
> es-discuss at mozilla.org
> https://mail.mozilla.org/listinfo/es-discuss
>
>
>


-- 
    Cheers,
    --MarkM
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20131106/98f7a29f/attachment.html>
domenic at domenicdenicola.com (2013-11-17T17:48:48.979Z)
On Wed, Nov 6, 2013 at 3:23 PM, Oliver Hunt <oliver at apple.com> wrote:

> If MarkM has an idea for WeakRefs that don’t leak observable GC behaviour
> i’d love to hear,

I don't. I don't believe such a thing is possible, almost by definition.
That's why I initially proposed separating the WeakMap and WeakRef
concepts, because the first provides some of the benefits of weakness
without this exposure.



> but in general i’m opposed to both them and finalisers :-/

They go together anyway. I am for both of them in ES7, because they have
large benefits and we now have an idea (previously posted to the list) of
how to retain the portion of these benefits that matter, while limiting the
leakage in ways that let us still build secure systems and reason about
their security.

More later...