By LuaJIT Extensions, I mean the extensions to the core language including jit, ffi and the lua 5.2 extensions. <http://luajit.org/extensions.html>
As far as loading shared libraries, both lua's require and luvit's require allow this. Luvit's require can even load shared libraries from out of the zip asset bundle. See <https://github.com/luvit/lit/wiki/Publishing-Compiled-Code> for details on the various techniques for working with binary addons in luvit/lit. Unqlite looks really cool. My recommendation (unless it uses C callbacks) is to build the raw C library as a .so and include it with your app and use ffi to call the C API from lua. The luajit FFI is much faster than C API bindings since it's core to the jit engine and allows the jit optimizer to make more assumptions. The other thing to watch out for when adding a C library is blocking I/O. LibUV (luvit's I/O engine) uses a single-threaded non-blocking event loop. If some other code calls blocking C calls, your entire event loop will halt while it's blocked. -Tim Caswell On Tue, Oct 27, 2015 at 8:13 AM, develephant <[email protected]> wrote: > Hi, > > I have a compiled .so and would like to add it to along with my Luvi > project. In the docs it states that Luvi allows the use of LuaJIT > extensions. Does this include the FFI lib as well? > > The issue I'm having is getting Luvi to recognize the .so in my directory > structure. Is there a specific place I should put it? > > There is a LuaJIT binding already, and I have successfully used this in a > straight LuaJIT project. (unqlite.org) and ( > https://bitbucket.org/sirpengi/luajit-unqlite) > > Any tips appreciated. > > Cheers. > > -- > You received this message because you are subscribed to the Google Groups > "luvit" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "luvit" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
