4 ms·
Huh I guess plain text protocols aren't so easy to parse after all then.
by IshKebab 6y ago
Huh I guess plain text protocols aren't so easy to parse after all then.
- warmwaffles 6y agoThis is mostly due to the loose definitions for JSON. It isn't a terribly difficult thing to read, but ambiguity abounds.
- kstenerud 6y agoThat's the big issue with these formats. There's an inevitable minimal complexity in any data format, and it has to be dealt with somewhere. The "simple" specifications optimize for ease of reading the spec, which is a kind of marketing trick to make it enticing, but in reality leaves so much ambiguity that you get the kinds of problems in the article. A tighter spec on the other hand reduces ambiguity but appears more complicated to anyone reading the spec. I went the tighter spec route in https://concise-encoding.org https://concise-encoding.org because that's the only safe way to go, and also versioned the spec AND documents because I know that even with the care I'm taking there will be mistakes to fix in the spec after release.
- nerdponx 6y agoSpecs should be hard to read. They must be finely detailed and leave no ambiguity. Human "browseability" is what docs are for. Aside: I like this data format. What prompted you to make your own?
- kstenerud 6y agoI couldn't find an existing format that had the types I needed, and also an unambiguous text/binary twin format. Then once I got started, my pent-up wish list and gripes over the formats I've used in the past came to the surface ;-)
- mokedglass 6y agoMost of the same problems, such as duplicate keys and invalid UTF8 encoding, can occur in binary protocols.
- IshKebab 6y agoThe article lists 5 problems: > Inconsistent Duplicate Key Precedence Ok this could still be a problem, though I doubt it would be in practice and the article states "some serializers refused to create binary representations of multiple keys". > Key Collision: Character truncation and Comments Not possible with binary formats. > JSON Serialization Quirks N/A > Float and Integer Representation Not an issue with binary formats. > Permissive Parsing and Other Bugs Mostly not an issue with binary formats. Unfortunately they said they tested some binary formats but didn't present the results!