[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: cgit-lua: to jit or not to jit
- From: William Ahern <william@...>
- Date: Mon, 13 Jan 2014 18:43:55 -0800
On Tue, Jan 14, 2014 at 03:22:29AM +0100, Jason A. Donenfeld wrote:
> On Tue, Jan 14, 2014 at 3:12 AM, Tim Hill <drtimhill@gmail.com> wrote:
> > LuaJIT is currently compatible with Lua 5.1, not 5.2 or the upcoming 5.3, and my understanding is the LuaJIT project has now forked from mainstream Lua and will not be staying in sync with anything past 5.1, so I would expect over time the two to diverge.
>
> AFAIK, LuaJIT supports 5.2 currently via the
> -DLUAJIT_ENABLE_LUA52COMPA flag and mentions it here
But it doesn't implement all of Lua 5.2. For example, LuaJIT with 5.2
compatability doesn't have ephemeron tables or _ENV.
Ephemeron tables are a pretty huge feature for things like caches or
self-referential anchors. Obviously you can implement those things without
ephemeron tables, but they require explicit memory management techniques.
Although I think the time complexity for ephemerons is pretty horrendous, so
you have to be careful.
Also, LuaJIT doesn't allow things like creating your own FILE* pointer
object from C, which sucks when you want to use POSIX APIs like fmemopen to
wrap a byte buffer in a FILE object. Or interfaces like funopen on *BSD or
fopencookie on Linux, which allow you to craft your own FILE object
completely from scratch.