lua-users home
lua-l archive

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


steve donovan wrote:
> 2011/4/14 Pierre-Yves Gérardy <pygy79@gmail.com>:
> > This may have been asked earlier, but wouldn't it be useful to
> > translate (at least some of) the standard library into LuaJIT+FFI?
> 
> I believe Mike already handles 'builtin' functions pretty efficiently

Well, yes. The JIT compiler recognizes all of the standard library
functions. And it applies special optimizations to most of these.
But less performance-critical functions aren't compiled at all
(e.g. os.*). Some of those might benefit from being turned into
Lua code that calls C functions via the FFI. That would get them
compiled without the need for special treatment.

But there are two problems: the FFI is a) optional and b) only fast
if JIT compiled. So a no-FFI build or an interpreter-only build
needs fallback C code, anyway. That sort of foils the whole idea.

--Mike