Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

You are mixing up two different standards here, JSON and I-JSON. I-JSON is a subset of JSON with stricter requirements.

JSON recommends (for interoperability) that numbers be limited to those representable as IEEE 64-bit binary floats-but does not require that. A document which ignores that recommendation is still officially valid JSON. By contrast, I-JSON, as a subset of JSON, upgrades that recommendation to a requirement, so documents which ignore it are not valid I-JSON



Yes, they are different standards, but the purpose of I-JSON was specifically to solve interoperability problems. Those interoperability problems are due to the looseness of the original spec.

The others do not forbid larger numbers but note that doing that will make for bad times, and if you look at JSON parsing matrices (say, the "Parsing JSON is a Minefield" one), you can see that the majority of implementations do not do allow larger. So. float64 is a defacto standard and I-JSON is simply clarifying this. Given the main purpose of JSON is an interoperable data exchange format it would be a very bad idea to do otherwise.

https://en.wikipedia.org/wiki/JSON?useskin=vector#Interopera... (essentially same point made here)




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: