Releases: luau-lang/luau
Releases · luau-lang/luau
0.517
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
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
- Fix grammar documentation by @TheGreatSageEqualToHeaven in #379
- Lua API: add return types to table getters by @petrihakkinen in #389
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 fromlua_Alloc
callback (used bylua_newstate
)
0.515
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
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
- Add a build option to link with the static CRT by @mikejsavage in #343
0.513
Analysis changes
- Type checker now knows that
assert(x)
can't returnnil
(#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
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 ofprint
Community contributions
- luau-analyze: Add support for reading source code from stdin by @vladmarica in #325
0.511
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
- Fix some mistakes in the documentation by @Halalaluyafail3 in #314
- Improve Grammar documentation by @JohnnyMorganz in #315
- Update copyright years. by @SnowyShiro in #323
0.510
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
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 nowany
(#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
- Add CodeMirror Editor for Web demo by @MathematicalDessert in #228
0.507
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
orlua_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
- Fix Json Encoding for AstArray by @xgladius in #279
- Add Grammar documentation by @JohnnyMorganz in #266