lua-users home
lua-l archive

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

On Jul 9, 2013, at 6:37 AM, Roberto Ierusalimschy <> wrote:

Sure. The idea is that the default would be 64-64, but restricted systems
probably will prefer 32-32. (Moreover, systems with no 64-bit integers
at all can use either 32-32 or 32-64).

Currently, the problem is even worse, as many people use Lua without
floating-point numbers. Mostly, we just ignore those uses (it is not
"official" Lua) and pretend the problem does not exist. We hope the
32-32 option will allow many programmers in embedded systems to have
a non-standard but officialy supported version of Lua, with 32-bit
integers for performance and floating-point numbers when necessary.

Just so I understand, what was the rationale for choosing 64 over 32 as the integer size? I was a little surprised by that given that integers would seem most useful on more restricted platforms where 64-bit integer is still (moderately) expensive (and also even that many "64-bit" OSes are compiled with 32-bit integers, such as OS X).

I suppose I was expecting something more like a 32-bit integer that would seamlessly overflow into a regular double if necessary.