▲ | josephg a day ago | |||||||||||||||||||||||||
The funny thing about this is that JavaScript the language has had support for BigIntegers for many years at this point. You can just write 123n for a bigint of 123. JSON could easily be extended to support them - but there’s no standards body with the authority to make a change like that. So we’re probably stuck with json as-is forever. I really hope something better comes along that we can all agree on before I die of old age. While we’re at it, I’d also love a way to embed binary data in json. And a canonical way to represent dates. And comments. And I’d like a sane, consistent way to express sum types. And sets and maps (with non string keys) - which JavaScript also natively supports. Sigh. | ||||||||||||||||||||||||||
▲ | aapoalas a day ago | parent | next [-] | |||||||||||||||||||||||||
It's more a problem of support and backwards compatibility. JSON and parsers for it are so ubiquitous, and the spec completely lacks any versioning support, that adding a feature would be a breaking change of horrible magnitude, on nearly all levels of the modern software infrastructure stack. I wouldn't be surprised if some CPUs might break from that :D JSON is a victim of its success: it has become too big to fail, and too big to improve. | ||||||||||||||||||||||||||
▲ | Sammi a day ago | parent | prev [-] | |||||||||||||||||||||||||
There are easy workarounds to getting bigints in JSON: https://github.com/GoogleChromeLabs/jsbi/issues/30#issuecomm... | ||||||||||||||||||||||||||
|