A transpiler that converts Lua source code to Rust. Current stable version 0.5.2. Release cadence is irregular with occasional updates. Key differentiator: it provides a direct path from Lua scripts to Rust code, though with significant limitations such as no support for metatables, loadstring, or user-defined iterators. It is best suited for simple Lua scripts that use basic constructs.
npm install lua2rustNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Demonstrates transpiling a simple Lua function to Rust using CLI.
Ensure Lua string indices are valid; consider wrapping in Rust's try/catch.
Restructure Lua tables to be 1-indexed consecutive arrays.
Avoid modifying tables during iteration; collect changes and apply afterward.
Manually implement base conversion in Lua before transpiling.
Use: npx lua2rust <lua file> <output function name>
Ensure Lua string indices are within bounds (1-based).
No dependency data recorded yet.