Skip to content

Guide

Task-oriented guides for using Luax. Pick a topic below to dive in.

Interop & APIs

  • Dart ↔ Lua Interop

    The full protocol for calling Dart from Lua, Lua from Dart, and reading Lua tables and functions across the boundary.

  • Async / Await

    Call async Dart functions from Lua using the await keyword, or suspend inside coroutine.resumeAsync.

  • Event System

    Bidirectional EventEmitter bridging Dart and Lua callbacks — including one-shot listeners, async listeners, and security sandboxing.

Language features

  • Coroutines

    Full Lua 5.3 coroutine library — create, yield, resume, wrap, plus async-aware resumeAsync.

  • Language Features

    Luax's Lua 5.3+ extensions: goto / ::label::, pattern matching with %b and %f, binary data packing, and function serialization.

Runtime

  • Garbage Collection

    Incremental tri-color mark-and-sweep collector, __gc finalizers, weak tables, and the collectgarbage() API.

  • Parser & AST

    Use lua_parser to build static analysis tools, linters, and code transformers on top of the Luax parser.

Platforms

  • Web Platform

    Running Luax in the browser via the platform abstraction layer — supported APIs, limitations, and workarounds.

  • Flutter Integration

    The companion flutter_luax package: widget bindings, LuaxScriptLoader, and a complete integration example.

Internals

  • Architecture — A deep-dive into the Luax VM: the compilation pipeline, the register-based execution model, state management, and the garbage collector.