I feel the word "coroutine" is slowly losing its original meaning, similar to what happened to "lambda".
I feel the word "coroutine" is slowly losing its original meaning, similar to what happened to "lambda".
Also don't get me wrong, meaning of words do change, I am grumpy about it but that's fine. Kinda feel weird to have people telling me it has always meant that.
These are stackful, symmetric coroutines with a build-in scheduler. It implements suspend and resume. You can call that a green thread if you want, or a fiber or whatever. They're coroutines.
The API docs make all of this clearer than the README. https://github.com/tidwall/neco/blob/main/docs/API.md
So a coroutine is basically something you can explicitly yield control flow from or give control flow to. neco doesn't really let you do that. Caller of neco_resume isn't relinquishing the control flow to another coroutine. neco_yield looks like a coroutine yield, but for asymmetric coroutine it should yield to caller, for symmetric coroutine it should let you specify who you are yielding to. This one does neither.
And I feel if you stretch the definition of coroutine to include this, then you can basically call most multitasking systems coroutines, rendering the concept mostly useless.
Although, deep in our hearts we all must know that lambda was already taken, it is an eigenvalue.