4 ms·
Is it using LuaJIT or any another ffi library?
by atilimcetin 15y ago
Is it using LuaJIT or any another ffi library?
- dubya 15y agoI know exactly zero Lua, but if ffi == nil then ffi = require("ffi") end is suggestive.
- gregholmberg 15y agoThere are some idioms in Lua that you might recognize from Python or Ruby. I have seen this one in Perl and the Bourne shell, as well. ffi = ffi or require("ffi") If the ffi expression evaluates to something that is not nil, we keep the previous value of ffi. The assignment becomes a no-op. If it evaluates to a nil, we initialize it by calling require().
- chrisdevereux 15y agoLooks like luaJIT: http://luajit.org/ext_ffi_api.html http://luajit.org/ext_ffi_api.html
- akadien 15y agoIt's LuaJIT (FFI). Legacy wrappers involve mostly C code and a lot of code managing metatables.
- pygy_ 15y agoJames McKaskill ported LuaJIT's FFI to standard (PUC) Lua, but there are a few differences. I don't know for which one it was developed. https://github.com/jmckaskill/luaffi https://github.com/jmckaskill/luaffi
- fyolnish 15y agoYes, it does indeed require LuaJIT. (I probably should indicate this more clearly in the source)