I replied on Hacker News with my feelings (as a TC39 member) about what's happening with promise cancellation: https://news.ycombinator.com/item?id=13214487 …
-
-
Definitely helped to ease into things. Our first cut was "ambient cancellation" using a scope object but it caused many headaches.
-
In hindsight, cancelable objects as a pattern should have been used more pervasively. Quickly gets out of control even w/ overloads.
-
Even w/cancelable objects, however, we typically kept the authority to cancel a distinct capability. E.g. (resolve, reject, cancel).
-
I often wondered if implicit parameters could help. But major language implications compared to overloads. https://www.scala-lang.org/blog/2016/12/07/implicit-function-types.html …
-
I'm personally a fan of using an implicit parameter here and special call syntax (task foo()). I should propose it for real.
-
async function isn't a minor detail in a language. It finishes the story of an async-IO-only language.
-
interesting thing about cancellation is that there's already a place to hook the implicit token param most of the time (await)
-
you just need new syntax to kick off the chain, and you can have `task` produce a tuple of (Promise, CT) w/o leaking everywhere
- 7 more replies
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.