es-discuss Digest, Vol 41, Issue 9
lmeyerov at gmail.com
Sun Jul 4 04:37:35 PDT 2010
>> ... then I still don't see how to do an encoding of weak references that isn't invasive (e.g., adding in a user-level GC that constructors are somehow guaranteed to go through). For a non-invasive approach, there might be probablistic guarantees achieved by API restrictions (e.g., limit the number of bad guesses of IDs for the otherwise forgeable ID->object function) or a creative use of lexically scoped regions, but I'm skeptical of anything complicated like that.
> I don't see the connection. We're talking about Ephemeron (Tables) as primitives in the language. The GC definitely has to know about them. Likewise for hashcode: if the object's address is one-way hashed to the hashcode() result, but the GC moves the object, then the object will need to grow a field to store its invariant hashcode.
Ah, I was confused by the use of bootstrap in "Could we bootstrap Set, Map, and WeakMap and call it enough?" ; I thought you meant a user-level encoding of these given language-level hashes etc.
Found the table proposal.. without iteration (and assuming no weak ptrs), one of my main use cases (data flow constructs), is still restricted. Given other proposals like object hashing, I'm not sure how much of a win these tables are. If the reason they're not there is non-determinism, weak ptrs would make this a non-issue. Furthermore, I suspect numerics already introduce non-deterministism and embeddings of JS push most programs towards it as well (browsers, servers, games), so purism would be a Quixotian goal. Assuaging some concerns, iteration can be phrased as a capability (and thus disabled) and not made generic (preventing unintended encountering such as preventing it from hitting generic for-in sugar).
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the es-discuss