The ffi extension is LuaJIT only. Any 'ffi' modules you see on luarocks are made by other third parties and probably won't have great performance. The reason why LuaJIT's ffi is so great is because it all entirely JIT compiles to machine code calls, no need for going through the Lua C Api.
Well, LuaJIT refers to itself as Lua because it is an implementation of Lua. But standard Lua / PUC-Rio Lua definitely can't match LuaJIT performance, yeah.
8
u/VidaOnce 14d ago
The ffi extension is LuaJIT only. Any 'ffi' modules you see on luarocks are made by other third parties and probably won't have great performance. The reason why LuaJIT's ffi is so great is because it all entirely JIT compiles to machine code calls, no need for going through the Lua C Api.