News for hackers. Stuff that matters.
Re:NestedText, a nice alternative to JSON, YAML, TOML by MildlySerious on Saturday October 03, 2020 @04:55PM (#24674608)
Specifically, lines that begin with a word or words followed by a colon are dictionary items; a dash introduces list items, and a leading greater-than symbol signifies a line in a multiline string. Dictionaries and lists are used for nesting, the leaf values are always strings.

No doubts that there are use cases for this, but calling something that casts everything to strings an alternative to the above formats seems like a bit of a stretch.

Re:NestedText, a nice alternative to JSON, YAML, TOML by xorcist on Saturday October 03, 2020 @05:28PM (#24674796)
It's not a bad idea, as text file formats are all strings anyway, to let the application do the conversion. It's the one with the domain knowledge anyway. Perhaps it could do with a companion library to specify the data format and emit parse errors as appropriate. But to keep that out of the syntax makes a lot more sense than the insanity that is yaml.
Re:NestedText, a nice alternative to JSON, YAML, TOML by dagw on Saturday October 03, 2020 @05:46PM (#24674899)
I've been using toml for my latest project and the one thing that really bitten me is that [1,2,3] is a valid array [1.1, 1.2, 1.3] is a valid array, but [1, 1.5, 2] isn't valid and throws an exception due to it having heterogeneous types.
Re:NestedText, a nice alternative to JSON, YAML, TOML by sepples on Saturday October 03, 2020 @05:56PM (#24674977)
This is something that was fixed in the forthcoming TOML 1.0 spec. Parsers that have been updated to support it will allow heterogeneous types in arrays, which your application can convert to a vector of floats or whatever collection type it uses internally.
Re:NestedText, a nice alternative to JSON, YAML, TOML by dagw on Sunday October 04, 2020 @06:40AM (#24677868)
Fantastic. So far that has been literally my only complaint about TOML.