> > > LuaJIT has defined luaL_newlib() which Lua 5.1 hasn't. However,
> > > LuaJIT identifies itself as Lua 5.1. Hence, make luaL_newlib()
> > > definition conditional.
> > >
> > > Also introduce LuaJIT / Lua 5.1 compatibility for
> > > luaL_checkversion() and
> > > lua_rawlen().
> > >
> > > Signed-off-by: Christian Storm <
christi...@siemens.com>
> >
> > There is no problem to merge this, and I'll do. Anyway, I am asking if
> > it makes sense to try to remain compatible with LuaJIT, when this
> > project seems dead and it is still fixed to Lua5.1.
> I wouldn't say having a project fixed to Lua5.1 means it's dead as it seems
> rather common for projects to freeze the Lua ABI, for example redis does
> this with their embedded Lua5.1.
It's not that dead anymore, see
https://github.com/LuaJIT/LuaJIT with
lots of recent activity. I guess LuaJIT 2.1 is about to be pushed out
eventually/finally. LuaJIT is actually a hybrid between Lua 5.1 and Lua
5.2 with some stuff from 5.2 but identifying itself as 5.1. This is why
it needs some special treatment for the 5.2 "backports"...
> > SWUpdate integrates itself the Lua interpreter, and this is updated (in
> > OE) form version to version. It is not very important that an update
> > must be very fast, it must be reliable, and the advantages to run a Lua
> > Script inside SWUpdate with the JIT compiler...well, I think they are
> > negligible.
> >
> > So as I said, I will merge this: but does it makes sense to maintain
> > compatibility to LuaJIT ? Are there use cases ?
> I can think of one for the buildroot case, currently buildroot only supports
> a single Lua interpreter at any one time, so if another package being
> built depends on LuaJIT swupdate can only be built with LuaJIT, at
> least without first adding support for multiple Lua interpreters.
This also applies to having multiple liblua{,jit}.so files lying around
for no good reason if you're bound to use LuaJIT for some particular use
case. I do agree that "JIT speed" is probably not the primary target for
SWUpdate's Lua usage. However, we do have a use case of using LuaJIT for
speed-sensitive workloads and then it's suggestive to also use it for
SWUpdate.
That said, I do think that keeping LuaJIT compatibility is not a lot
more effort on top than keeping Lua 5.1 compatibility. Granted, the most
testing and usage goes to the latest and greatest Lua versions (due to
OE version bumps) leaving older Lua versions (or LuaJIT for that matter)
a bit behind.
So as long as we do support Lua 5.1, I'm in favor of keeping LuaJIT
support as well ― within reasonable efforts ― even if it's not as well
supported as the latest and greatest Lua versions.
Kind regards,
Christian
--
Dr. Christian Storm
Siemens AG, Corporate Technology, CT RDA IOT SES-DE
Otto-Hahn-Ring 6, 81739 München, Germany