← Back to context

Comment by mkeeter

1 year ago

> By default mlua uses pkg-config tool to find lua includes and libraries for the chosen Lua version. In most cases it works as desired, although sometimes could be more preferable to use a custom lua library.

The fact that Rhai builds with just 'cargo build' shouldn't be underestimated - a Rust project with all pure-Rust dependencies is much easier to maintain / support / distribute across a wide variety of hosts!

This is just behind a feature flag like:

    $ cargo add mlua --features lua54,vendored

Then mlua will statically build with the Lua sources it bundles itself and no need to link the system Lua or do anything other than "cargo build" like normal.

  • Still not as easy as pure Rust, e.g. for cross-compiling. It's similar to how pure Go projects are much easier to cross-compile than ones using cgo.

    `cargo cross` exists, which can help but it's really a kludge.

    • This is a cargo deficiency then.

      Zig has no problem using Lua (via the Ziglua wrapper) and cross-compilation is a single command away.

      Rather than developing and increasingly insular (navel-gazing?) ecosystem, it might be better to work on the root problem.

      4 replies →