News for hackers. Stuff that matters.
Re:MessagePack: like JSON, but fast and small by rumanator on Wednesday March 11, 2020 @03:44AM (#22543910)
> That attitude is misguided. Many people do in fact use JSON as a config file format

...and those people need to face the consequences of their poor and missguided technical decisions.

In this day and age we have no excuse to repeat the "but everyone is using XML for that" mistake. Just pick the right tool for the job and stop complainig that the tool needs to change to compensate for your poor judgement.

Re:MessagePack: like JSON, but fast and small by hombre_fatal on Wednesday March 11, 2020 @06:49AM (#22544679)
It's not poor and misguided. For example, VSCode has first-class support for JSONSchema giving you auto-complete and things like drop-own boxes for arbitrary project JSON config. It's better done and more mainstream than any other solution I've seen compared to people saying "well technically you could build that for <pet format>."

If you want comments, pipe it through json5 first or something. VSCode again supports comments as a courtesy. More tools that use JSON are starting to as well.

It's just not a big deal.

Re:MessagePack: like JSON, but fast and small by rumanator on Wednesday March 11, 2020 @06:55AM (#22544694)
> It's not poor and misguided. For example, VSCode has first-class support for JSONSchema giving you auto-complete and things like drop-own boxes for arbitrary project JSON config.

That's just tooling compensating for the shortcomings of a format being shoehorned into a use-case that falls outside of it's scope.

It's the XML nonsense all over again.

> It's better done and more mainstream than any other solution I've seen compared to people saying "well technically you could build that for <pet format>."

That's the same short-sighted line of argument that was used to force the mistake of using XML everywhere.

There are right tools for the right job. JSON os the right tool for a lot of jobs, but config files is not one of them.

Re:MessagePack: like JSON, but fast and small by iainmerrick on Wednesday March 11, 2020 @08:54AM (#22545365)
What are the alternatives?

Even though it’s not ideal, I actively prefer JSON over every other random format I’ve come across. This is speaking as somebody who mostly has to tweak existing configs, rather than extending them or writing new ones.

YAML (along with I guess TOML etc) looks nice at first glance, but it has too many weird syntax shortcuts that make it hard to figure out what’s actually going on. And googling for syntax like “[ ]” is hard!

With JSON, the data model is super simple, and for a given set of data there’s only one way to write it down. Sometimes the data model is too simple, sure. But even for fiddly cases like dates and times, there’s often an obvious solution (in this case, ISO 8601 strings).

Re:MessagePack: like JSON, but fast and small by Zarel on Thursday March 12, 2020 @11:32AM (#22557880)
JSON5 is a good alternative, mentioned a few times in this thread. JSON, plus comments, trailing commas, and object keys can be unquoted. Solves all my frustration with using JSON as a config file language.
Re:MessagePack: like JSON, but fast and small by iainmerrick on Thursday March 12, 2020 @03:18PM (#22560659)
Wow, I hadn’t heard of this before, even after reading other replies to this post! Looks pretty nice, hits just about every point on my personal wishlist. I’m going to use this.