← Back to context

Comment by diggan

1 year ago

I haven't tried Rhai and I wouldn't call myself anything more than a casual Lua user, but from a glance, these could be some reasons I see others using Rhai instead of Lua:

- Closer to Rust syntax/data structures, so easier if you already know Rust but don't know Lua

- Built-in serde (popular Rust de/serializer) support, if you need that

- Not sure if existing Rust<>Lua crates have it, but the debugging interface looks like the beginning of something useful (https://rhai.rs/book/engine/debugging/)

- Made in Rust, so again, if you already use Rust (which you do, if this crate is an option) it'll most likely to be easier to change for your needs, than modifying a Lua runtime

Personally, I'd probably still go for Lua rather than something like Rhai, if I had to choose something for algol-like scripting support. Otherwise I think Steel (https://github.com/mattwparas/steel) looks like the most useful scripting environment for Rust currently.

mlua has serde support

  • You're right, thanks! I did a quick grep with "serde" on the features exposed by `mlua` before posting that comment, but of course they named the feature "serialize", so didn't show up :/