Skip to content

Releases: luau-lang/luau

0.598

06 Oct 19:40
36e0e64
Compare
Choose a tag to compare

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 with continue statement when until expression refers to constants #1042
  • Fix repeat..until loops with continue 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

Full Changelog: 0.597...0.598

0.597

30 Sep 01:20
1d0b449
Compare
Choose a tag to compare

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 and Unifier.
  • 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] in a[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 define DOCTEST_CONFIG_USE_GMTIME_S to build and run unit tests on those platforms.

Full Changelog: 0.596...0.597

0.596

22 Sep 19:26
16fbfe9
Compare
Choose a tag to compare

What's Changed

  • Support Control Flow type Refinements for "break" and "continue" statements by @AmberGraceSoftware in #1004
  • The old type unification engine will now report a more fine-grained error at times, indicating that type normalization in particular failed

New Type Solver

  • Refactor of Unifier2, the new unification implementation for Luau
  • Completed MVP of new unification implementation
  • Dramatically simplified overload selection logic
  • Type family reduction can now apply sooner to free types that have been solved
  • Subtyping now supports table indexers
  • Generalization now replaces bad generics with unknown

Native Code Generation

  • Reduce stack spills caused by FINDUPVAL and STORE_TAG
  • Generate SHL/SHR/SAR/rotates with immediate operands in X64
  • Removed redundant case re-check in table lookup fallback

New Contributors

Full Changelog: 0.595...0.596

0.595

15 Sep 17:33
31a017c
Compare
Choose a tag to compare

What's new

  • Rerun clang-format on the code
  • Fix the variance on indexer result subtyping. This fixes some issues with inconsistent error reporting.
  • Fix a bug in the normalization logic for intersections of strings
  • Demo site: case sensitive highlighting by @Someon1e in #1040

New Type Solver

  • New overload selection logic
  • Subtype tests now correctly treat a generic as its upper bound within that generic's scope
  • Semantic subtyping for negation types
  • Semantic subtyping between strings and compatible table types like {lower: (string) -> string}
  • Further work toward finalizing our new subtype test
  • Correctly generalize module-scope symbols

Native Codegen

  • Lowering statistics for assembly
  • Make executable allocation size/limit configurable without a rebuild. Use FInt::LuauCodeGenBlockSize and FInt::LuauCodeGenMaxTotalSize.

New Contributors

Full Changelog: 0.594...0.595

0.594

08 Sep 00:25
c7c986b
Compare
Choose a tag to compare

Analysis Changes

  • Fixed generic variadic function unification succeeding when it should have reported an error

Other Changes

  • Fixed Frontend::markDirty not working on modules that were not typechecked yet
  • Fix build & test conformance issues on mingw32/gcc and mingw64/clang by @jdpatdiscord in #1023
  • Update syntax.md by @zeux in #1035

New Type Solver

  • Implemented semantic subtyping check for function types

Native Code Generation

  • Improved performance of numerical loops with a constant step
  • Simplified IR for bit32.extract calls extracting first/last bits
  • Improved performance of NaN checks

0.593

01 Sep 18:10
551a43c
Compare
Choose a tag to compare

Floor division operator //

Luau now supports floor division operator //; by default it works on numbers and is equivalent to math.floor(a / b), but it can also be overridden for other types using __idiv metamethod. The operator has the same syntax and semantics as // in Lua 5.3; see #832 for full RFC.

Analysis Changes

  • Autocomplete now shows end within do blocks
  • Restore BraceType when using Lexer::lookahead (fixes #1019)

New Type Solver

  • Enhance subtyping tests to support metatables, string singletons, and class types

Native Codegen

  • Fixed clobbering of non-volatile xmm registers on Windows
  • Optimize redundant table slot lookups
  • Improve value propagation optimizations to work across basic blocks in some cases
  • Implemented IR translation of table.insert builtin
  • Fixed mmap error handling on macOS/Linux

0.592

25 Aug 17:34
ce9414c
Compare
Choose a tag to compare

Analysis Changes

  • Improved parsing error messages
  • Fixed crash on null pointer access in unification (fixes #1017)

Other Changes

  • AST queries at position where function name is will now return AstExprLocal
  • Lexer performance has been slightly improved
  • Fixed incorrect string singleton autocomplete suggestions (fixes #858)
  • Native code support is enabled by default and native=1 (make)/LUAU_NATIVE (CMake)/-DLUA_CUSTOM_EXECUTION configuration is no longer required

New Type Solver

  • New subtyping check can now handle generic functions and tables (including those that contain cycles)

Native Codegen

  • Loops with non-numeric parameters are now handled by VM to streamline native code
  • Array size check can be optimized away in SETLIST
  • On failure, CodeGen::compile returns a reason
  • Fixed clobbering of non-volatile xmm registers on Windows

0.591

18 Aug 18:25
e25b0a6
Compare
Choose a tag to compare

What's Changed

  • LinterConfig.h: add missing stdint.h include by @xgqt in #1010
  • Fix a use-after-free bug in the new type cloning algorithm
  • Tighten up the type of coroutine.wrap. It is now <A..., R...>(f: (A...) -> R...) -> ((A...) -> R...)
  • Break .luaurc out into a separate library target Luau.Config. This makes it easier for applications to reason about config files without also depending on the type inference engine.
  • Move typechecking limits into FrontendOptions. This allows embedders more finely-grained control over autocomplete's internal time limits.
  • Fix a stability issue with debugger debugprotectederror callback allowing break in non-yieldable contexts

New Type Solver

  • Initial work toward Local Type Inference
  • Introduce a new subtyping test. This will be much nicer than the old test because it is completely separate both from actual type inference and from error reporting.

Native Code Generation

  • Added function to compute iterated dominance frontier
  • Optimize barriers in SET_UPVALUE when tag is known
  • Cache lua_State::global in a register on A64
  • Optimize constant stores in A64 lowering
  • Track table array size state to optimize array size checks
  • Add split tag/value store into a VM register
  • Check that spills can outlive the block only in specific conditions

New Contributors

Full Changelog: 0.590...0.591

0.590

11 Aug 15:26
d98256b
Compare
Choose a tag to compare

Analysis Changes

  • Better indentation in multi-line type mismatch error messages
  • Error message clone can no longer cause a stack overflow (when typechecking with retainFullTypeGraphs set to false); fixes #975

Runtime Changes

  • string.format with %s is now ~2x faster on strings smaller than 100 characters

Other Changes

Native Codegen

  • All VM side exits will block return to the native execution of the current function to preserve correctness
  • Fixed executable page allocation on Apple platforms when using hardened runtime
  • Added statistics for code generation (no. of functions compiler, memory used for different areas)
  • Fixed issue with function entry type checks performed more that once in some functions

New Contributors

Full Changelog: 0.589...0.590

0.589

04 Aug 19:46
0b2755f
Compare
Choose a tag to compare

Analysis Changes

  • Progress toward a diffing algorithm for types. We hope that this will be useful for writing clearer error messages.
  • Add a missing recursion limiter in Unifier::tryUnifyTables. This was causing a crash in certain situations.

Runtime Changes

  • Luau heap graph enumeration improvements:
    • Weak references are not reported
    • Added tag as a fallback name of non-string table links
    • Included top Luau function information in thread name to understand where thread might be suspended
  • Constant folding for math.pi and math.huge at -O2
  • Optimize string.format and %*
    • This change makes string interpolation 1.5x-2x faster depending on the number and type of formatted components, assuming a few are using primitive types, and reduces associated GC pressure.

Other changes

New type checker

  • Initial work toward tracking the upper and lower bounds of types accurately.

Native code generation (JIT)

  • Add IrCmd::CHECK_TRUTHY for improved assert fast-calls
  • Do not compute type map for modules without types
  • Capture metatable+readonly state for NEW_TABLE IR instructions
  • Replace JUMP_CMP_ANY with CMP_ANY and existing JUMP_EQ_INT
  • Add support for exits to VM with reentry lock in VmExit

New Contributors

Full Changelog: 0.588...0.589