[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Mike Pall's standalone FFI: a dream?
- From: Miles Bader <miles@...>
- Date: Mon, 06 Jun 2011 14:31:23 +0900
Axel Kittenberger <email@example.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.
Liberty, n. One of imagination's most precious possessions.