lua-users home
lua-l archive

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


> On 13 March 2015 at 16:21 Roberto Ierusalimschy <roberto@inf.puc-rio.br> wrote:
> 
> > That does look interesting, although we’d have to check whether it
> > is possible for us to switch to LuaJIT. The last time I looked at it
> > that was not possible for lack of 64bit integer support (unfortunately
> > Lua’s default numeric type “double” is not at all appropriate
> > to our applications, and our Lua 5.1 is configured to use int64_t
> > instead, something that Lua is well designed to handle). However it
> > seems that in the meantime LuaJIT has gained support for some boxed
> > 64bit integers, which might be good enough if well integrated…
> 
> (Out of topic) Can you give a brief explanation about why you need
> 64bit integer support? (I am writing something about the introduction
> of integers in Lua 5.3, and it would be good to have some more concrete
> examples of why people need 64bit integers.)

We have multiple places where 32bit integers are not sufficient, for example time values (think microseconds since 1970), some
statistics where 32bits can easily overflow, and some network protocols that we access from Lua have 64bit integer fields.

(And while some of these integer use cases could fit into 64bit floating point variables, we really don't want to start using
floating point to model integer values, in particular in an application that doesn't use floating point anywhere else.)

After give-or-take a decade of working on 64bit machines I don't even want to think about whether something fits into 32bits :-)


Now regarding my initial question, do you have any intuition regarding how much is missing for making Lua exception safe? Is it just
some small detail that could be fixed with a small change, or does it require extensive reworking?

I have studied the Lua source code on various occasions, and successfully changed a few things, but haven't grokked some of the
overall concepts sufficiently well to answer this question myself.

Thanks, Colin