4 ms·
Json is completely fine. It's just too bad it doesn't have any support for comments. Maybe a future revision could add it?
by joelthelion 9y ago
Json is completely fine. It's just too bad it doesn't have any support for comments. Maybe a future revision could add it?
- echlebek 9y agoWell, not for everything. If you're working with scientific data, the lack of NaN and Inf can be problematic. Not that HOCON solves that.
- fnord123 9y ago'inf' and 'nan' should work fine. If I understand your suggestion correctly, you would like ieee floating point inf, -inf, and nan to be representable as tokens as though they are numbers. It makes sense as that's how ieee floats do it. But in JSON they aren't numbers, so they aren't represented as numbers. From the spec: """ JSON is agnostic about numbers. In any programming language, there can be a variety of number types of various capacities and complements, fixed or floating, binary or decimal. That can make interchange between different programming languages difficult. JSON instead offers only the representation of numbers that humans use: a sequence of digits. All programming languages know how to make sense of digit sequences even if they disagree on internal representations. That is enough to allow interchange. """
- echlebek 9y agoI'm not suggesting anything, I'm fully aware of the spec. I'm just pointing out that you can't represent NaN and Inf in JSON. Strings don't count.