Releases: luau-lang/luau
Releases · luau-lang/luau
0.606
New Solver
- Improvements to data flow analysis
Native Code Generation
- Block limit is now per-function instead of per-module
Full Changelog: 0.605...0.606
0.605
What's Changed
- Include module name for definitions files by @JohnnyMorganz in #861
- Add SUBRK and DIVRK bytecode instructions to bytecode v5 by @zeux in #1115
- Added
--vector-lib
,--vector-ctor
and--vector-type
options to luau-compile to support code with vectors - Experimental implementation of Require by String with Relative Paths and Require by String with Aliases RFCs with support for
paths
andaliases
arrays in .luaurc file. This implementation is under an experimental flag and will be finalized in the upcoming releases.
New Solver
- Correctness fixes to subtyping
- Improvements to dataflow analysis
Native Code Generation
- Added bytecode analysis pass to predict type tags used in operations
- Fixed rare cases of numerical loops being generated without an interrupt instruction
- Restored optimization data propagation into the linear block
- Duplicate buffer length checks are optimized away
Miscellaneous
- Small performance improvements to new non-strict mode
- Introduced more scripts for fuzzing Luau and processing the results, including fuzzer build support for CMake
New Contributors
- @WheretIB made their first contribution in #1119
- @menarulalam made their first contribution in #1123
Full Changelog: 0.604...0.605
0.604
What's Changed
- Add
#include <algorithm>
to fix building with gcc 14 by @kostadinsh in #1104 - Optimize vector literals by storing them in the constant table by @petrihakkinen in #1096
New Solver
- New algorithm for inferring the types of locals that have no annotations. This
algorithm is very conservative by default, but is augmented with some control
flow awareness to handle most common scenarios. - Fix bugs in type inference of tables
- Improve performance of by switching out standard C++ containers for
DenseHashMap
- Infrastructure to support clearer error messages in strict mode
Native Code Generation
- Fix a lowering issue with buffer.writeu8 and 0x80-0xff values: A constant
argument wasn't truncated to the target type range and that causes an
assertion failure inbuild.mov
. - Store full lightuserdata value in loop iteration protocol lowering
New Contributors
- @kostadinsh made their first contribution in #1104
Full Changelog: 0.603...0.604
0.603
What's changed?
- Record the location of properties for table types (closes #802)
- Implement stricter UTF-8 validations as per the RFC (luau-lang/rfcs#1)
- Implement
buffer
as a new type in both the old and new solvers. - Changed errors produced by some
buffer
builtins to be a bit more generic to avoid platform-dependent error messages. - Fixed a bug where
Unifier
would copy some persistent types, tripping some internal assertions. - Type checking rules on relational operators is now a little bit more lax.
- Improve dead code elimination for some
if
statements with complex always-false conditions
New type solver
- Dataflow analysis now generates phi nodes on exit of branches.
- Dataflow analysis avoids producing a new definition for locals or properties that are not owned by that loop.
- If a function parameter has been constrained to
never
, report errors at all uses of that parameter within that function. - Switch to using the new
Luau::Set
to replacestd::unordered_set
to alleviate some poor allocation characteristics which was negatively affecting overall performance. - Subtyping can now report many failing reasons instead of just the first one that we happened to find during the test.
- Subtyping now also report reasons for type pack mismatches.
- When visiting
if
statements or expressions, the resulting context are the common terms in both branches.
Native codegen
- Implement support for
buffer
builtins to its IR for x64 and A64. - Optimized
table.insert
by not inserting a table barrier if it is fastcalled with a constant.
0.602
What's changed?
- Fixed a bug in type cloning by maintaining persistent types.
- We now detect imprecise integer literals and flag the imprecision as a lint warning.
- Parsing is now up to 10% faster due to improved inlining.
New type solver
- LValues now take into account the type being assigned during constraint generation.
- Normalization performance has been improved by 33% by replacing the an internal usage of
std::unordered_set
withDenseHashMap
. - Normalization now has a helper to identify types that are equivalent to
unknown
, which is being used to fix some bugs in subtyping. - Uses of the old unifier in the new type solver have been eliminated.
- Improved error explanations for subtyping errors.
Native code generation
- Introduce instruction and block count limiters for controlling what bytecode is translated into native code.
- Implement code generation for
bit32.byteswap
. - Marginally speed up method calls for tables via
:
in some cases.
0.601
What's changed
bit32.byteswap
added by @Dekkonot (RFC)- Buffer library implementation (RFC)
- Fixed a missing
stdint.h
include by @xgqt - Fixed parser limiter for recursive type annotations being kind of weird (fixes #645)
Native Codegen
- Fixed a pair of issues when lowering
bit32.extract
- Fixed a narrow edge case that could result in an infinite loop without an interruption
- Fixed a negative array out-of-bounds access issue
- Temporarily reverted linear block predecessor value propagation
New type solver
- We now type check assignments to annotated variables
- Fixed some test cases under local type inference
- Moved
isPending
checks for type families to improve performance - Optimized our process for testing if a free type is sufficiently solved
0.600
Analysis
- Improve readability of unions and intersections by limiting the number of elements of those types that can be presented on a single line
Runtime
if...then...else
expressions are now optimized intoAND/OR
form when possible.- Add a new
buffer
type to Luau based on the buffer RFC and additional C API functions to work with it; this release does not include the library. - C API to work with string buffers has been updated to align with Lua version more closely
Native Codegen
- Simplified the way numerical loop condition is translated to IR
New Type Solver
- Operator inference is now handled by type families
- Created a new system called
Type Paths
to explain why subtyping tests fail in order to improve the quality of error messages. - Progress towards implementing Data Flow analysis in the new solver
0.599
What's Changed
- Improve POSIX compliance in
CLI/FileUtils.cpp
by @SamuraiCrow #1064 AstStat*::hasEnd
is deprecated; useAstStatBlock::hasEnd
instead- Added a lint for common misuses of the
#
operator - Linter now issues deprecated diagnostics for some uses of
getfenv
andsetfenv
- Fixed a case where we included a trailing space in some error stringifications
Compiler
- Do not do function analysis in -O2 on self functions to make compilation faster
- Improve detection of invalid repeat..until expressions vs continue #1065
New Type Solver
- We now cache subtype test results to improve performance
- Improved operator inference mechanics (aka type families)
- Further work towards type states
- Work towards new non-strict mode continues
Native Codegen
- Instruction last use locations should follow the order in which blocks are lowered
New Contributors
- @SamuraiCrow made their first contribution in #1064
Full Changelog: 0.598...0.599
0.598
What's Changed
- Include windows.h instead of Windows.h by @RadiantUwU in #1055
- Custom implementation of
os.time
for all platforms
Compiler
- Fix
repeat..until
loops withcontinue
statement when until expression refers to constants #1042 - Fix
repeat..until
loops withcontinue
statement when upvalues are used #1043 - Disable builtin constant folding at -O2 when
getfenv
/setfenv
are used - Bytecode version produced by the compiler has been upgraded to 4 (runtime support for v4 starts from 0.588).
New Type Checker
- Initial work toward type states.
- Rework most overloadable operators to use type families.
- Initial work toward our new nonstrict mode.
Native Codegen
- Fix native code generation for dead loops
- Annotate top-level functions as cold to avoid compiling them to native code
- Slightly smaller/faster X64 calls to Luau functions
- Slightly smaller/faster A64 calls for both Luau and C functions
- Inline constant array index offset into the load/store instruction
- Increase X64 spill slots from 5 to 13
New Contributors
- @RadiantUwU made their first contribution in #1055
Full Changelog: 0.597...0.598
0.597
New Type Solver
- Implement bidirectional type inference for higher order functions so that we can provide a more precise type improving the autocomplete's human factors.
- We seal all tables, so we changed the stringification to make it a little lighter on users.
- Fixed a case of array-out-of-bound access.
- Type families no longer depends on
TxnLog
andUnifier
. - Type refinements now waits until the free types are sufficiently solved.
Native Code Generation
- Remove cached slot lookup for
executeSETTABLEKS
function because it is a fallback in the event of a cache miss, making the cached slot lookup redundant. - Optimized repeated array lookups, e.g.
a[3]
ina[3] = a[3] / 2
is done once.
Misc
- On some platforms, it is necessary to use
gmtime_s
with the arguments reversed to get the current time. You can now defineDOCTEST_CONFIG_USE_GMTIME_S
to build and run unit tests on those platforms.
Full Changelog: 0.596...0.597