Open-Awesome
CategoriesAlternativesStacksSelf-HostedExplore
Open-Awesome

© 2026 Open-Awesome. Curated for the developer elite.

TermsPrivacyAboutGitHubRSS
  1. Home
  2. Rust
  3. rust-lua

rust-lua

MITRust

Safe Rust bindings to Lua 5.1 that closely mirror the C API while enforcing memory safety.

GitHubGitHub
131 stars21 forks0 contributors

What is rust-lua?

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.

Target Audience

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.

Value Proposition

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.

Overview

Safe Rust bindings to Lua 5.1

Use Cases

Best For

  • Embedding Lua scripting in Rust game engines
  • Building Rust applications with plugin/extension systems
  • Creating safe Lua bindings for existing Rust codebases
  • Prototyping game logic with Lua in Rust projects
  • Developing tools that require runtime scripting capabilities
  • Migrating C/C++ Lua projects to Rust with minimal API changes

Not Ideal For

  • Projects requiring modern Lua features (e.g., Lua 5.3/5.4 for new APIs and improvements)
  • Mission-critical systems where extensive testing and proven reliability are non-negotiable
  • Teams wanting a high-level, Rust-idiomatic API that abstracts away low-level C API details

Pros & Cons

Pros

Safe Interface Design

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.

Complete Lua 5.1 Coverage

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.

Familiar C API Mirroring

Interface closely follows Lua's C API patterns, making it easy for developers experienced with Lua's native bindings, as noted in the philosophy.

Reference-Based Implementation

Based on Lua 5.1.5 internals to ensure correctness in stack management, as mentioned in the features for accurate auxiliary library behavior.

Cons

Inadequate Testing

The README admits bindings are largely untested with very few tests, which could lead to undiscovered bugs and instability in real-world use.

Outdated Lua Version

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.

Low-Level Complexity

Mirroring the C API closely requires handling low-level details like manual stack management, which can be cumbersome compared to more abstracted alternatives.

Frequently Asked Questions

Quick Stats

Stars131
Forks21
Contributors0
Open Issues6
Last commit6 years ago
CreatedSince 2013

Tags

#systems-programming#embedded-scripting#memory-safety#ffi#game-development#rust-bindings#scripting-language

Built With

L
Lua 5.1
R
Rust

Included in

Rust56.6k
Auto-fetched 8 hours ago

Related Projects

RustPythonRustPython

A Python Interpreter written in Rust

Stars22,340
Forks1,484
Last commit19 hours ago
PyO3PyO3

Rust bindings for the Python interpreter

Stars16,116
Forks1,016
Last commit20 hours ago
wasm-bindgenwasm-bindgen

Facilitating high-level interactions between Wasm modules and JavaScript

Stars9,145
Forks1,242
Last commit9 hours ago
NeonNeon

Rust bindings for writing safe and fast native Node.js modules.

Stars8,425
Forks287
Last commit7 days ago
Community-curated · Updated weekly · 100% open source

Found a gem we're missing?

Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.

Submit a projectStar on GitHub