Reputation: 325
I'm disappointed that dart doesn't feature weak references.
Is there something about compiling to a language which doesn't offer weak references which makes it impossible?
Upvotes: 0
Views: 241
Reputation: 6597
Dart wants to compile to performant JavaScript. That's why it needs to skip certain features (tail calls, for example). And I'd even argue that weak references are a bad idea anyway.
Upvotes: 1
Reputation: 887997
Yes.
In order to support weak references, you need a way to interact with or override the GC.
That is fundamentally impossible in Javascript.
Upvotes: 1