4 ms·
I feel like there's a missed opportunity in not calling it TySON or something like that. That aside, wouldn't it make more sense to fix the JSON parsers instea
by lillesvin 10y ago
I feel like there's a missed opportunity in not calling it TySON or something like that.
That aside, wouldn't it make more sense to fix the JSON parsers instead? They are the ones having issues parsing e.g. 64 bit integers, JSON has no problem holding them.
- Kinnard 10y agoYes! Name should totally be changed. I hope they see this.
- rpedela 10y agoI was confused by the claim that JSON parsers do not handle 64-bit integers. If the parser is written in Javascript, then it has a problem because Javascript does not support 64-bit integers. But I have not seen that problem in any other language. For example, Postgres's JSON parser can handle whatever the maximum size of PG numeric is and Python can handle extremely large numbers as well.
- bascule 10y agoFrom RFC 7159 section 6. Numbers: https://tools.ietf.org/html/rfc7159#section-6 https://tools.ietf.org/html/rfc7159#section-6 Note that when such software is used, numbers that are integers and are in the range [-(2**53)+1, (2**53)-1] are interoperable in the sense that implementations will agree exactly on their numeric values. You can't depend on interoperable support for 64-bit integers in JSON. Furthermore many JSON libraries convert all numbers to floats, so this problem doesn't affect only JavaScript. TJSON requires conforming parsers to support the full 64-bit signed and unsigned ranges. This will involve using bignums in JavaScript.
- rpedela 10y agoWhich ones besides Javascript implementations? Do you have examples?
- bascule 10y agoGo's JSON parser parses all numbers as floats, for example
- bascule 10y agoAlso note that the sinister problem here is that implementations which convert numbers to floats will silently lose precision when they overflow the range allowed in RFC 7159. This leads to quite subtle errors, and is why Twitter moved to encoding Snowflake IDs as strings: https://blog.twitter.com/2011/important-direct-message-ids-will-become-64-bit-snowflake-ids-on-sep-30 https://blog.twitter.com/2011/important-direct-message-ids-w...
- colanderman 10y agoYes, but Postgres has high standards ;) There are plenty of crappy JSON libraries out there. (I took to writing my own in C for just this reason.)
- farright 10y agoAs a woman in tech, I would feel uncomfortable using a format named after a famous rapist.