1,125 karma · joined April 15, 2018
> JSON text exchanged between systems that are not part of a closed ecosystem MUST be encoded using UTF-8 [1].
I don't know what you mean by controls (you mean unicode control characters, for which the spec explicitly states that they are to be escaped?), but since JSON should really only be exchanged as UTF-8, surrogate pairs play no role.
It can't be 64 bit floats, because they are represented as decimal numbers, not binary. You will be surprised to also hear that most base conversion algorithms used are not exact, and so different implementations might give different results in the LSB(s) for some numbers for performance reasons. Here practicality prevails, because making the standard stricter would make its implementation much harder in many environments. And for many applications it isn't a problem. I am sure btw that most file formats that use decimal representations for floating point numbers have this property, otherwise exact base conversion would be more prominently accessible in more programming languages.
I have some hope that this will change in the future, as exact base conversion (lossless round trip) will gain momentum now that it landed in standard C++. Once most common programming languages have this feature, there isn't a big reason to not modify the standard anymore to enforce lossless round-trip.
[1] https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe...
I think there a two good variants of binary JSON equivalents: one where you have a minimal implementation that makes both reading and writing with the lowest amount of code possible, potentially feeding a SAX-like interface or constructing an in memory representation (DOM-style).
The other one would be to facilitate lookups in large documents such as json_extract without parsing the whole document. That would require some clever layout of the data, potentially even as in-file hash tables or similar. I assume that is what SQLite has done.
Can you elaborate on this? It seems pretty clear from the spec to me: stuff starting with " is a string, stuff starting with - or a digit is a number.
And no, we didn't have major issues with memory leaks either. About on par with what I have seen in garbage collected languages. RAII works quite good most of the time.
I am all for making C and C++ safer by adding mitigations for the most common security relevant bugs. Either on language level, or on tooling level or on OS level or on CPU level. Or a combination of them. But since making a language absolutely memory safe doesn't make it automatically impossible to have bugs at all (even security relevant bugs), we should consider everything a trade-off.
Edit: found it here: https://www.raspberrypi.com/news/introducing-raspberry-pi-5/
So the 4 GB model is 60$, which is 5$ more than the 4 GB model of the Raspberry 4 when that was launched: https://www.raspberrypi.com/news/raspberry-pi-4-on-sale-now-... . I guess that is fair, especially with inflation nowadays. So they stay true to the idea of making this available for cheap.
rfc8259 is more detailed and it mentions that most parsers will have limited precision and references ieee754 to explain what the expected precision after deserialisation should be for most parsers.
Imagine that a scientist is making experiments of the form: Does observable variable A correlate with observable variable B? Now imagine that there are billions of observable variables and almost all of them are not correlated. And imagine that there is no better way to come up with plausible correlations to test than randomly picking variables. Then it will take a very long time and a very large number of experiments to find a pair that is truly correlated. It will be inevitable that most positive results are bogus.