lua-users home
lua-l archive

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


On Oct 6, 2015 2:51 AM, "Sean Conner" <sean@conman.org> wrote:
>
> It was thus said that the Great Hisham once stated:
> > Hi! Congratulations on the release!
> >
> > On 4 October 2015 at 18:28, Alexandre Skyrme <askyrme@inf.puc-rio.br> wrote:
> > >>
> > >> luaproc is a concurrency library for Lua, it allows multiple independent
> > >> execution flows of Lua code (Lua processes) to be executed in parallel.
> >
> > What versions of Lua are supported? It would be nice to have it in the
> > announcement/README.
> >
> > >> It is available at:
> > >>
> > >>   https://github.com/askyrme/luaproc
> > >>
> > >> This is version 1.0-4. It supports Lua processes as arguments to create
> > >> new Lua processes - previously it only supported Lua code strings - and
> > >> fixes a few bugs.
> > >
> > > Sorry, the last paragraph should have read:
> > >
> > > This is version 1.0-4. It supports Lua **functions*** as arguments to
> > > create new Lua processes - previously it only supported Lua code strings -
> > > and fixes a few bugs.
> >
> > What happens when functions have upvalues?
> >
> > And, on a tightly related note, do you have any recommendation for
> > serialization libraries? From this discussion on lua-l [1] there seem
> > to be a number of options, apparently including ones that serialize
> > upvalues.
> > [1] http://lua-users.org/lists/lua-l/2015-08/msg00082.html
>
>   Ah yes.  I haven't made any progress since posting, due to lack of need.
> But I do have some notes:
>
> function
>         See below.  Problems include C functions without a usable name.
>
> userdata
>         lightuserdata   - error
>         userdata - insanely ugly.  Use callbacks to handle.
>         (example: FILE*)
>
> thread
>         error, not currently possible.
>
> table
>         Due to Lua semantics (since you can mix an array with non-integer
>         indicies), convert to MAP
>
>   It'll take me a few days to get the code up somewhere if anyone is
> interested in what I have so far.
>
>   -spc
>
>
I think you could use a __serialize metamethod here, when you don't have a built-in handler. Then userdata, magic tables and other objects could define handlers as easily as they do other metamethods.