Skip to content

Releases: luau-lang/luau

0.523

15 Apr 00:07
8e78450
Compare
Choose a tag to compare

Analysis changes

  • Type checker now normalizes types which results in cleaner error output
  • Type checking in strict mode will now infer union for return types by combining types from multiple return statements
  • Type checker is now ~10% faster as a result of a series of optimizations
  • Type checker now emits a regular type error instead of an internal error for some deeply nested types

Runtime changes

  • Fix undefined behavior (unguarded double->int cast) in bytecode compiler
  • Implement bytecode cost model for future compiler optimizations
  • Fix a bug in the new boundary invariant that could lead to crashes during table literal evaluation

Community contributions

None this week; PRs are always welcome!

0.522

07 Apr 21:49
de1381e
Compare
Choose a tag to compare

Analysis changes

  • Improve type checking stability for programs with module cycles in case when modules are being changed and rechecked in an IDE
  • Fix type checking of array literals when the type is supposed to be a dictionary (#423)
  • Improve syntax error message when ... is used after a type unexpectedly

Runtime changes

  • Improve branch optimizations when the branch condition is X and Y or X or Y where X is known at compile time

Community contributions

None this week; PRs are always welcome!

0.521

31 Mar 21:14
Compare
Choose a tag to compare

Analysis changes

  • Fix type checking of function definitions that define a table field that was declared via a type annotation
  • Fix AST line/column information for type aliases followed by a comment

Runtime changes

  • luau_load now requires the bytecode version 2 (enabled since 0.509); old bytecode blobs need to be recompiled from source
  • Tables now maintain a new boundary invariant: when #t != 0, element #t is located inside the array part of the table. This results in a more consistent iteration order with pairs, and allows for better optimizations in various parts of the runtime in the future. As part of this, computing #t is now worst-case O(logn), amortized O(1).

Community contributions

None this week; PRs are always welcome!

0.520

24 Mar 22:40
2c339d5
Compare
Choose a tag to compare

Analysis changes

  • Improve type errors when types from different modules have the same name
  • Improve type errors for argument count mismatch when the function is variadic
  • Improve type error explanation for table indexer type mismatches
  • Remove legacy Roblox-specific warnings from UnknownType lint
  • Significantly improve type checking performance for programs that have type errors with complex types

Runtime changes

  • Slightly reduce the GC overhead by excluding metrics collection by default
  • Significantly improve pcall/resume performance on macOS when LUA_USE_LONGJMP is used (#425)

Community contributions

None this week; PRs are always welcome!

0.519

18 Mar 00:53
362428f
Compare
Choose a tag to compare

Analysis changes

  • Fix pointer identity issues with declared global types (fixes #409)
  • Improve autocomplete for self calls (via :)
  • Fix type checking of function definitions when extending a table with string indexer
  • Fix some cases when any type wasn't treated as optional by the type checker
  • Fix some interactions with discriminable unions during type checking
  • Improve type checking stability

Runtime changes

  • Add C API to access memory category information (lua_setmemcat and lua_totalbytes) for memory profiling
  • Fix typeof() semantics for untagged host-exposed user data: now typeof() returns __type metafield for all host-exposed userdata (but not userdata created via newproxy())
  • Fix definition of lua_clonefunction when LUA_API was customized in the build process (fixes #411)
  • Fix 32-bit Windows builds when using clang-cl (fixes #421)
  • Optimize table rehashing (~15% faster dictionary table resize on average)

Community contributions

0.518

11 Mar 17:03
a44b790
Compare
Choose a tag to compare

Analysis changes

  • Fix crashes when typechecking some setmetatable calls
  • Fix incorrect line number in "duplicate type" type error
  • Fix incorrect type errors in certain variadic/generic functions like pcall
  • Improve error messages for argument count mismatches in variadic functions
  • Improve type checking stability

Runtime changes

  • Remove LUAI_GC* parameters from luaconf.h; applications that need to tune them must do so by calling lua_gc
  • luaL_typename now follows the logic of typeof (which means it supports __type metafields for userdata); to get a string-based representation of a type, use lua_type to get an integer representation and lua_typename to convert it to a string

Community contributions

None this week; PRs are always welcome!

0.517

04 Mar 16:44
dbdf91f
Compare
Choose a tag to compare

Analysis changes

  • Fix type definition for table.freeze to be more generic
  • Fix an edge case when type checking result was dependent on the type pointer values
  • Fix a bug in type checking that would sometimes lead to modification of generic type definitions
  • Fix a bug in type checking that could lead to extension of sealed tables in rare cases
  • Improve "global is used as local" lint to flag uses of global values that are contained to a function more often

Runtime changes

  • Implement table.clone (#362)
  • Add lua_stackdepth C API to query the number of entries in the call stack
  • Improve performance of freeing tables (~5% lift on some GC benchmarks)

Community contributions

None this week; PRs are always welcome!

0.516

25 Feb 01:16
db3a8a2
Compare
Choose a tag to compare

Analysis changes

  • Fix type checking in branches when values were compared to string literals
  • Fix type checking for property access of unions of tables in some cases

Runtime changes

  • Fully enable the new paged sweeper, which improves GC sweeping throughput by 2-3x and reduces allocation overhead by 16 bytes/object on 64-bit platforms

Community contributions

Breaking changes

This release introduces a small breaking change in lua.h (only relevant for embedders) to improve compatibility with Lua/LuaJIT:

  • Remove lua_State* argument from lua_Alloc callback (used by lua_newstate)

0.515

18 Feb 01:27
5b78465
Compare
Choose a tag to compare

Analysis changes

  • Add CommentDirective lint to warn on misspelled directives (comments that start with !)
  • Fix return type annotation for table.move
  • Fix type checker hanging due to recursive metatables (#365)

Runtime changes

  • Reduce size of coroutines by 24 bytes
  • Optimize coroutine.close to skip stack reallocation in certain cases
  • Fix unity (amalgamated) builds (#262)
  • Add .natvis files for easier VM debugging in Visual Studio

CLI changes

  • Implement support for metatables in Repl Tab completion
  • Fix function line numbers in code coverage reports

Community contributions

None this week; PRs are always welcome!

0.514

11 Feb 19:07
63d5423
Compare
Choose a tag to compare

Analysis changes

  • Implement MisleadingAndOr lint to detect cases where and-or expression always evaluates to the last argument
  • Improve detection of deprecated APIs for table members
  • Improve stability and performance of cross-module type checking for large graphs
  • Fix type checking of type aliases that have been forward declared
  • Fix type checking of method calls on string literal types

Runtime changes

  • Fix an off-by-one bug in select(_, ...) optimization
  • Fix heap dump interaction with paged sweeper

CLI changes

  • Add -gN argument to luau CLI to specify debug information level
  • Fix stack/heap leaks in Tab completion in CLI

Community contributions