morpheus-graphql icon indicating copy to clipboard operation
morpheus-graphql copied to clipboard

Spec compliance: Int vs Int32

Open msvbg opened this issue 5 years ago • 2 comments

This may be a little bit picky, but the spec says that Ints are 32-bit integers. Haskell's Int type, used here, is at least a signed 30-bit integer, probably due to tagged pointer representation. (Although on my system it's a 64-bit int, and I suppose this is quite common).

For full spec compliance, the API could be changed to use Int32 from Data.Int everywhere. This might make things a little bit uglier because you would have to use Int32 everywhere, and I'm not sure about GHC implementation details but maybe Int32 is boxed on 32-bit platforms due to not being able to use the 30-bit optimization trick. Or it could be argued that this is not worth the trouble.

msvbg avatar May 11 '19 19:05 msvbg

Similarly, floats are supposed to be double precision floats.

msvbg avatar May 11 '19 21:05 msvbg

Hi. thank you for contributing! I sent invitation to you for this project

it seems not so terrible to replace it with Int32, but I will propose that we wait, anyway it is not so hard to implement.

nalchevanidze avatar May 11 '19 21:05 nalchevanidze

for about 4 years there are no more reactions about it, I think I can close.

nalchevanidze avatar Sep 30 '22 21:09 nalchevanidze