Lua 5.3 (2015-01-12) added the bitwise operators:
https://www.lua.org/versions.html#5.3
https://www.lua.org/manual/5.3/manual.html#3.4.2
Looks like LuaJIT is catching up, but calling these "syntax extensions" is confusing. Is the intent to hold LuaJIT fixed against some earlier Lua version (I guess 5.1) and adopt newer syntax piecemeal?
I welcome the compound assignment operators. Playdate's version of Lua also has that extension.
> Is the intent to hold LuaJIT fixed against some earlier Lua version (I guess 5.1)
Yeah. PUC-Rio went in a direction that Mike Pall didn't want to follow. Something to do with garbage collector finalizers, if I remember correctly, which is a notoriously thorny issue in every language it exists.
LuaJIT is an involuntary fork of 5.1. It already had various extensions that conflicted with the 5.2 implementation of the same features, and Mike Pall made it clear on the mailing list he wasn't going to change how LuaJIT worked.
I wouldn't be surprised if their plan is to keep compatible with 5.1 and adopt newer features where feasible/compatible. Luau, another language with the explicit goal of extending Lua 5.1 in a compatible way, has a section in their documentation listing all newer Lua features and detailing why they chose to or not to adopt them <https://luau.org/compatibility/>. The needs of Luau and LuaJIT are different though the reasoning is nonetheless fascinating.