lua-users home
lua-l archive

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

On Sun, Jan 3, 2010 at 1:50 PM, Mike Pall <> wrote:
Peter Kümmel wrote:
> What's the status of CoCo? Looking into 'test'
> there is not even one test for the C-API.

The patched Lua core makes use of the C API extensions. Thus the
Lua tests exercise the C API, too. And there's really not much of
an API -- lua_yield() just behaves differently.

> Anyway, after googling for C/C++ and coroutines I wonder
> if LuaCoCo's C-part is maybe the matured, fasted, and
> most competent supported C-code which could be used as
> starting point for a cross-platform coroutine C-library.

You'll find more C libraries when looking for lightweight threads,
e.g. GNU Pth. But you have to realize it's a niche product. Most
of these libraries have grown out of the needs of a single app.
Similarly, CoCo has been targeted for Lua only.

> Am I right that it is trivial to remove Lua-specific
> code from lcoco.h/.c, and to split out the C-only part?

Yes, it's not that hard.

> What else is missing to get a cross-platform C-library?

That depends on the use cases you're aiming for. You can either
look what features the other libraries support. Or you can look at
apps or languages using such a library and see what features they
need. The latter usually works out better ...

> Seems most people create their own solution due to the
> lack of a widely used coroutine library?

Yes, IMHO they are either too bloated or too limited. Good luck
finding a balance. :-)

I don't know where this fits in the scales, but it's interesting: