Lua has had excellent support for co-routines for a couple years, and, since its implementation is "stackless" (in the same sense as Stackless Python), its coroutines don't have the limitations as standard Python's. (It doesn't have a GIL either...) There are a couple papers about coroutines in Lua, but "Revisiting Coroutines" is the best overview. They're surprisingly versatile.
The paper shows how to efficiently implement one-shot continuations on asymmetric coroutines. (There is also a small C patch by Mike Pall that adds a coroutine.copy function to the VM, making multi-shot continuations possible: http://lua-users.org/lists/lua-l/2006-01/msg00652.html, and note the fix in his follow-up post.) Implementing continuations in terms of coroutines rather than the reverse (as is commonly done in Scheme) often leads to clearer code, IMHO.
Lua has had excellent support for co-routines for a couple years, and, since its implementation is "stackless" (in the same sense as Stackless Python), its coroutines don't have the limitations as standard Python's. (It doesn't have a GIL either...) There are a couple papers about coroutines in Lua, but "Revisiting Coroutines" is the best overview. They're surprisingly versatile.
The paper shows how to efficiently implement one-shot continuations on asymmetric coroutines. (There is also a small C patch by Mike Pall that adds a coroutine.copy function to the VM, making multi-shot continuations possible: http://lua-users.org/lists/lua-l/2006-01/msg00652.html, and note the fix in his follow-up post.) Implementing continuations in terms of coroutines rather than the reverse (as is commonly done in Scheme) often leads to clearer code, IMHO.