Guided Tour | Benchmarks | FAQ
mlua is a set of bindings to the Lua programming language for Rust with a goal of providing a
safe (as much as possible), high level, easy to use, practical and flexible API.
Started as an rlua fork, mlua supports Lua 5.5, 5.4, 5.3, 5.2, 5.1 (including LuaJIT) and Luau and allows writing native Lua modules in Rust as well as using Lua in a standalone mode.
mlua is tested on Windows/macOS/Linux including module mode in GitHub Actions on x86_64 platforms and cross-compilation to aarch64 (other targets are also supported).
WebAssembly (WASM) is supported through the wasm32-unknown-emscripten target for all Lua/Luau versions excluding JIT.
mlua uses feature flags to reduce the number of dependencies and compiled code, and allow choosing only the required set of features.
Below is a list of the available feature flags. By default mlua does not enable any features.
lua55: enable Lua 5.5 supportlua54: enable Lua 5.4 supportlua53: enable Lua 5.3 supportlua52: enable Lua 5.2 supportlua51: enable Lua 5.1 supportluajit: enable LuaJIT supportluajit52: enable LuaJIT support with partial compatibility with Lua 5.2luau: enable Luau support (auto vendored mode)luau-jit: enable Luau support with JIT backend.luau-vector4: enable Luau support with 4-dimensional vector.vendored: build static Lua(JIT) libraries from sources duringmluacompilation using lua-src or luajit-srcmodule: enable module mode (building loadablecdyliblibrary for Lua)async: enable async/await support (any executor can be used, eg. tokio or async-std)send: makemlua::Lua: Send + Sync(addsSendrequirement tomlua::FunctionandSend + Synctomlua::UserData)error-send: makemlua::Error: Send + Syncserde: add serialization and deserialization support tomluatypes using serdemacros: enable procedural macros (such aschunk!)anyhow: enableanyhow::Errorconversion into Luauserdata-wrappers: opt intoimpl UserDataforRc<T>/Arc<T>/Rc<RefCell<T>>