Saem Ghani

Results 186 comments of Saem Ghani

This is going to need a bigger rethink. 🎉 If someone wants to take over this issue in the meantime, just ping here and feel free to start.

The wikipedia article on [coroutines](https://en.wikipedia.org/wiki/Coroutine#Definition_and_types) does a good job outlining the design space. Except for stackfull vs stackless, where the decision is sorta made for us (it's stackless), symmetric vs...

> > * `call vs pass/yield`: how do we call (pass control with the expectation of control coming back) vs yield/pass to (transfer control with no expectation of getting control...

> Is this thread about coroutines or is it about something else which is currently named `coroutine`? Fair point, they really look like coroutines, and if we get them symmetric...

> Regarding the interface, I've been thinking about whether implicit coroutine constructors should be removed. At the moment, the signature of a coroutine describes the constructor, not the coroutine itself...

I'll take a peek at Zig, they were focused on async/await, but they did address running the same routine in cooperative mode or simply linearly with blocking. Maybe there are...

> * the name "coroutine" would be more fitting (in their present shape, @saem suggested that "suspendable procedure" might be a better name for coroutines) I think this is a...

> According to this meaning, I'd say that the current `cgen` behaviour is correct. However, I'm not sure whether that's good and/or useful. In case it is, `type T {.importc:...

> While less broadly applicable, `suspend` will still be useful, and further development of the language + compiler improvements might make it possible to lift the restriction again. Something to...

tests seem to pass locally, just doing a quick check here.