lua-users home
lua-l archive

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


Axel Kittenberger <axkibe@gmail.com> writes:
> However the conlusion back then was, if you need to press out the
> latest bit of speed, go FFI and forget about vanilla. If you don't
> want to do that, forget about the FFI and write classical C bindings,
> you don't throw that much performance out of the window, since LuaJIT
> still works nicely with vanilla bindings as well.

There's a more nuanced possibility though:  Use the FFI C-parser to
_automatically_ produce classical C bindings in the pure Lua case (but
use FFI when on Luajit).

This restricts you compared to pure FFI (in the pure-Lua case, the above
build process must be at "compile/install time", not at runtime like
FFI), but for many common scenarios it could give much of the
convenience of FFI while still remaining portable.

-Miles

-- 
Liberty, n. One of imagination's most precious possessions.