3 ms·
I think JSON5 is fairly close to this: https://json5.org https://json5.org I reckon the only thing it's missing to be truly accessible to non-techies is that s
by iainmerrick 3y ago
I think JSON5 is fairly close to this: https://json5.org https://json5.org
I reckon the only thing it's missing to be truly accessible to non-techies is that string values still need to be quoted, i.e. you can't have:
key: this is my value
(I'm definitely not saying it would be a good idea to allow quotes to be dropped, just that that's the only potential stumbling block I see for non-techies.)
Edit to add: oh, hmm, I guess trailing commas are fiddly too. Possibly I want some even laxer variant of JSON that lets you use just newlines! :P
- ftrobro 3y agoHjson is very similar to JSON5 but allows quotes to be dropped and can use newlines instead of commas. There are implementations for a lot of different languages, I myself contributed the C++ implementation. I wanted something smaller than Yaml but more lax than JSON, found Hjson to suit my needs perfectly. https://hjson.github.io/ https://hjson.github.io/
- iainmerrick 3y agoThis looks really nice, I like it! JSON5 is elegant in that it's purely a subset of JavaScript (exactly as the original JSON is). But in practice that doesn't really gain you much besides a familiar syntax, and Hjson looks simple enough that the slight differences from JS shouldn't be a problem. The real problem is how to persuade people to use something like this. For the few cases where JSON isn't already entrenched, YAML and TOML and the like have already salted the earth.
- Dylan16807 3y ago1 is a number, 01 is a string, 0.1 is a number, .01 is a string. I prefer explicitly marking strings. If I try to write a number, I want confidence that I'll get either a number or a parse error. (Though that doesn't necessarily mean quoting the string, other methods could work.)
- Dylan16807 3y agoNon-techies can handle quotes fine. Needing to deal with escaping can be a bit of an issue, though. The best option I've seen for that is [[the syntax for long quotes in lua]].