News for hackers. Stuff that matters.
Re:Analyzing multi-gigabyte JSON files locally by bastawhiz on Saturday March 18, 2023 @05:07PM (#35213121)
Sure, and JSON is as well. 0 takes three fewer bytes to encode than 1234. But if I parse JSON and my numbers come back as a type backed by UTF-8, I'm going to be left confused and angry. Nobody expects their JSON parser to give them back numeric values that their CPU can't natively perform operations on.
Re:Analyzing multi-gigabyte JSON files locally by gpderetta on Saturday March 18, 2023 @07:29PM (#35214286)
After you have spent some time confused and angry you can then read the documentation of whatever library you are using and verify whether it overloads numerical operations for its special number type or it has a function to convert them to whatever numerical type you need.

In any case you wouldn't of course use UTF-8 to represent JSON numbers as it can only encode 21 bit intgers.