3 ms·
Why would you limit yourself to those two options? Use TOML or something.
by Filligree 8y ago
Why would you limit yourself to those two options? Use TOML or something.
- amelius 8y agoTOML kinda breaks down when you have nested data: https://stackoverflow.com/questions/48998034/does-toml-support-nested-arrays-of-objects-tables https://stackoverflow.com/questions/48998034/does-toml-suppo...
- ChrisSD 8y agoYour link shows nested data structures working? But regardless TOML is a configuration file format (like INI), not a general purpose data structure format (like JSON is).
- TheDong 8y ago> general purpose data structure format General purpose until you need to store dates/times, self-referential structures, enums, etc. json and toml are both serializations of data. I don't think the line you're trying to draw between "configuration file format" and "data structure format" is a well-defined line.
- ChrisSD 8y agoSure it's a blurry line but some formats are better than others for some specific tasks. JSON isn't the right tool for every job but it's a good enough lowest common denominator for data sharing. I wouldn't want to use if for config files or passing complex data but then it's not designed for that.
- afiori 8y agoTOML also has more "normal" notations for dicts and lists that are almost the same as JSON. There is a distinction between markup languages e object notation languages. XML, HTML and Markdown are markup, JSON, YAML, TOML and most other are object notations. (here my distinction, in general, is if they allow unquoted text)
- Dylan16807 8y agoThe answer to the question is "yes it is supported", it doesn't break down at all. It's even in the example file https://github.com/toml-lang/toml/blob/master/examples/example-v0.4.0.toml#L225 https://github.com/toml-lang/toml/blob/master/examples/examp...
- je42 8y agolooks quite ugly. repeating keys... yaml looks better (while it has other problems)