News for hackers. Stuff that matters.
Re:ProtoThreads: Lightweight, Stackless Threads in C by banachtarski on Sunday September 22, 2019 @11:39PM (#21045747)
How so? The decision between a stackful and a stackless coroutine is precisely that, a decision. The tradeoff is that storing all registers/stack variables and processor state before a yield and restoring it after a resume is a non-trivial cost. For some applications, that cost may not matter, but for others, it may be critical.

Also, this is less like a goto, and more like a setjmp/longjmp.

Re:ProtoThreads: Lightweight, Stackless Threads in C by Ericson2314 on Monday September 23, 2019 @02:27PM (#21051914)
A stack is an over approximation of the closure of the continuation.

You want something to create a union of all the relevant local variables of each state. Doing this efficiently is non compositional and so requires language support.