dub: JSON, SDL, YAML, TOML, what color should we paint it ?

Steven Schveighoffer schveiguy at gmail.com
Tue Feb 28 15:35:58 UTC 2023


On 2/28/23 9:29 AM, Mathias LANG wrote:
re are the options that have been floated around:
> 1) Use SDL everywhere;
> 2) Add support for YAML;
> 3) Add support for another format (E.g. TOML);

Json5. It's json but with comments and allows key names without quotes.

https://json5.org/

"JSON5 was started in 2012, and as of 2022, now gets >65M 
downloads/week, ranks in the top 0.1% of the most depended-upon packages 
on npm, and has been adopted by major projects like Chromium, Next.js, 
Babel, Retool, WebStorm, and more. It's also natively supported on Apple 
platforms like MacOS and iOS."

> I would like to go with YAML, not because it is the greatest format on 
> earth, but because SDLang is not well known (it means newcomer have to 
> learn yet another format, and while not a big deal, it adds friction), 
> while YAML is everywhere. In the [thread were SDL was 
> discussed](https://forum.dlang.org/thread/gnfctbuhiemidetngrzi@forum.dlang.org), people even thought we invented it!

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 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.

-Steve


More information about the Digitalmars-d mailing list