Skip to content

Releases: mxpv/luaz

v0.6.0

03 Dec 23:02
076dc97

Choose a tag to compare

Changed

  • Updated Luau dependency from version 0.688 to 0.702
  • Raw Luau C API is now re-exported from the library via the c module
  • BREAKING: Replaced Table.setClosure() with Lua.Capture() for creating closures with upvalues. New API: table.set("name", Lua.Capture(upvalues, func))

Fixed

  • registerUserData() now properly detects global name collisions when registering types from different modules with the same short name

Luau version: 0.702

v0.5.0

23 Aug 01:24
eb2c40f

Choose a tag to compare

Added

  • Enabled Ubuntu 22.04 ARM on CI.

Changed

  • BREAKING: Updated Zig toolchain requirement to version 0.15.1 (#11)
  • setCallbacks() now explicitly clears unused callback pointers to null, fixing behavior when switching between different callback struct types
  • Updated Luau dependency from version 0.686 to 0.688

Luau version: 0.688

v0.4.0

17 Aug 21:09
c4518d5

Choose a tag to compare

Added

  • Luau Buffer support for native binary data manipulation
    • High-level Buffer API with direct memory access through []u8 slice
    • Integration with Zig's std.io patterns via stream() method
    • Reference-counted memory management with automatic cleanup
    • Full interoperability with Lua's buffer library
    • Lua.createBuffer(size) method for buffer creation
    • Buffer support in Lua.Value enum for runtime value handling
    • Stack operations for buffer values (pushBuffer, toBuffer, isBuffer)
  • Configurable vector size build option (-Dvector-size=3 or 4, default 4)
  • Function.getCoverage() method for collecting code coverage data from Luau functions compiled with coverage enabled

Changed

  • Build System: Switched from Git submodules to Zig package manager for Luau dependency, simplifying setup process
  • Updated Luau dependency from version 0.684 to 0.686
  • Enhanced State.zig documentation with detailed stack operation descriptions and Lua 5.1 manual references

Luau version: 0.686

v0.3.0

12 Aug 21:56
fee574c

Choose a tag to compare

Added

  • Luau StrBuf support for efficient string building with automatic memory management
    • High-level StrBuf API with init(), initSize(), addString(), addChar(), and add() methods
    • Support for returning StrBuf from Zig functions with automatic pointer fixup
    • Integration with table operations and closure system
    • Handles both stack buffer (small strings) and dynamic allocation (large strings)
  • Variadic arguments support with Varargs iterator for functions accepting variable number of arguments
    • Varargs.raiseError() method for throwing descriptive type validation errors
  • BREAKING: setClosure Lua closures must use Upvalues(T) as first parameter
  • Canonical Zig iterator pattern for table iteration with Table.iterator()
  • Metatable management APIs:
    • Lua.createMetaTable() for flexible metatable creation without global registration
    • Table.setMetaTable() and Table.getMetaTable() for metatable attachment and retrieval
  • Table.clear() method to remove all entries from a table
  • Table.clone() method to create a shallow copy of a table
  • Function.clone() method to create a copy of a function with shared upvalue references
  • Debug API with breakpoints, stack inspection, and variable access:
    • Debug module with execution control: setSingleStep(), debugBreak(), debugTrace(), stackDepth()
    • Call stack inspection: getInfo(), getArg(), getLocal()/setLocal(), getUpvalue()/setUpvalue()
    • Callback-based debugging with setCallbacks() for breakpoint and step event handling
    • Function breakpoint support with Function.setBreakpoint()
    • Support for debug compilation levels (0-2) for local variable and upvalue name inspection
    • Thread-safe debugging with coroutine support and debug interruption handling

Changed

  • BREAKING: Table iteration API now uses standard Zig iterator pattern (iterator.next())
  • Refactored registerUserData implementation to use new metatable APIs internally
  • Renamed module files to follow Zig naming conventions:
    • src/state.zigsrc/State.zig
    • src/compile.zigsrc/Compiler.zig
    • Updated all imports to use the module directly instead of accessing nested types

Removed

  • BREAKING: Old manual table iteration method Table.next() in favor of canonical iterator

v0.2.0

06 Aug 20:24
0aa4035

Choose a tag to compare

What's Changed

Added

  • Sandboxing APIs for secure script execution
  • Thread and coroutines support with full Luau threading capabilities
  • Generic Lua Value type for runtime value handling
  • Table iterator with automatic resource management
  • Raw table operations for direct table access bypassing metamethods
  • Low-level debug APIs for advanced debugging scenarios
  • Metamethod support:
    • __index and __newindex for table access customization
    • __tostring for custom string conversion
    • __len for custom length operations
    • __concat for concatenation operations
    • Math operation metamethods (__add, __sub, __mul, __div, etc.)
    • Comparison metamethods (__eq, __lt, __le)
  • Table length operations with Table.len() supporting full Lua semantics
  • Support for error returns in Lua functions
  • Struct and array return type conversion

Changed

  • Simplified resume API for streamlined coroutine management
  • UserData improvements:
    • Support for *Lua receiver as first function parameter
    • UserData treated as Ref for consistent reference handling
    • No longer requires at least 1 public function when registering
  • Arbitrary structs can be set as Lua tables
  • Use pcall instead of direct call for improved error safety
  • Exposed GC API for greater control over garbage collection

Documentation

  • Updated guided tour with new features
  • Enhanced README with additional examples
  • Added test coverage reporting

Full Changelog: v0.1.0...v0.2.0

v0.1.0

03 Aug 19:16
151ea05

Choose a tag to compare

What's Changed

Added

  • Core Lua state management with State wrapper
  • High-level idiomatic Zig API through Lua struct
  • Luau compiler integration for source-to-bytecode compilation
  • Type system integration with automatic conversions:
    • Zig functions wrapped as callable Lua functions
    • Optional types (?T) mapping to Lua nil values
    • Tuples converted to Lua tables with array semantics
    • Support for vectors and primitive types
  • Table operations:
    • Create, set, and get table values
    • Call table functions with automatic type handling
    • Global environment access via lua.globals()
  • Reference system (Ref) for holding Lua values across function calls
  • Function references for direct Lua function access
  • UserData support:
    • Register Zig structs as Lua userdata
    • Automatic method binding with compile-time generation
    • Light userdata support
  • Custom allocator support through Lua.init()
  • JIT code generation with enable_codegen()
  • Standard library loading functions
  • Debug utilities:
    • Stack dumping with dumpStack()
    • Custom assert handler support
  • Build system:
    • Automatic discovery and compilation of Luau source files
    • Multiple build targets (library, compiler, analyzer, docs)
    • Code formatting checks
  • Documentation generation
  • Unit test suite with memory leak detection
  • Continuous integration with coverage reporting

New Contributors

  • @mxpv made their first contribution in #2

Full Changelog: https://github.com/mxpv/luaz/commits/v0.1.0