Update compatibility.md

Add a note about Lua 5.3 change to semantics of __eq/__lt/__le metamethods.

We currently do not plan to implement this as this breaks backwards compatibility and makes these operators harder to reason about from the type checking perspective.

Fixes #1051.
This commit is contained in:
Arseny Kapoulkine 2023-10-03 07:08:31 -07:00 committed by GitHub
parent 2a3a030341
commit 57511faa7d
Signed by: DevComp
GPG key ID: 4AEE18F83AFDEB23

View file

@ -92,7 +92,8 @@ Ephemeron tables may be implemented at some point since they do have valid uses
| new function `table.move` | ✔️ | |
| `collectgarbage("count")` now returns only one result | ✔️ | |
| `coroutine.isyieldable` | ✔️ | |
| stricter error checking for `table.insert`/`table.remove` | 😞 | we love this, but it breaks compatibility
| stricter error checking for `table.insert`/`table.remove` | 😞 | we love this, but it breaks compatibility |
| `__eq`/`__le`/`__lt` metamethods are called for unrelated metatables | ❌ | backwards compatibility and typechecking implications |
It's important to highlight integer support and bitwise operators. For Luau, it's rare that a full 64-bit integer type is necessary - double-precision types support integers up to 2^53 (in Lua which is used in embedded space, integers may be more appealing in environments without a native 64-bit FPU). However, there's a *lot* of value in having a single number type, both from performance perspective and for consistency. Notably, Lua doesn't handle integer overflow properly, so using integers also carries compatibility implications.