3 ms·
Wow - surprised it's only just getting bitwise operators ... are they not commonly required in systems that tend to embed Lua? Thinking about Redis bitmaps, th
by philjohn 12y ago
Wow - surprised it's only just getting bitwise operators ... are they not commonly required in systems that tend to embed Lua?
Thinking about Redis bitmaps, they could be very useful when available in the scripting context/
- theseoafs 12y agoWell, Lua is only just now getting integers. Bitwise operations don't really make that much sense when you only have access to floats.
- dottrap 12y agoAdditional clarification. The integer reason was the main reason it wasn't in the language, but various libraries have always been available to do bitwise operations. Lua 5.2 included a bitwise library as part of the standard library (which is now redundant and deprecated). As a library, there were edge cases such as what if you used the number as floating point or what happens with 64-bit. Now with integers, bitwise operations can be put directly into the language instead as a library.
- aDevilInMe 12y agoThere have been a number of bit modules developed by 3rd party developers, including LuaJIT's Mike Pall, in addition to 5.2 which had bit functions. However, the bit functions were slow and a dog to use.