-
Notifications
You must be signed in to change notification settings - Fork 16
Add lua 5.3 support #22
base: master
Are you sure you want to change the base?
Conversation
Bignum test now fails in 5.1 and 5.2. |
Some #ifdef might be needed for 5.1 (and 5.2 if int64 modules works with 5.2). |
Found some examples of travis.yml with Lua 5.3 and a few other versions here: |
I now use 'hererocks' in all my lua projects. Changing that over belongs in a different PR to this one though. |
IMO the current int64 code is misled:
I'd like to just drop it: any reason not to should be grounded in deployed code that relies on the (unreleased) behaviour in git HEAD. |
The main purpose of int64 - is using postgres bigint, I see that int64 code is unnecessary for lua5.3, but what about 5.1 and luajit? |
Correct, but adding a second int64 type when luajit already has one in the core seems incorrect to me.
Why not just recommend using lua 5.3 if you want to use bigint?
It's not easy to push a luajit int64_t. local ffi = require "ffi"
local int64_t = ffi.typeof("int64_t")
return function(c)
return ffi.cast(int64_t, c)[0]
end and call it to push an |
@daurnimator @eugwne: Kudos on the work. Where did we land on this? |
I've pushed an updated branch. We still don't have a codepath that takes advantage of luajit's numbers. |
Solves #20
Notably this removes the int64 module
In 5.1 and 5.2, values with more than 53 bits of precision will be rounded.
However there has not been a release with any more than 32bits of precision (the int64 module has not been in any releases)