As of today, the Lua 5.3 runtime has been removed from Canary and will be removed from all release channels on our next production release date. The Lua 5.4 runtime has been updated to the latest version (5.4.8).
Anyone who uses Lua scripts may be affected: although Lua 5.4 is generally backwards compatible with Lua 5.3, there are some small differences between them:
Known Incompatibilities
Incompatibilities in the Language
-
The coercion of strings to numbers in arithmetic and bitwise operations has been removed from the core language. The string library does a similar job for arithmetic (but not for bitwise) operations using the string metamethods. However, unlike in previous versions, the new implementation preserves the implicit type of the numeral in the string. For instance, the result of
"1" + "2"now is an integer, not a float. -
Literal decimal integer constants that overflow are read as floats, instead of wrapping around. You can use hexadecimal notation for such constants if you want the old behavior (reading them as integers with wrap around).
-
The use of the
__ltmetamethod to emulate__lehas been removed. When needed, this metamethod must be explicitly defined. -
The semantics of the numerical for loop over integers changed in some details. In particular, the control variable never wraps around.
-
A label for a goto cannot be declared where a label with the same name is visible, even if this other label is declared in an enclosing block.
-
When finalizing an object, Lua does not ignore
__gcmetamethods that are not functions. Any value will be called, if present. (Non-callable values will generate a warning, like any other error when calling a finalizer.)
Incompatibilities in the Libraries
-
json.decodeno longer accepts square brackets, unkeyed values, or numbers as keys. -
The function print does not call
tostringto format its arguments; instead, it has this functionality hardwired. You should use__tostringto modify how values are printed. -
The pseudo-random number generator used by the function
math.randomnow starts with a somewhat random seed. Moreover, it uses a different algorithm. -
By default, the decoding functions in the
utf8library do not accept surrogates as valid code points. An extra parameter in these functions makes them more permissive. -
The options
“setpause”and“setstepmul”of the functioncollectgarbageare deprecated. You should use the new option“incremental”to set them. -
The function
io.linesnow returns four values, instead of just one. That can be a problem when it is used as the sole argument to another function that has optional parameters, such as inload(io.lines(filename, "L")). To fix that issue, you can wrap the call into parentheses, to adjust its number of results to one.
We also recommend reading the Lua 5.4 changelog for more information.
This update helps to ensure better performance and long-term maintainability. Deprecating older versions also reduces fragmentation and helps us support the latest tooling and security updates.
If you find any breaking changes or have any additional feedback on this change, please head over to our Discord server to let us know.

