Skip to content

LuaxPure-Dart Lua 5.3 VM

Embeddable, async-ready, with web and Flutter support. Maintained since the LuaDardo lineage.

Install โ€‹

yaml
# pubspec.yaml
dependencies:
  luax:
    git: https://github.com/NaivG/Luax.git
bash
dart pub get

Quick Example โ€‹

dart
import 'package:luax/lua.dart';

void main() {
  final state = LuaState.newState();
  state.openLibs();
  state.doString(r'''
    for i = 1, 5 do
      print("Hello from Luax!", i)
    end
  ''');
}

Output:

Hello from Luax!	1
Hello from Luax!	2
Hello from Luax!	3
Hello from Luax!	4
Hello from Luax!	5

Why Luax? โ€‹

  • 100% Dart โ€” no native dependencies, runs on all Dart platforms including web
  • Lua 5.3 compliant โ€” full language surface, including goto/label, integers, bitwise ops, and pattern matching
  • Garbage-collected โ€” incremental tri-color mark-and-sweep, __gc finalizers, weak tables
  • Async interop โ€” call async Dart functions from Lua with await, or use coroutine.resumeAsync
  • Event system โ€” bidirectional EventEmitter bridging Dart and Lua callbacks
  • Web-ready โ€” runs in the browser via a platform abstraction layer
  • Flutter-ready โ€” companion flutter_luax package for widget bindings

Ready to dive in? Start with the Getting Started guide.