Coming from mlua
omniLua's API is shaped after mlua, so most code reads the same. It isn't source-compatible — names and details differ — but the shapes carry over.
What's the same
Lua::new,load(..).exec()/.eval(),globals().create_function, theUserData/UserDataMethodstraits.FromLua/IntoLuaconversions,scopefor non-'staticborrows.- serde integration (
to_value/from_value) behind theserdefeature.
What omniLua adds
- Compiles to
wasm32-unknown-unknown— runs in the browser, which mlua can't. - Lua 5.1 through 5.5 from one build, selected per instance.
- A sandbox for standard Lua (mlua's hardened sandbox is Luau only).
What it lacks
- LuaJIT speed — omniLua is an interpreter. If you need that throughput, stay on mlua.
- A decades-mature ecosystem and C API/ABI compatibility.
In short
Move to omniLua for the browser, multiple versions, or a sandbox. Stay on mlua for LuaJIT speed.