Safe Rust bindings to Lua 5.1 that closely mirror the C API while enforcing memory safety.
rust-lua is a Rust library that provides safe, idiomatic bindings to the Lua 5.1 scripting language. It allows Rust applications to embed Lua as a scripting engine while leveraging Rust's memory safety guarantees to avoid common C API pitfalls like dangling pointers and stack corruption.
Rust developers who need to embed Lua scripting in their applications, particularly those working on game engines, tools with plugin systems, or applications requiring runtime extensibility.
Developers choose rust-lua over raw C bindings because it enforces safety at compile time, reduces manual memory management errors, and provides a familiar API that mirrors Lua's C interface while being more robust in Rust environments.
Safe Rust bindings to Lua 5.1
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Non-unsafe functions enforce safety constraints to prevent common Lua C API pitfalls like stack overflows, as emphasized in the README's goal of providing a safe interface.
Offers full bindings to Lua 5.1's C API, allowing comprehensive control over Lua state and values, per the project description's claim of complete bindings.
Interface closely follows Lua's C API patterns, making it easy for developers experienced with Lua's native bindings, as noted in the philosophy.
Based on Lua 5.1.5 internals to ensure correctness in stack management, as mentioned in the features for accurate auxiliary library behavior.
The README admits bindings are largely untested with very few tests, which could lead to undiscovered bugs and instability in real-world use.
Limited to Lua 5.1, an older version, missing out on newer features and improvements in Lua 5.2, 5.3, and 5.4, which may hinder modern scripting needs.
Mirroring the C API closely requires handling low-level details like manual stack management, which can be cumbersome compared to more abstracted alternatives.