v_y
v_y

Reputation: 325

Does compiling to javascript preclude dart adding weak references?

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

Answers (2)

Ladicek
Ladicek

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

SLaks
SLaks

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

Related Questions