Skip to content

Releases: luau-lang/luau

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

0.513

04 Feb 20:51
e51ff38
Compare
Choose a tag to compare

Analysis changes

  • Type checker now knows that assert(x) can't return nil (#336)
  • Fixes incorrect reuse of generic types across different function declarations (#332)
  • Improve type checker stability when working with multiple modules
  • Improve type checker stability for deeply nested expressions and complex type hierarchies

Runtime changes

  • Fix the optimization for select(_, ...) to work for negative indices

CLI changes

  • Repl now uses isocline which supports better color output and improves editing experience

Community contributions

None this week; PRs are always welcome!

0.512

28 Jan 01:34
2f989fc
Compare
Choose a tag to compare

Analysis changes

  • Improve refinement support for unions, in particular it's now possible to implement tagged unions as a union of tables where individual branches use a string literal type for one of the fields.
  • Fix string.split type information

Runtime changes

  • Optimize select(_, ...) to run in constant time (~2.7x faster on VariadicSelect benchmark)
  • Improve debug line information for multi-line assignments
  • Improve compilation of table literals when table keys are constant expressions/variables
  • Use forward GC barrier for setmetatable which slightly accelerates GC progress

CLI changes

  • Repl now uses _PRETTYPRINT if available to print expression values instead of print

Community contributions

  • luau-analyze: Add support for reading source code from stdin by @vladmarica in #325

0.511

21 Jan 17:06
8fe95c9
Compare
Choose a tag to compare

Analysis changes

  • TableOperations lint now includes a warning for table.create(N, {}) (which is likely a mistake since the table is shared by all entries)
  • Type checker now type checks #v when v is a union
  • Parser now rejects sources that consists of a single unfinished long comment (fixes #312)

Runtime changes

  • Work around significant MSVC 2022 performance regression, bringing it more or less in line with MSVC 2019
  • Compiler now predicts array size for newly allocated tables when the table is filled in a short loop
  • Small improvements in compilation throughput (~2% faster)
  • Implement paged sweeper for GC which improves sweep throughput 2-3x and reduces memory consumption by 8 bytes per object (once it is stabilized we will see additional 8 bytes per object of savings)

CLI changes

  • Improve Repl Tab completion
  • Repl now supports -i (interactive mode to run code in context of a script's environment) and -On (to control optimization flags)

Community contributions

0.510

14 Jan 16:25
32c39e2
Compare
Choose a tag to compare

Analysis changes

  • Implement support for default generic arguments (RFC #61)
  • Table literals are now unsealed by default, allowing more correct programs to type check in strict mode (RFC #276)
  • Improve type checking in certain contexts when the target type is known
  • Type checking now allows for different types in different branches of if-then-else expression, and returns a union of all types
  • Type checking large module graphs now consumes less memory
  • Fix type checking crashes with recursive metatables

Community contributions

  • MSVC warning C4244 fixes by @rafabr34 in #308
  • Update compatibility.md to mark coroutine.close as supported by @metatablecat in #309

0.509

07 Jan 01:58
d50b079
Compare
Choose a tag to compare

Analysis changes

  • Rework transaction log used for type checking which should result in more robust type checking internals with fewer bugs
  • Improve refinement of complex expressions to propagate types through lookup chains like foo and foo.bar and foo.bar.baz
  • Reduce the amount of memory consumed by type checker on large module graphs
  • Type checker now errors on attempts to change the type of imported module fields
  • The return type of newproxy is now any (#296)
  • Fix error locations for type errors in string.format arguments

Runtime changes

  • Make tonumber(x) ~2x faster by avoiding reparsing string arguments
  • Implement new number printing algorithm (Schubfach) which makes tostring(number) produce precise (round-trippable) and short decimal output up to 10x faster
  • Fix lua_Debug::linedefined to point to the line with the function definition instead of the first statement (#265)

CLI changes

  • Fix minor bugs in Tab completion in Repl
  • Repl now saves/restores command history in ~/.luau_history

Community contributions

0.507

10 Dec 23:27
f2e6a8f
Compare
Choose a tag to compare

Analysis changes

  • Type ascription (::) now permits casts between related types in both directions, allowing to refine or loosen the type (RFC #56)
  • Fix type definition for tonumber to return number? since the input string isn't guaranteed to contain a valid number
  • Fix type refinements for field access via []
  • Many stability fixes for type checker
  • Provide extra information in error messages for type mismatches in more cases
  • Improve performance of type checking for large unions when union members are string literals

Runtime changes

  • Fix some C APIs like lua_equal or lua_getfield triggering GC assertions in presence of metatables
  • Add lua_getcoverage API for code coverage collection
  • Improve performance of truthiness checks in some cases, particularly on Apple M1, resulting in 10-25% perf gains on qsort benchmark depending on the CPU/compiler
  • Fix support for little-endian systems; IBM s390x here we go!

CLI changes

  • Add coverage reporting support to Repl (--coverage command line argument)
  • Add shebang support by @Rerumu in #149
  • Work around code signing issues during Makefile builds on macOS

Community contributions