News for hackers. Stuff that matters.
Re:MessagePack: like JSON, but fast and small by knodi123 on Tuesday March 10, 2020 @03:38PM (#22538786)
What are the material differences between a config file format, and a machine-to-machine only format?
Re:MessagePack: like JSON, but fast and small by inetknght on Tuesday March 10, 2020 @03:45PM (#22538856)
Well, for one: most config file formats specifically include a method for the user to add bytes to the data which won't be parsed or interpreted. In JSON... you might try adding a {"comment": "this is a bad way to comment"} object or key/value and hope you don't collide with an object's dedicated comment field, and also don't cause the parser to raise an error for having a field which it didn't expect.
Re:MessagePack: like JSON, but fast and small by haggy on Tuesday March 10, 2020 @03:54PM (#22538980)
Config files are typically a 'load once, read many" pattern. Machine to machine communication protocols can be VERY high rate and over the network so they need to be highly efficient both in memory footprint and serialization overhead.
Re:MessagePack: like JSON, but fast and small by iainmerrick on Tuesday March 10, 2020 @04:19PM (#22539260)
So... JSON isn’t great as a machine to machine protocol, then? So I guess it must be a config format after all!
Re:MessagePack: like JSON, but fast and small by korijn on Tuesday March 10, 2020 @03:46PM (#22538873)
The key difference is the target audience. The format's "UX", so to speak, is optimized for the target audience (machine or human). @jrockway makes an excellent point.
Re:MessagePack: like JSON, but fast and small by mark-r on Tuesday March 10, 2020 @03:50PM (#22538922)
Why must those be mutually exclusive? There's value in being understandable by both.
Re:MessagePack: like JSON, but fast and small by nitrogen on Tuesday March 10, 2020 @04:09PM (#22539142)
Having comments in a "wire format" provides a means for the spec to become meaningless as random applications start using comments to convey information (or exfiltrate data) that other applications cannot parse correctly.
Re:MessagePack: like JSON, but fast and small by mark-r on Tuesday March 10, 2020 @05:02PM (#22539653)
There should be a special place in hell reserved for people who use comments to convey machine readable information. The whole point of a comment is to provide something that has no semantic meaning.
Re:MessagePack: like JSON, but fast and small by robotnikman on Tuesday March 10, 2020 @03:57PM (#22539012)
I would think being able to have comments is a big one, so you at lease have an idea of what changes what in a config file.