es-discuss Digest, Vol 43, Issue 1

Erik Corry erik.corry at gmail.com
Thu Sep 2 01:51:04 PDT 2010


2010/9/2 Leo Meyerovich <lmeyerov at gmail.com>:
>
> On Sep 2, 2010, at 12:29 AM, Brendan Eich wrote:
>
>> On Sep 2, 2010, at 12:08 AM, Leo Meyerovich wrote:
>>
>>> That said, going back to the beginning: deterministic GC-independent semantics are a Good Thing. Whether this matters seems to be a crucial discussion. Is there a concern for basic correctness for more mundane code? Are those use cases similar to the above where a 'strictness' library suffices? Again, I'd point to the ActionScript experience for a reference: can anybody attack or break a flash program with weak maps, or is this FUD? I'm more concerned about the dangers of misuse in terms of memory leaks and event-oriented logic glitches between code running on different ES implementations (and suspect the answer has a reasonable chance of being 'yes' for these).
>>
>> I tend to agree that the answer is 'yes', assuming the question was "Whether [deterministic GC-independent semantics] matters" ;-).
>>
>
>
> Leaving how in question -- e.g., achievable with a simple library toggle -- and whether it *always* matters (such as for those would want the enumeration ability and could arguably contain the non-determinism).
>
>
>> It's hard to make an airtight case for "security" even on a good day, but removing observability from the weak maps proposal makes it strictly simpler and less likely to cause any number of problems. I don't believe that lack of enumerability and .length cripples the API for the intended use cases of soft fields, membrane caches, and the like.
>>
>> /be
>>
>
> There are use cases for enumeration like proper native GC in data flow abstractions and it seems others that have piped up with their own uses. Obviously, different people on this list have presented different use cases for weak maps and it seems those two exact scenarios it. I'd be curious about further ones for enumeration  (which I suspect surface in proper implementations of various event-oriented abstractions) and weak maps in general -- it may be we're the only ones who care and only those two scenarios are important to the committee members ;-) For example, the ability to trigger a purge might matter for reliability in some uses (which I'd suspect for certain transient resource pools), even if it's a no-op wrt JS semantics.

I would strongly oppose any way to trigger a full garbage collection
from JavaScript.  Experience from the Java world shows that it is
inevitably abused with very serious performance consequences.

Note the mealy description here with words like "suggests" and "best
effort" http://download.oracle.com/javase/1.5.0/docs/api/java/lang/System.html#gc()

There is even a command line option on some VMs to disable this call
and turn it into a noop.

So please no.

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


More information about the es-discuss mailing list