Releases: luau-lang/luau
Releases · luau-lang/luau
0.582
What's Changed
- Optimized operations like instantiation and module export for very large types
New Type Solver
- Typechecking of function calls was rewritten to handle more cases correctly
- Fixed a crash that can happen after self-referential type is exported from a module
- Fixed a false positive error in string comparison
- Added handling of
for...in
variable type annotations and fixed issues with the iterator call inside - Self-referential 'hasProp' and 'setProp' constraints are now handled correctly
JIT
- Added '--target' argument to luau-compile to test multiple architectures different from host architecture
- GC barrier tag check is skipped if type is already known to be GC-collectable
- Added GET_TYPE/GET_TYPEOF instructions for type/typeof fast-calls
- Improved code size of interrupt handlers on X64
0.581
What's Changed
- Build and use luau-compile in CI by @zeux in #952
- Fix Arch Linux install instructions to use AUR by @RealEthanPlayzDev in #953
- Add support for ClassType indexer in definition files by @JohnnyMorganz in #949
- Remove --compile support from the REPL. You can just use luau-compile instead.
- When an exception is thrown during parallel typechecking (usually an ICE), we now gracefully stop typechecking and drain active workers before rethrowing the exception.
New solver
- Include more source location information when we hit an internal compiler error
- Improve the logic that simplifies intersections of tables
JIT
- Save testable type annotations to bytecode
- Improve block placement for linearized blocks
- Add support for lea reg, [rip+offset] for labels
- Unify X64 and A64 codegen for RETURN
- Outline interrupt handlers for X64
- Remove global rArgN in favor of build.abi
- Change A64 INTERRUPT lowering to match X64
New Contributors
- @RealEthanPlayzDev made their first contribution in #953
Full Changelog: 0.580...0.581
0.580
What's Changed
- Update lint.md to specify language on fenced code blocks which have none by @BenMactavsin in #946
- Fix website demo's string highlighting behaviour by @BenMactavsin in #942
- Update performance.md by @zeux in #948
- Added luau-compile executable target to build/test compilation without having full REPL included.
New Type Solver
- Fixed the order in which constraints are checked to get more deterministic errors in different environments
- Fixed
isNumber
/isString
checks to fix false positive errors in binary comparisons - CannotCallNonFunction error is reported when calling an intersection type of non-functions
JIT
- Outlined X64 return instruction code to improve code size
- Improved performance of return instruction on A64
- Added construction of a dominator tree for future optimizations
0.579
Analysis Changes
- When type inference fails to find any matching overload for a function, we were declining to commit any changes to the type graph at all. This was resulting in confusing type errors in certain cases. Now, when a matching overload cannot be found, we always commit to the first overload we tried.
JIT
- Fix missing variadic register invalidation in FALLBACK_GETVARARGS
- Add a missing null pointer check for the result of luaT_gettm
0.578
Compiler Changes
- Fixed inlining of functions when they are used to compute their own arguments
Other Changes
- Fixed gcc warning about uninitialized
std::optional
New Type Solver
- Type families that are not part of a function signature cannot be resolved at instantiation time and will now produce an error. This will be relaxed in the future when we get constraint clauses on function signatures (internally)
never
type is now comparable- Improved typechecking of
for..in
statements - Fixed checks for number type in
Add
type family - Performance was improved, with particularly large gains on large projects
JIT
- We eliminated the call instruction overhead when native code support is enabled in the VM
- Small optimizations to arm64 lowering
- Reworked LOP_GETIMPORT handling to reduce assembly code size
- Fixed non-deterministic binary output
- Fixed bad code generation caused by incorrect SSA to VM register links invalidation
0.577
Analysis Changes
- Fix a crash that could occur in the presence of a cyclic union. We shouldn't be creating cyclic unions, but we shouldn't be crashing when they arise either.
- Minor cleanup of
luau_precall
- Internal change to make L->top handling slightly more uniform
- Optimize SETGLOBAL & GETGLOBAL fallback C functions.
- Enable compile-time user configuration for LUA_VECTOR_SIZE by @mundusnine in #929
New Type Solver
- Switch to a greedier but more fallible algorithm for simplifying union and intersection types that are created as part of refinement calculation. This has much better and more predictable performance.
- Fix a constraint cycle in recursive function calls.
- Much improved inference of binary addition. Functions like
function add(x, y) return x + y end
can now be inferred without annotations. We also accurately typecheck calls to functions like this. - Many small bugfixes surrounding things like table indexers
- Add support for indexers on class types. This was previously added to the old solver; we now add it to the new one for feature parity.
JIT
- Add CodeGen C API by @khvzak in #931
- Fuse key.value and key.tt loads for CEHCK_SLOT_MATCH in A64
- Implement remaining aliases of BFM for A64
- Implement new callinfo flag for A64
- Add instruction simplification for int->num->int conversion chains
- Don't even load execdata for X64 calls
- Treat opcode fallbacks the same as manually written fallbacks
Other Changes
- The syntax to the
luau-reduce
commandline tool has changed. It now accepts a script, a command to execute, and an error to search for. It no longer automatically passes the script to the command which makes it a lot more flexible. Also be warned that it edits the script it is passed in place. Do not point it at something that is not in source control!
New Contributors
- @mundusnine made their first contribution in #929
Full Changelog: 0.576...0.577
0.576
Analysis Changes
ClassType
can now have an indexer defined on it. This allows custom types to be used int[x]
expressions.- Fixed how unification is performed for two optional types
a? <: b?
, previously it might have unified either 'a' or 'b' with 'nil'. Note that this fix is not enabled by default yet (see the list inExperimentalFlags.h
)
Other Changes
- Add missing include for integer types by @Jan200101 in #925
- Use correct globalScope in on demand type checker by @JohnnyMorganz in #923
- Fixed search for closest executable breakpoint line. Previously, breakpoints might have been skipped in
else
blocks at the end of a function
New type solver
A concept of 'Type Families' has been introduced.
Type families can be thought of as type aliases with custom type inference/reduction logic included with them.
For example, we can have an Add<T, U>
type family that will resolve the type that is the result of adding two values together.
This will help type inference to figure out what 'T' and 'U' might be when explicit type annotations are not provided.
In this update we don't define any type families, but they will be added in the near future.
It is also possible for Luau embedders to define their own type families in the global/environment scope.
Additional type solver changes:
- Fixed scope used to find out which generic types should be included in the function generic type list
- Fixed a crash after cyclic bound types were created during unification
JIT
- Use of arm64 target on M1 now requires macOS 13
- Entry into native code has been optimized. This is especially important for coroutine call/pcall performance as they involve going through a C call frame
- LOP_LOADK(X) translation into IR has been improved to enable type tag/constant propagation
- arm64 can use integer immediate values to synthesize floating-point values
- x64 assembler removes duplicate 64bit numbers from the data section to save space
- Linux
perf
can now be used to profile native Luau code (when running with --codegen-perf CLI argument)
New Contributors
- @Jan200101 made their first contribution in #925
0.575
What's Changed
- Improve the type for
os.date
using overloads by @JohnnyMorganz in #874 - Fix grammar issues by @JohnnyMorganz in #915
Luau.Analyze.CLI
now has experimental support for concurrent type checking. Use the option-jN
whereN
is the number of threads to spawn.- Improve typechecking performance by ~17% by making the function
Luau::follow
much more efficient.
Full Changelog: 0.574...0.575
New solver
- Improve the reliability of function overload resolution
- More work toward supporting parallel type checking
- Fix a bug in inference of
==
and~=
which would erroneously infer that the operands wereboolean
- Better error reporting when
for...in
loops are used incorrectly.
JIT
- Fix unwind registration when libunwind is used on Linux
- Fixed replaced IR instruction use count
- Convert X64 unwind info generation to standard prologue
- Implement A64 unwind info support for Dwarf2
- Live in/out data for linear blocks is now created
- Add side-exit VM register requirements to the IR dump
- Reuse ConstPropState between block chains
- Remove redundant base update
0.574
API Changes
- With work started on read-only and write-only properties,
Property::type
member variable has been replaced withTypeId type()
andsetType(TypeId)
functions. - New
LazyType
unwrap callback now has avoid
return type, all that's required from the callback is to write intounwrapped
field.
Other Changes
- Added a limit on how many instructions the Compiler can safely produce (reported by @TheGreatSageEqualToHeaven)
- Update grammar.md by @JohnnyMorganz in #909
New type solver
- Work has started to support read-only (#77) and write-only (#79) properties
- Refinements are no longer applied on l-values, removing some false-positive errors
- Improved overload resolution against expected result type
Frontend::prepareModuleScope
now works in the new solver- Cofinite strings are now comparable
JIT
- Fixed MIN_NUM and MAX_NUM constant fold when one of the arguments is NaN
- Added constant folding for number conversions and bit operations
- Value spilling and rematerialization is now supported on arm64
- Improved FASTCALL2K IR generation to support second argument constant
- Added value numbering and load/store propagation optimizations
- Added STORE_VECTOR on arm64, completing the IR lowering on this target
0.573
Analysis
- Work toward affording parallel type checking
- The interface to
LazyType
has changed:LazyType
now takes a second callback that is passed theLazyType&
itself. This new callback is responsible for populating the fieldTypeId LazyType::unwrapped
. Multithreaded implementations should acquire a lock in this callback. - Modules now retain their
humanReadableNames
. This reduces the number of cases where type checking has to call back to aModuleResolver
.
- The interface to
- Add prefix and name location to AstTypeReference by @JohnnyMorganz in #902
- Add timing info to the Luau REPL compilation output
New type solver
- Thread ICEs (Internal Compiler Errors) back to the Frontend properly
- Refinements are no longer applied to lvalues
- More miscellaneous stability improvements
JIT
- Implement register spilling/restore for A64
- Correct Luau IR value restore location tracking
- Fixed use-after-free in x86 register allocator spill restore
- Use btz for bit tests
- Finish branch assembly support for A64
- Codesize and performance improvements for A64
- The bit32 library has been implemented for arm and x64