Nicolas Cannasse wrote:
Yes, that would be possible.
So do you think it would be desirable to have coroutines at hte VM level? I see this dilemma with VM-level coroutines: If you implement them as Lua does, with only a VM stack per coroutine, then the implementation is portable and has low memory usage per coroutine but can't be used with JIT; but if you implement them as LuaJIT and the Io language do, with a CPU-level stack per coroutine, then this requires platform-specific magic and (I think) has higher memory usage per coroutine. By implementing coroutines in a higher-level compiler and a runtime library, as JavaScript Strands does, this dilemma would be avoided. Maybe haXe could have optional coroutines; I would make this an option configurable at compile time, because coroutines as implemented by JS Strands would probably introduce unacceptable overhead in some cases.
Matt -- Neko : One VM to run them all (http://nekovm.org)
