News for hackers. Stuff that matters.
Re:Parsing JSON Is a Minefield (2016) by josefx on Tuesday October 12, 2021 @05:01AM (#28837602)
> We could build such a format on top of JSON (there are probably multiple)

Wouldn't a perfectly valid JSON pretty print nuke your values since it could parse a 128 bit value to double before writing it out again? I wouldn't trust your theoretical format unless it ensured that normal JSON parsers, which are not aware of its requirements, fail to parse it.

Re:Parsing JSON Is a Minefield (2016) by MathMonkeyMan on Tuesday October 12, 2021 @12:30PM (#28841689)
The theoretical format would have to represent the more-specific numbers using strings, e.g. if we want to mimic the edn:

    {"#ieee754/b64": "123.45"}
Nevermind that this takes up way more space, and whatever other problems.

If an intermediate parser encounters this, we don't have to worry about its representation of JSON numbers, because our numbers don't involve JSON's.