lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


> A couple of things here. I remember a few weeks back there was some active
> discussion about implementing coroutines in Lua. The topic sort of died
> down. I was curious how people have fared with this, and if anyone has any
> code to do it that they'd like to share. :)

Alas, one of them was me. For political as well as technical reasons (the
other developers are not so keen on using anything that isn't pure C++), the
project in which I was involved for which I was developing coroutines in Lua
is somewhat stalled.
Therefore I did not make much progress.
At the moment I have coroutines on top of which I built a very simple but
functional layer of light threads (a' la Python microthreads but much more
primitive) and it all works very smoothly.
I used hand-crafted bindings to the SDL library and I got in no time at all
a sprite manager to experiment with bouncing smileys :-)

One of these days, I promise, I'll package what I've done so far and post it
as-is (it's based on the 4.0 public beta and since I had to make changes in
the core routines devoted to GC those changes will have to be ported by
whomever wants to take over). Only tested on Win2k and possibly working on
Win98SE as well.
Hopefully the project will be revived one day, but I don't really mind
sharing these bits of work.
--
    WildHeart'2k (at home)