Article illustration 1

In a significant move for language runtime engineering, Tsuki has arrived as a ground-up Rust port of Lua 5.4—not merely bindings, but a full reimplementation in Rust. This eliminates the need for C toolchains, prioritizing Rust's memory safety guarantees while introducing modern features like async/await support. Initiated via C2Rust translation and refined manually, Tsuki deliberately breaks some Lua conventions to align with Rust's paradigms, positioning itself as a safer alternative for embedding scripting in Rust applications.

Safety First: Rust's Strengths Front and Center

Tsuki's core promise is unambiguous: "All public API of Tsuki should provide 100% safety as long as you don't use unsafe API." This manifests in deliberate design choices:
- Error Handling: Replaces Lua's long jumps with Rust's Result type for predictable error propagation
- Userdata Revolution: Uses core::any::Any for user-defined types, with metatables keyed by Rust TypeId instead of strings
- UTF-8 Enforcement: Mandates UTF-8 for __name metavalues, __tostring results, and assert/error messages
- Async Native: Supports asynchronous operations without external crates

Strategic Divergences from Lua 5.4

Tsuki isn't a drop-in replacement. Key differences reflect Rust priorities:

- ❌ **No multithreading** (explicitly non-goal)
- ❌ Binary chunk loading unsupported
- ❌ `debug` library, `xpcall`, `collectgarbage` removed
- ❌ `__gc` finalizers omitted
- ✅ `string.format` strictly requires UTF-8
- ✅ `load()` arguments rigorously validated

The Roadmap: Windows, De-C, and JIT Ambitions

Tsuki's trajectory focuses on tightening Rust integration:
1. Windows support for broader ecosystem reach
2. Eliminating libc as the final C dependency
3. Cranelift JIT exploration for performance gains

Notably, Tsuki rejects becoming a Lua superset (à la Luau), C API compatibility, or 16-bit system support—doubling down on its Rust-native vision.

Why This Matters for Developers

Tsuki represents a growing trend: rebuilding foundational tools in Rust for safety and concurrency. Its async support and type-safe APIs offer compelling advantages for embedding scripting in game engines, IoT, or plugins where C-interop overhead or unsafety is prohibitive. The trade-offs—no multithreading, strict UTF-8, and dropped Lua features—demand evaluation, but for Rust-centric projects, Tsuki provides a memory-safe scripting pathway that traditional Lua bindings can't match.

Source: Tsuki GitHub Repository