From 57511faa7deaf4c0531be4c73345465bc7903db0 Mon Sep 17 00:00:00 2001 From: Arseny Kapoulkine Date: Tue, 3 Oct 2023 07:08:31 -0700 Subject: [PATCH] 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. --- docs/_pages/compatibility.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/_pages/compatibility.md b/docs/_pages/compatibility.md index 94f8809b..da3989bd 100644 --- a/docs/_pages/compatibility.md +++ b/docs/_pages/compatibility.md @@ -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.