The current version of lua is 13 years old. Searching for why this is, I've found a discussion from 2011 where it was decided unnecessary: https://github.com/antirez/redis/issues/253

Eight years have passed since then, so I felt it appropriate we visit this again. Is there mass protest against moving to the latest version? I'm putting some thought into a VS Code debugger for Redis. Working with the latest version in my case makes the most sense.

Backwards compatibility aside, what are everyone's thoughts on this?

Comment From: neomantra

Personally, LuaJIT with its FFI and partial Lua 5.2 compatibility is much more interesting than the newer plain Lua versions. I worked really hard to get LuaJIT to work with Redis. I did all sorts of hacks (never committed) to make this work with stock Redis. but it's just plain hard to get around the fact that liblua is statically linked.

I bet if antirez were to implement Lua scripting again, he'd do it as a module (which didn't exist at the time). If it was a module, then you could pick whichever Lua version you wanted as they could easily be swapped out.

You are free to rebuild Redis yourself with a different version. I did that once upon a time on my luajit redis branch, but then it's harder to keep up with new Redis versions. And you're pretty isolated from the community.

If one could get that Redis LuaJIT module to work, then you could experiment with your ideas in #5810. You could probably implement that as a module with Redis' bundled Lua, but the thread management and I/O handling is much trickier.

I know it's not what you were asking for, but you might enjoy using OpenResty talking to Redis. The key with that lua-resty-redis API is that the network I/O is asynchronous, so you can have thousands of Lua scripts going simultaneously. It's close to what you asked for, just not interfaced with the Redis protocol.

Comment From: ccuser44

Yeah I think LuaJIT is definetly the best choice here. It has feature compatibility with newer Lua versions and is blazingly fast, and has FFI.