Skip to content

Releases: luau-lang/luau

0.588

28 Jul 15:24
76f67e0
Compare
Choose a tag to compare

Analysis and Autocomplete Changes

  • Luau::autocomplete no longer performs typechecking internally, make sure to run Frontend::check before performing autocomplete requests
  • Autocomplete string suggestions without "" are now only suggested inside the ""
  • Autocomplete suggestions now include function (anonymous autofilled) key with a full suggestion for the function expression (with arguments included) stored in AutocompleteEntry::insertText
  • AutocompleteEntry::indexedWithSelf is provided for function call suggestions made with :
  • Cyclic modules now see each other type exports as any to prevent memory use-after-free (similar to module return type)

Runtime Changes

  • Updated inline/loop unroll cost model to better handle assignments (Fixes #978)
  • math.noise speed was improved by ~30%
  • table.concat speed was improved by ~5-7%
  • tonumber and tostring now have fastcall paths that execute ~1.5x and ~2.5x faster respectively (Fixes #777)
  • Fixed crash in luaL_typename when index refers to a non-existing value
  • Fixed potential out of memory scenario when using string.sub or string.char in a loop
  • Fixed behavior of some fastcall builtins when called without arguments under -O2 to match original functions
  • Support for native code execution in VM is now enabled by default (note: native code still has to be generated explicitly)
  • CodeGen::compile now accepts CodeGen_OnlyNativeModules flag. When set, only modules that have a --!native hot-comment at the top will be compiled to native code

Other Changes

New Type Solver

  • Generic type packs are no longer considered to be variadic during unification
  • Timeout and cancellation now works in new solver
  • Fixed false positive errors around 'table' and 'function' type refinements
  • Table literals now use covariant unification rules. This is sound since literal has no type specified and has no aliases
  • Fixed issues with blocked types escaping the constraint solver
  • Fixed more places where error messages that should've been suppressed were still reported
  • Fixed errors when iterating over a top table type

JIT

  • 'DebugLuauAbortingChecks' flag is now supported on A64
  • LOP_NEWCLOSURE has been translated to IR

New Contributors

0.584

14 Jul 21:22
2181591
Compare
Choose a tag to compare

What's Changed

  • Added support for async typechecking cancellation using a token passed through frontend options
  • Added luaC_enumheap for building debug tools that need a graph of Luau heap

New Type Solver

  • Errors are now suppressed when checking property lookup of error-suppressing unions

JIT

  • Fixed unhandled value type in NOT_ANY lowering
  • Fast-call tag checks will exit to VM on failure, instead of relying on a native fallback
  • Added vector type to the type information
  • Eliminated redundant direct jumps across dead blocks
  • Debugger APIs are now disabled for call frames executing natively
  • Implemented support for unwind registration on macOS 14

0.583

07 Jul 20:21
e25de95
Compare
Choose a tag to compare

What's Changed

  • Fix indexing table intersections using x["prop"] syntax by @JohnnyMorganz in #971
  • Add console output codepage for windows by @imlodinu in #967
  • Added Frontend::parse for a fast source graph preparation
  • luau_load should check GC
  • Work toward a type-diff system for nicer error messages

New Type Solver

  • Correctly suppress errors in more cases
  • Further improvements to typechecking of function calls and return statements
  • Crash fixes
  • Propagate refinements drawn from the condition of a while loop into the loop body

JIT

  • Fix accidental bailout for math.frexp/modf/sign in A64
  • Work toward bringing type annotation info in
  • Do not propagate Luau IR constants of wrong type into load instructions
  • CHECK_SAFEENV exits to VM on failure
  • Implement error handling in A64 reg allocator
  • Inline the string.len builtin
  • Do not enter native code of a function if arguments don’t match

New Contributors

  • @imlodinu made their first contribution in #967

Full Changelog: 0.582...0.583

0.582

24 Jun 06:25
76bea81
Compare
Choose a tag to compare

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

16 Jun 17:45
d458d24
Compare
Choose a tag to compare

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

09 Jun 19:27
3ecd3a8
Compare
Choose a tag to compare

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

02 Jun 19:57
63679f7
Compare
Choose a tag to compare

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

25 May 22:01
271c509
Compare
Choose a tag to compare

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

19 May 21:00
721f6e1
Compare
Choose a tag to compare

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

Full Changelog: 0.576...0.577

0.576

12 May 18:30
97965c7
Compare
Choose a tag to compare

Analysis Changes

  • ClassType can now have an indexer defined on it. This allows custom types to be used in t[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 in ExperimentalFlags.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