Page 1 of 1

Suggestion: Add support of BigInt for the Long values

Posted: 03 May 2018, 07:00
by arodrigo
Hi,

Chrome already supports it, and firefox its going to add it (right know can be activated as experiment).

https://developers.google.com/web/updat ... /05/bigint

It could be awesome the possibility of use it on the long values at least as a experimental feature on the client.

Regards

Re: Suggestion: Add support of BigInt for the Long values

Posted: 05 May 2018, 07:22
by Lapo
Thanks, we'll look into it.
One problem I foresee is that JS doesn't treat numbers using the standards of other languages (C#, Java, etc...) and this can make compatibility awkward.
BigInt can partially emulate what a "long" does in C# and Java but it's arbitrarily big, while those types are limited to 64 bits.
C# and Java also supports larger numbers with types such as BigInt but I don't think these types conform to any standard. In other words they are pretty hard to convert across languages.

To avoid all these issues, and given the infrequent use of these types, we usually recommend to send them around as strings or, even better, as binary (language conversions permitting).

Cheers