Mark Shannon wrote:
In summary, the cofunction proposal is a work-around for a limitation in the VM. By fixing the VM we can have proper coroutines. Surely, it is better to make the VM support the features we want/need rather than bend those features to fit the VM?
The original version of Stackless worked by "flattening" the interpreter the way you suggest, but it was considered far too big an upheaval to consider incorporating into CPython, especially since a lot of extension code would also have to have been rewritten to make it coroutine-friendly.