A typed superset of Lua with gradual typing, inspired by TypeScript's approach to JavaScript.
LuaNext aims to bring static type checking to Lua while maintaining its simplicity and allowing gradual adoption. Write type-safe Lua code that compiles to plain Lua, with zero runtime overhead.
Warning: This project is in pre-alpha development. The code is not ready for production use.
- Gradual Typing - Add types at your own pace, from none to full coverage
- TypeScript-Inspired - Familiar syntax for developers coming from TypeScript
- Zero Runtime Cost - Types are erased at compile time
- Lua Compatibility - Compiles to clean, readable Lua (5.1-5.4)
- Rich Type System - Interfaces, unions, generics, and more
- Optional Features - Enable OOP, functional programming, or decorators as needed
- LSP Support - Full language server with autocomplete, diagnostics, and more
- Multi-File Compilation - Compile entire projects with automatic dependency ordering
- Circular Dependency Detection - Catch import cycles before compilation
- Glob Pattern Support - Use wildcards like
src/**/*.luaxto select files
Current Status: Pre-Alpha
This project is in early development. Core infrastructure is being built.
LuaNext is built in Rust with a focus on modularity and testability:
luanext/
├── crates/
│ ├── luanext-core/ # Compiler core (lexer, parser, type checker, codegen)
│ ├── luanext-cli/ # Command-line interface
│ └── luanext-lsp/ # Language Server Protocol implementation
Design Principles:
- Dependency injection for testability
- Trait-based abstractions for flexibility
- Comprehensive error handling with detailed diagnostics
- Zero runtime overhead - all types erased at compile time
- Rust 1.70+
- Cargo
# Build all crates
cargo build
# Run tests
cargo test
# Run linter
cargo clippy
# Format code
cargo fmt# Run all tests
cargo test --all
# Run tests for specific crate
cargo test -p luanext-coreLuaNext is under active development. Contributions are welcome!
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
Please ensure:
- All tests pass (
cargo test) - Code is formatted (
cargo fmt) - No clippy warnings (
cargo clippy)
MIT License - see LICENSE for details.
- Inspired by TypeScript and Teal
- Built with Rust for performance and safety
- Uses Tower LSP for language server implementation
Status: 🔧 Pre-Alpha - Under Development
Built with ❤️ by the LuaNext team