News for hackers. Stuff that matters.
Re:TOML: Tom's Obvious Minimal Language by KronisLV on Sunday May 21, 2023 @07:51AM (#36019982)
> JSON is basically perfect if it allowed trailing commas and comments.

I agree, especially in regards to the comments, because sometimes the data itself isn't enough and additional human-readable context can be really useful!

In that regard, JSON5 is a wonderful idea, even if sadly it isn't widespread: https://json5.org/

It also supports the trailing commas and overall just feels like what JSON should be, to make it better without overcomplicating it.

Re:TOML: Tom's Obvious Minimal Language by nikeee on Sunday May 21, 2023 @12:52PM (#36022710)
I like the idea of JSON5, but it allows a bit too much in my opinion. For example, why add the single quote? Why hexadecimal identifiers?
Re:TOML: Tom's Obvious Minimal Language by veidr on Sunday May 21, 2023 @01:05PM (#36022835)
JSON is trash and should never be used in any human-interfacing context, so I'm super skeptical that there's any utility in trying to fix it; that would just delay its demise, to the detriment of humankind.

But if you did want to fix JSON, the yes, trailing commas and comments are the absolute minimum bar, but single quote is actually probably the the third absolute must-fix.

The reason is just that so much JavaScript tooling is now configured to autoformat code (including the JSON bits) to swap " to ', thanks in large part to Prettier (which also should almost never be used, sigh, but that's a topic for another HN bikeshed...)

hexadecimal identifiers, yeah, nah

Re:TOML: Tom's Obvious Minimal Language by NoahKAndrews on Sunday May 21, 2023 @03:01PM (#36023778)
Prettier defaults to double quotes.

I'm curious what you have against Prettier.

Re:TOML: Tom's Obvious Minimal Language by evntdrvn on Sunday May 21, 2023 @03:46PM (#36024137)