|
|
|
|
|
by codethief
777 days ago
|
|
Just noticed your comment now: Thanks so much for the explanation! However, my question was more about the blog post in particular, i.e. coroutines (async/await) vs. effect handlers: I still fail to see why coroutines are lexically scoped. async/await yield control back to the calling function which might or might not define an event loop or yield control to another function further up the stack. How is this different from handling effects or exceptions? Whose scope does "lexically scoped" refer to here? EDIT: Ah, reading this comment[0], > The more fundamental difference between effects and coroutines is that a `yield` in a coroutine always goes to the one unique resumer maybe I thought too much of Python where async/await are implemented via generators and, unless I'm mistaken, there need not be a unique resumer/event loop. [0]: https://news.ycombinator.com/item?id=40108636 |
|