lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


On Tue, Jul 09, 2013 at 12:08:04PM -0400, Todd Coram wrote:
<snip>
> I too am very happy to see what 5.3 is doing with ints. When I do data
> encoding/decoding protocol work (e.g. Google Protocol Buffers, BSON,
> etc), it would be very nice ?to properly handle 64 bit integers in pure
> Lua. This will go a long way to making Lua a first class player in data
> protocol manipulation!

One quibble: most protocols sanely use unsigned integers. A signed 64-bit
integer is 1 bit too short, and generally speaking you're not much better
off than with floating point doubles and the bit32 library.

Some protocols invented by Java developers use signed integers, which as a C
programmer is incredibly annoying, because when parsing potentially corrupt
or malicious data unsigned overflow provides useful side-effects, and
generally speaking simplifies many things.