3 ms·
Lua has had true integers (and binary operators) since version 5.3, released in January of 2015.
by spc476 6y ago
Lua has had true integers (and binary operators) since version 5.3, released in January of 2015.
- capitainenemo 6y agoYeah, but adoption is slow. Nonetheless, looking forward to it. Hedgewars uses deterministic lockstep, and the various creative ways in which floating point is calculated really mess up games like this. 0AD and Spring discovered this in the past as well - so the result is scripters have to be very careful when using math, and Hedgewars had to expose its own bitops and integer division for lua scripting. http://hedgewars.org/kb/LuaRules http://hedgewars.org/kb/LuaRules - I see someone wrote some hopefully correct guide on that last point.
- spc476 6y agoYes, Lua 5.1 was a very good version. Lua 5.2 made some significant changes in how global variables work, which lead to a split between Lua and LuaJIT [1][2]. Lua 5.3, with true integer support [3] and some UTF-8 support made for a compelling reason to update. Lua 5.4 is out now with support for a more deterministic way to release resources. I think LuaJIT being mostly stuck with Lua 5.1 is a cause for the lack up uptake on more modern versions of Lua. [1] Mike Pall, creator of LuaJIT, disagreed with the direction that Lua 5.2 went and remained with Lua 5.1 semantics. [2] I personally found Lua 5.2 a "meh" version and didn't bother upgrading. [3] Including some functions to pack and unpack integers and floats into strings, in both big-endian and little-endian formats.
- grawprog 6y agoThis was back in 5.1 and I haven't really played around with 5.3 at all. I did kind of remember reading true integers were coming to lua at some point, hence why in my post I wasn't sure if it was still the case.