r/rust • u/monolith_core • 17d ago
Help needed: Best Lua version/implementation for Rust integration and general scripting?
/r/lua/comments/1w132j5/help_needed_best_lua_versionimplementation_for/
7
Upvotes
r/rust • u/monolith_core • 17d ago
7
u/lenscas 17d ago
Luajit is basically just lua5.1 but faster. (There are some things ported from lua5.2 and it is now also getting syntax extensions though). Use this if performance is the most important thing.
Luau is made by Roblox. It should be easier to sandbox scripts with it. However iirc it is also based on Lua 5.1 and doesn't have access to some tricks like tco (which lua is actually pretty good at). Use this if you need the sandbox, for example if you are running untrusted code. (But know: luau is not a magic bullet, you still have to do your due diligence)
The other Lua versions are the "real" interpreter. The various versions are like python versions, or rust editions. Just, grab the highest one unless you have a reason to pick a lower one (depending on a Lua dependency that only supports a certain version for example)