lua-users home
lua-l archive

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

On Fri, Feb 15, 2013 at 5:36 PM, Hadriel Kaplan <> wrote:
> Howdy,
> Does anyone know of an open-source library one could use in an application to provide the underlying code
> for managing Lua scripts used as plugins?  I.e., to let a C/C++ application which uses Lua for "plugins"
> provide a list, search, and retrieve mechanisms for Lua plugins, from their application-providers site?
> Something like sparkle/winsparkle but cross-platform, and preferably without a GUI component?
> I guess basically like LuaRocks, but meant for C/C++ application integration.

I've worked for a while on making LuaRocks a little more "embeddable"
so you could use in scenarios like this. This is a feature I've been
aiming for version 2.1, but I was sidetracked into working on other
features during the last year.

The current WIP is in the "context-object" branch:

The main drawbacks in the current 2.0 design is that LR uses global
state (the idea for 2.1 would be to wrap this into a state table, the
"context object") and that there isn't a well-defined and stable
public API for programmatic control beyond calling run() on the
various luarocks.* modules which correspond to the luarocks commands.

In other words, if you were to use LR 2.0 as an embedded plugin
manager, you could launch a new lua_State for each operation and then
load the command's module and call its run() method There's probably
some initialization done by the luarocks.command_line module that
would have to be redone as well -- I've already refactored some of
this in the context-object branch.

If you're interested in it, cooperation on this front (coding, testing
and/or feedback) is most welcome.

-- Hisham