lua-users home
lua-l archive

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

On 09/07/2013 18.08, Todd Coram wrote:

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!


I suppose such data manipulation often requires treating ints as unsigned quantities, therefore a bit64 library would be necessary (in a previous post Roberto said its realization is probable).

I wonder how the already present bit32 lib would interact with all this. bit32, bit64, automatic int management,... it seems it may lead to source code (Lua side) complexity.

How would the implementation react if Lua is compiled with 32bit ints? Would bit64 be defined? Would it emulate 64 bit ops on 32 bit ints? Or would it behave as bit32? Would be possible/feasible/convenient to have just a "plain" "bit" library that can adapt *at run-time* to the different compiled-in interpreter settings? If one would ensure portability of Lua code a mechanism should be provided for a Lua script to query the interpreter about the current int width, otherwise scripts would be relegated to be run with an interpreter with specific compile-time settings.

Just random ramblings...


-- Lorenzo

()  ascii ribbon campaign - against html e-mail
/\   - against proprietary attachments