lua-users home
lua-l archive

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


Alex Bradbury wrote:
> Do you envisage that this same FFI interface could be provided for
> standard Lua for compatibility reasons?

Unlikely. It's tightly integrated into the VM, esp. the garbage
collector.

> It's significantly easier to port an FFI to
> another platform than to port LuaJIT (judging by libffi at least, I'm
> not sure what your FFI includes)

Oooh, don't get me started about FFI portability. You'd think that
writing a C parser is tough, but the real challenge was handling
all the little platform differences (packed structs with aligned
members and bitfields, anyone?).

And I haven't even implemented the plethora of calling conventions
yet ... the first release of the FFI will only allow you to create
and use native data structures, but not call C functions (yet).
Already quite useful and helps on benchmarks, too. ;-)

> [...] so those on platforms where LuaJIT is not supported [...]

I'm sure this will be resolved over time. After x86/x64, PPC, ARM
and MIPS -- what's left? And I mean platforms suitable for a
dynamic language with a JIT compiler _and_ with some outlook for
the future plus a market share to speak of.

[Platforms which prohibit runtime code-generation can still
benefit from the faster LuaJIT interpreter. E.g. the PPC/e500 port
of the LuaJIT interpreter is complete now. It outruns the Lua
interpreter by a factor of 2x - 4x and in some cases up to 6x.
The sponsor is rather happy with this performance.]

--Mike