Skip to content

Releases: luau-lang/luau

0.513

04 Feb 20:51
e51ff38
Compare
Choose a tag to compare

Analysis changes

  • Type checker now knows that assert(x) can't return nil (#336)
  • Fixes incorrect reuse of generic types across different function declarations (#332)
  • Improve type checker stability when working with multiple modules
  • Improve type checker stability for deeply nested expressions and complex type hierarchies

Runtime changes

  • Fix the optimization for select(_, ...) to work for negative indices

CLI changes

  • Repl now uses isocline which supports better color output and improves editing experience

Community contributions

None this week; PRs are always welcome!

0.512

28 Jan 01:34
2f989fc
Compare
Choose a tag to compare

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 of print

Community contributions

  • luau-analyze: Add support for reading source code from stdin by @vladmarica in #325

0.511

21 Jan 17:06
8fe95c9
Compare
Choose a tag to compare

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

0.510

14 Jan 16:25
32c39e2
Compare
Choose a tag to compare

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

07 Jan 01:58
d50b079
Compare
Choose a tag to compare

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 now any (#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

0.507

10 Dec 23:27
f2e6a8f
Compare
Choose a tag to compare

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 or lua_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

0.506

03 Dec 06:58
32fb6d1
Compare
Choose a tag to compare

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

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

19 Nov 16:14
3f1508c
Compare
Choose a tag to compare

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 and lua_pushcfunction)
  • Fix lua_breakpoint behavior when enabled=false
  • Implement coroutine.close (RFC #88)

Community Contributions

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 0
  • lua_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, use lua_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

12 Nov 15:08
d11e827
Compare
Choose a tag to compare

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

0.503

05 Nov 16:23
279855d
Compare
Choose a tag to compare

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

Community contributions