3 ms·
The big features for 5.3 are: - Basic UTF-8 library - Bitwise operators - Integers http://www.lua.org/work/doc/#changes http://www.lua.org/work/doc/#cha
by wbond 12y ago
The big features for 5.3 are:
- Basic UTF-8 library
- Bitwise operators
- Integers
http://www.lua.org/work/doc/#changes http://www.lua.org/work/doc/#changes
- JasonFruit 12y agoBitwise operators are a huge improvement in the language; many criticisms of Lua focus on the lack thereof — I think the phrase I remember compared writing low-level bit operations in Lua to "carving code out of raw silicon." It sounds funny, though, to have version 5.3 of a language add integers.
- sigzero 12y agoI don't think they are adding integers. According to the readme integers are now 64bit by default.
- koenigdavidmj 12y agoEverything was floating-point up until now, which plays nicely with integers...but only until 2^53 or thereabouts.
- dragonwriter 12y agoSounds like another, somewhat more popular language...
- eslaught 12y agoPreviously, all Lua numbers were doubles. You could fit a 32-bit int into a double without trouble, and maybe the interpreter would even have an optimization for that internally, but at least conceptually, Lua never distinguished between floating point and integer values (e.g. type(1.4) and type(4) would both produce "number").
- astrobe_ 12y agoThere was previously a compile-time option to use integers instead of doubles.
- virtue3 12y agoyes, and it was a complete nightmare dealing with that from the C side sometimes :/... sooo much conditional type casting :(
- otoburb 12y agoPrior to this release there was the option of using Mike Pall's (LuaJIT developer) BitOp C extension module[1] for Lua 5.1/5.2 if one wanted a cleaner way of performing bitwise operations. [1] http://bitop.luajit.org/ http://bitop.luajit.org/
- justincormack 12y agoLua 5.2 has bit operations too, but they are functions not operators.
- haberman 12y agoIt's unfortunate IMO that Lua didn't just adopt BitOp and its semantics. The different decisions made by the core Lua developers did not seem compelling to me. For example, one of the differences is that you can shift by a negative number with Lua (making the shift go in the opposite direction). Who ever needs to do that? This was all discussed at length on the lists, I don't have a link handy though.