lua-users home
lua-l archive

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


On Mon, Aug 13, 2012 at 10:17 PM, Thijs Schreijer
<thijs@thijsschreijer.nl> wrote:

> Maybe my DarkSideSync (DSS) library can help? Its a Lua library, that
> provides async thread support for Lua.
>
> The goal is to make it easier to write multi-platform bindings for
> multi-platform libraries. In my own use case, my binding for the (multi
> threaded, multi platform) pupnp library does not have any platform dependent
> code at all as that is all provided by DSS.
> Unfortunately the wrappers for socket, mutex and semaphore/waithandle only
> have the windows code ready as I haven't finished it yet. Posixs/pthreads
> will be next, so if Haiku is compliant with those it shouldn't be very hard
> to fix.
>
> DSS provides a queue for incoming threads/data. It can support just data
> delivery (incoming thread won't be blocked), or return results from Lua
> (incoming thread will be blocked until Lua posts the results).
>
> Writing this of my phone, hence no direct links, but google for darksidesync
> + github and it will pop up.
> Look for;
> - darksidesync_api.h
> - darksidesync_aux.c (not sure about this one...)
> Additionally google for LuaUPnP + github for a sample use
> Look for;
> - callback.c
> The last 3 (one not implemented) callbacks are blocking, waiting for Lua
> results, the others are delivery only.
>
> It works by storing a predefined struct, containing the dss-api, as a
> userdata in the registry, any other c library can collect it there and call
> its functions. Check the mentioned darksidesync_aux.c file, which is
> intended for use in client libraries (like in LuaUPnP), how it collects and
> uses the api struct.
>
> Thijs
> --
> This email was send from the poolside on a Tuscan hilltop

That may help. However, IMHO, at this early stage, the most important
thing for making Lua usable in Haiku would be to finish the
libcharlemagne project [1] which was discontinued and left unfinished.
In short, what we really need is someone who completes
libcharlemagne's object wrapping around the Haiku API. The project is
hosted in git [2].
For an early report of how how the project was coming along nicely,
although at the initial stage, see [3].

At least one of Haiku's developers showed interest in libcharlemagne,
but he was apparently held back by more urgent priorities (developing
Haiku itself). So, at least in the short term, I think we should not
expect Lua support in Haiku to "just come along" as the Haiku platform
is being developed. Not in the short term, it seems. That is, UNLESS
someone really picks up the challenge and starts working on
libcharlemagne (completing a discontinued project is probably easier
than starting a new one).
And that was the idea behind my post: an appeal to those Lua users who
would be potentially interested in Haiku. And there are lots of
reasons for being interested in Haiku!

So, anyone willing to step in and take up the libcharlemagne project?
Or at least do some bindings?

[1] http://darkwyrm-haiku.blogspot.it/2011/02/libcharlemagne-lua-and-haiku.html
[2] https://github.com/darkwyrm/libcharlemagne
[3] http://darkwyrm-haiku.blogspot.it/2011/06/haiku-meet-lua-lua-haiku.html