-
-
Notifications
You must be signed in to change notification settings - Fork 100
Open
Labels
Description
Currently clojure functions compile to either classes or functions.
Here I propose we get rid of emitting Dart functions and always compile to classes because:
- Dart overcaptures Dart VM closures are not safe-for-space (share the same context if defined within the same scope - leading to overcapturing) dart-lang/sdk#36983
- it would simplify the compiler, the generated code (we wouldn't need to consider Function on the fast path -- Functions would remain callable) and the mental mode
However the compiler would keep the special case that when it statically determines something in function position to be a Function, it will invoke it with no overhead.
We should double-down on magicasting to Function (we need to anyway)