es-discuss Digest, Vol 43, Issue 1
lmeyerov at gmail.com
Thu Sep 2 01:00:00 PDT 2010
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.
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.
More information about the es-discuss