4 ms·
Qt refused for almost a decade to support deserializing 64-bit integers from JSON because of compatibility concerns.
by GrayShade 2y ago
Qt refused for almost a decade to support deserializing 64-bit integers from JSON because of compatibility concerns.
- Spivak 2y agojq couldn't handle them until relatively recently. This isn't a few bad parsers. You can't assume a json parser will handle bigints correctly and when you're angling to be low-level plumbing and work with every language and software that hasn't been recompiled in years you have to be pretty conservative in what you send.
- capitainenemo 2y agoYeah, and it isn't like jq is being incorrect in this, the JSON RFCs recommend not using values that can't be represented as a 64 bit float (pasted links to a few RFCs in another response). So if you want to represent a large number safely, better to put it in a string, where special handling can be done after the initial JSON parse without loss of information.
- GrayShade 2y agoNo, it doesn't. It's not a SHOULD. And why should Qt be concerned with what jq can or can't do? If you're writing and reading back from Qt, the limitations of other implementations don't apply.