If you look at the performance numbers of these approaches, you'll see why stackless coroutines are desired.
If you look at the performance numbers of these approaches, you'll see why stackless coroutines are desired.
But as you might be able to tell from their APIs, you still have to allocate stacks somehow.
I also want the ability to convert internal iterators to internal iterators with no overhead and even (especially) if the internal iteration function has not been specifically marked (i.e. no red/blue functions).
Hey, a man can dream.
You are literally describing stackless coroutines. And the generator state transform is that optimization.
If you want to get this without using generators explicitly, it's still stackless coroutines just not how Rust supports stackless coroutines. There was some discussion about making it more implicit but no progress was made in the implicit direction.