Releases: luau-lang/luau
Releases · luau-lang/luau
0.512
Analysis changes
- Improve refinement support for unions, in particular it's now possible to implement tagged unions as a union of tables where individual branches use a string literal type for one of the fields.
- Fix
string.split
type information
Runtime changes
- Optimize
select(_, ...)
to run in constant time (~2.7x faster on VariadicSelect benchmark) - Improve debug line information for multi-line assignments
- Improve compilation of table literals when table keys are constant expressions/variables
- Use forward GC barrier for
setmetatable
which slightly accelerates GC progress
CLI changes
- Repl now uses
_PRETTYPRINT
if available to print expression values instead ofprint
Community contributions
- luau-analyze: Add support for reading source code from stdin by @vladmarica in #325
0.511
Analysis changes
- TableOperations lint now includes a warning for
table.create(N, {})
(which is likely a mistake since the table is shared by all entries) - Type checker now type checks #v when v is a union
- Parser now rejects sources that consists of a single unfinished long comment (fixes #312)
Runtime changes
- Work around significant MSVC 2022 performance regression, bringing it more or less in line with MSVC 2019
- Compiler now predicts array size for newly allocated tables when the table is filled in a short loop
- Small improvements in compilation throughput (~2% faster)
- Implement paged sweeper for GC which improves sweep throughput 2-3x and reduces memory consumption by 8 bytes per object (once it is stabilized we will see additional 8 bytes per object of savings)
CLI changes
- Improve Repl Tab completion
- Repl now supports -i (interactive mode to run code in context of a script's environment) and -On (to control optimization flags)
Community contributions
- Fix some mistakes in the documentation by @Halalaluyafail3 in #314
- Improve Grammar documentation by @JohnnyMorganz in #315
- Update copyright years. by @SnowyShiro in #323
0.510
Analysis changes
- Implement support for default generic arguments (RFC #61)
- Table literals are now unsealed by default, allowing more correct programs to type check in strict mode (RFC #276)
- Improve type checking in certain contexts when the target type is known
- Type checking now allows for different types in different branches of
if-then-else
expression, and returns a union of all types - Type checking large module graphs now consumes less memory
- Fix type checking crashes with recursive metatables
Community contributions
- MSVC warning C4244 fixes by @rafabr34 in #308
- Update compatibility.md to mark coroutine.close as supported by @metatablecat in #309
0.509
Analysis changes
- Rework transaction log used for type checking which should result in more robust type checking internals with fewer bugs
- Improve refinement of complex expressions to propagate types through lookup chains like
foo and foo.bar and foo.bar.baz
- Reduce the amount of memory consumed by type checker on large module graphs
- Type checker now errors on attempts to change the type of imported module fields
- The return type of
newproxy
is nowany
(#296) - Fix error locations for type errors in string.format arguments
Runtime changes
- Make
tonumber(x)
~2x faster by avoiding reparsing string arguments - Implement new number printing algorithm (Schubfach) which makes
tostring(number)
produce precise (round-trippable) and short decimal output up to 10x faster - Fix
lua_Debug::linedefined
to point to the line with the function definition instead of the first statement (#265)
CLI changes
- Fix minor bugs in Tab completion in Repl
- Repl now saves/restores command history in ~/.luau_history
Community contributions
- Add CodeMirror Editor for Web demo by @MathematicalDessert in #228
0.507
Analysis changes
- Type ascription (::) now permits casts between related types in both directions, allowing to refine or loosen the type (RFC #56)
- Fix type definition for tonumber to return number? since the input string isn't guaranteed to contain a valid number
- Fix type refinements for field access via []
- Many stability fixes for type checker
- Provide extra information in error messages for type mismatches in more cases
- Improve performance of type checking for large unions when union members are string literals
Runtime changes
- Fix some C APIs like
lua_equal
orlua_getfield
triggering GC assertions in presence of metatables - Add
lua_getcoverage
API for code coverage collection - Improve performance of truthiness checks in some cases, particularly on Apple M1, resulting in 10-25% perf gains on qsort benchmark depending on the CPU/compiler
- Fix support for little-endian systems; IBM s390x here we go!
CLI changes
- Add coverage reporting support to Repl (--coverage command line argument)
- Add shebang support by @Rerumu in #149
- Work around code signing issues during Makefile builds on macOS
Community contributions
- Fix Json Encoding for AstArray by @xgladius in #279
- Add Grammar documentation by @JohnnyMorganz in #266
0.506
Changes
- Fix some cases where type checking would overflow the native stack
- Improve autocomplete behavior when assigning a partially written function call (not currently exposed through command line tools)
- Improve autocomplete type inference feedback for some expressions where previously the type would not be known
- Improve quantification performance during type checking for large types
- Improve type checking for table literals when the expected type of the table is known because of a type annotation
- Fix type checking errors in cases where required module has errors in the resulting type
- Fix debug line information for multi-line chained call sequences (#255)
- lua_ref can no longer be used with LUA_REGISTRYINDEX to prevent mistakes when migrating Lua FFI (#247)
- Fix assertions and possible crashes when executing script code indirectly via metatable dispatch from lua_equal/lua_lessthan/lua_getfield/etc. (#259)
- Fix flamegraph scripts to run under Python 2
Community contributions
- Add luaL_checkboolean and luaL_optboolean by @MathematicalDessert in #221
- Expand vectors to 4 components using compile time switch by @petrihakkinen in #214
- Removed LUALIB_API from source file method bodies by @KaleidoDeer in #235
- Add LUA_GCCOUNTB option for lua_gc by @petrihakkinen in #254
- Fix luaL_sandbox leaving a value on the stack by @petrihakkinen in #253
- Allow reconfiguring VM defaults via build defines by @kunitoki in #260
- Fix luau_load 'env' to work with absolute stack index & add lua_absindex by @petrihakkinen in #263
- Add lua_isvector, luaL_checkvector and luaL_optvector by @petrihakkinen in #261
Breaking changes
This release introduces a small breaking change in lua.h (only relevant for embedders) to improve compatibility with Lua/LuaJIT:
lua_newuserdata
now takes 2 arguments;lua_newuserdatatagged
should be used if the third argument was non-0.
0.505
Changes
- Improve error recovery during type checking
- Initial (not fully complete) implementation for singleton types (RFC #37)
- Implement a C-friendly interface for compiler (luacode.h)
- Remove C++ features from lua.h (removed default arguments from
luau_load
andlua_pushcfunction
) - Fix
lua_breakpoint
behavior when enabled=false - Implement
coroutine.close
(RFC #88)
Community Contributions
- fix unable to find library -lpthread by @leleliu008 in #203
Breaking changes
This release introduces small breaking changes in lua.h (only relevant for embedders):
luau_load
env argument is now required, pass an extra 0lua_pushcfunction
now must be called with 3 arguments; if you were calling it with 2 arguments, pass an extra NULL; if you were calling it with 4, uselua_pushcclosure
.
These changes are necessary to make sure lua.h can be used from pure C - the future release will make it possible by adding an option to luaconf.h to change function name mangling to be C-compatible. We don't anticipate breaking the FFI interface in the future, but this change was necessary to restore C compatibility.
0.504
Changes
- Type mismatch errors now show detailed information for compound types, highlighting the mismatching component
- Fix string.pack bug on ARM when packing negative numbers using unsigned formats (#171)
- Implement bit32.countlz/countrz (RFC #89)
- Minor compiler throughput optimization (~2% faster compilation)
- Improve transpiler behavior for edge cases and better test coverage (not exposed through CLI at the moment)
- Improve error recovery when parsing invalid assignments
- Build fixes for fuzzing targets
- Add
lua_getthreaddata
/lua_setthreaddata
to be able to associate custom data with coroutines
Community contributions
- Fold length operations when argument is a constant string by @bmcq-0 in #141
- Look for
.luau
before.lua
in REPL & Analyze (#97) by @Kittenz in #124 - Fix CLI analysis reporting wrong file names by @Rerumu in #146
- Add userdata to lua_Callbacks by @LoganDark in #168
- Don't allow registry to be set to readonly by @LoganDark in #184
- Remove Roblox-specific mutable globals by @LoganDark in #185
- Save bytecode to file through CLI by @NotDSF in #170
- Feature: Web REPL using Emscripten by @MathematicalDessert in #138
- Fixes IFTODT error while compiling from an android device by @ThePotato97 in #199
0.503
Changes
- Support for time tracing for analysis/compiler (not currently exposed through CLI)
- Support for type pack arguments in type aliases (RFC: Type alias type packs #83)
- Basic support for require(path) in luau-analyze
- Add a lint warning for table.move with 0 index as part of TableOperation lint
- Remove last STL dependency from Luau.VM
- Minor VS2022 performance tuning
- Major optimizations to type checking performance on complex programs/types (up to two orders of magnitude speedup for programs
involving huge tagged unions) - Fix a few issues encountered by UBSAN
- Fix gcc-11 test builds
- Fix a rare corner case where luau_load wouldn't wake inactive threads which could result in a use-after-free due to GC