lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Hi everyone,

I've just released a little module called 'bitness'. It does just one thing (and I hope it does it well), which is to determine whether your script is running on Lua (or LuaJIT) compiled as a 32 or 64 bit binary.

Example:
~~~~
local arch = require("bitness")()
print("Lua has been compiled as "..arch.." bits")
~~~~

It works by inspecting the bytecode on Lua or using the appropiate ffi.abi call on LuaJIT. It is released under the MIT license.

It is available on github [1] and as a rock [2]. Installation is easy, just:

luarocks install bitness

or copy the file 'bitness.lua' into Lua's path.

Regards,
Ignacio