dub: JSON, SDL, YAML, TOML, what color should we paint it ?
Mathias LANG
geod24 at gmail.com
Wed Mar 1 09:21:43 UTC 2023
On Tuesday, 28 February 2023 at 15:35:58 UTC, Steven
Schveighoffer wrote:
> Json5. It's json but with comments and allows key names without
> quotes.
>
> https://json5.org/
I didn't knew it supported quoteless keys, that's pretty nice!
If it's a superset of JSON, we could potentially do it in place
too.
> I have to say, I hate YAML. With a passion. The "backwards
> compatibility with JSON" is pretty must just bolted on. And
> having multiple ways to write configurations might be nice for
> people writing configs, it's not nice for people reading them.
> Also, significant whitespace = bad.
I think the significant whitespace boat has sailed. I don't like
it anymore than you do, but nowadays, editors align everything,
and if they don't, the linter will complain, or the reviewer
will. As much as I dislike it, I think significant whitespace
just hasn't proved to be the barrier it was envisioned to be, as
demonstrated by Python and YAML.
> I would be OK with TOML. But then we have 3 formats. Changing
> to a json-compatible format means we still only have to
> maintain 2 parsers.
Note that going with YAML allows us to deprecate the SDL parser.
Going with JSON5 includes writing a new parser, and a library to
do what Configy currently does, on top.
More information about the Digitalmars-d
mailing list