Releases: luau-lang/luau
Releases · luau-lang/luau
0.591
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 targetLuau.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
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
- Use
const char* const*
overconst char**
by @LoganDark in #1005 - Add luau-compile to .gitignore by @j-hui in #995
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
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
andmath.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
0.588
Analysis and Autocomplete Changes
Luau::autocomplete
no longer performs typechecking internally, make sure to runFrontend::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 inAutocompleteEntry::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
andtostring
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
orstring.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 acceptsCodeGen_OnlyNativeModules
flag. When set, only modules that have a--!native
hot-comment at the top will be compiled to native code
Other Changes
- HATRA 23 paper by @asajeffrey in #979
- README.md: Add Gentoo Linux to listed distributions by @MagelessMayhem in #976
- docs: Document return value for table.remove by @zeux in #987
- Improve demo site by @Someon1e in #990
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
- @MagelessMayhem made their first contribution in #976
- @Someon1e made their first contribution in #990
0.584
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
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
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