dibyendumajumdar/ravi
FreeRavi is a dialect of Lua, featuring limited optional static typing, JIT and AOT compilers
About dibyendumajumdar/ravi
Ravi is a dialect of Lua that introduces limited optional static typing to improve performance when JIT compilation is enabled. It features a JIT compiler powered by the MIR backend and supports AOT (Ahead-of-Time) compilation to native code. Ravi prioritizes ease of maintenance, language safety, and compatibility with Lua 5.3 over maximum performance, making it a safer alternative to LuaJIT for certain use cases. Key features include optional static typing, type-specific bytecodes, generational garbage collection from Lua 5.4, a defer statement for resource management, a compact JIT backend (MIR), AOT compilation to shared libraries, and a Visual Studio Code debugger extension. Lua programs are valid Ravi programs, allowing gradual adoption of static typing.
Key Features
Pros & Cons
- Optional static typing allows gradual performance tuning without breaking existing Lua code
- JIT and AOT compilation provide multiple paths to improve execution speed
- Compatible with Lua 5.3, enabling reuse of most Lua libraries and code
- Generational garbage collector reduces pause times from older GC algorithms
- Built-in defer statement simplifies resource management (e.g., file handles, sockets)
- VSCode debugger extension aids in development and debugging
- Performance not as high as LuaJIT in many benchmarks
- Limited optional static typing (not as comprehensive as Typed Lua or TypeScript)
- Smaller ecosystem and community compared to standard Lua or LuaJIT
- Static typing features are still evolving and may be incomplete