by Andoryuuta · 1y ago · 0 comments
Genuine question, as I don't have any prior experience embedding any scripting language into a Rust project.
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!
$ 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.`cargo cross` exists, which can help but it's really a kludge.
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.
Even something like a `Vec<u64>` is likely to be a right pain with Lua.
If you are thinking in rust already, why would you go to an FFI c solution?
(Source: have been prototyping DSLs in rust with most of my life force for about a year)