Mark Miller (2015-06-17T13:41:06.000Z)
d at domenic.me (2015-07-07T01:39:05.868Z)
congratulations and THANK YOU! I learned something important reading your messages. The notion that we can preserve non-observability when making one thing a WeakMap iff we make all other WeakMaps be strong for those same objects is true, novel, and very surprising. I have been working on such concepts for decades and never come across anything like it. In this case, I suspect that implementers will continue to choose the memory leak rather than make WeakMap more complex in this way. But you have now given them a choice, which is great! The spec does not need to change to enable this choice. The spec is only about observable differences, and the space optimization you suggest would be unobservable. Your observation, being general, may find other applications even if it is not used to optimize this one. This observation is not language specific; it may well find application in other memory safe languages including those yet to be invented. You have added another tool to our toolbox. You have deepened our understanding of what is possible.