Choosing a version

All five versions run from one build. Pick one per instance; the rest of the API is the same across versions.

Selecting a version

rust
use omnilua::{Lua, LuaVersion};
let lua = Lua::new_versioned(LuaVersion::V53);
CLI / wasm
$ OMNILUA_VERSION=5.3 omnilua script.lua
// js: loadLuaRs(luaRsWasmUrl, { version: "5.3" })

The default is 5.4. 5.4 is the most thoroughly tested; it passes the full official PUC-Rio suite. The others run their own upstream suites and are checked against the reference lua binary.

Differences that matter

  • Numbers. 5.1 and 5.2 have no integer type — every number is a float. 5.3+ have integers, so 3 / 3 prints 1.0 on 5.4 and 1 on 5.1.
  • math.random. Uses a Rust PRNG, so the sequence won't match reference C.
  • Standard library. The version sets the roster: bit32 is 5.2 only; utf8 and string.pack are 5.3+; goto is 5.2+.
See it

The playground runs one snippet across all five versions so you can watch the output diverge.

Next