This is lde's fork of LuaJIT.
It contains features for the sake of improved cross platform capabilities, and those that would benefit the lde runtime.
Here's a table of supported platforms and download links to the luajit binary.
| Platform | Architecture | libc | Download |
|---|---|---|---|
| Linux | x86-64 | glibc (2.35+) | ✅ Download |
| Linux | x86-64 | musl | ✅ Download |
| Linux | aarch64 (ARM64) | glibc (2.35+) | ✅ Download |
| Linux | aarch64 (ARM64) | musl | ✅ Download |
| Linux | aarch64 (ARM64) | android | ✅ Download |
| Windows | x86-64 | - | ✅ Download |
| Windows | aarch64 (ARM64) | - | ✅ Download |
| macOS | x86-64 (Intel) | - | ✅ Download |
| macOS | aarch64 (Apple Silicon) | - | ✅ Download |
If you need to get the library instead, check out the release page manually and download the corresponding libluajit, although you would usually do this programmatically.
Creates a namespaced FFI context that isolates C type declarations under an optional prefix, preventing collisions with the global type namespace.
Methods (same API as the ffi module, operating on the context's namespace):
ctx:cdef(code)— declare types, addingprefixto each top-level namectx:new(ctype, ...)— allocate a cdata objectctx:cast(ctype, init)— cast to a C typectx:typeof(ctype)— get the ctype of a type namectx:sizeof(ctype)— get the size of a typectx:alignof(ctype)— get the alignment of a typectx:offsetof(ctype, field)— get the offset of a struct fieldctx:metatype(ctype, mt)— set a metatype for a typectx:istype(val, ctype)— check if a value is a given typectx:load(libname [, global])— load a shared library
Example:
local ffi = require("ffi")
-- Create a context with prefix "foo", all types get "foo" prepended
local ctx = ffi.context("foo")
ctx:cdef([[ typedef int num; typedef struct { double v; } inner; ]])
-- Types are named "foonum", "fooinner" — no collisions with globals
local a = ctx:new("num") -- cdata<int>
local b = ffi.new("foonum") -- equivalent
-- Multiple contexts with different prefixes can use the same names
local a_ctx = ffi.context("a")
local b_ctx = ffi.context("b")
a_ctx:cdef("typedef int num;") -- creates "anum" (int)
b_ctx:cdef("typedef double num;") -- creates "bnum" (double)
-- No-prefix context still useful for scoped cdef
local scoped = ffi.context()
scoped:cdef("typedef int foo;")Types declared inside a context are stored in the global type namespace with the
prefix applied, so they are accessible globally (e.g., via ffi.C or ffi.new).
The prefix simply ensures each context gets unique names.
The os.tmpname() function now resolves the temporary directory dynamically
instead of hardcoding /tmp. It checks the TMPDIR environment variable
(POSIX standard), falling back to /tmp if unset.
This makes os.tmpname() work correctly on platforms where /tmp is not
writable or does not exist, such as:
- Termux (Android) —
TMPDIRpoints to$PREFIX/tmp - Containerized or sandboxed environments with custom temp locations
- Any system that follows the POSIX convention of setting
TMPDIR