4 ms·
So replace TOML with YAML? Or strictYAML? That's like having an engine problem and replacing engine with Shuttle Thruster. Or Space X rocket engine. YAML imo
by Ygg2 3y ago
So replace TOML with YAML? Or strictYAML?
That's like having an engine problem and replacing engine with Shuttle Thruster. Or Space X rocket engine.
YAML imo will never beat JSON. The spec is so complex and full of edge cases that it will never reach simplicity and speed of JSON.
I implemented a spec compliant parser and it gets around 20 MB/s. In JSON I can get to at least five times that.
- bemusedthrow75 3y ago> YAML imo will never beat JSON. The spec is so complex and full of edge cases that it will never reach simplicity and speed of JSON. Ironically, all JSON documents are valid YAML. YAML is actually a superset of JSON.
- Ygg2 3y agoIronically? Fact it's a superset means it has more states and can't be as optimized as JSON. To compound the misery YAML is whitespace indented with some extra bonkers rules. So even your JSON subset in YAML needs to obey it. Mix of flow and block makes both modes worse. However it also makes a lot of sense.
- Sankozi 3y agoYAML is mainly for configuration files. JSON sucks at being configuration file format, it is mainly used for serialization in HTTP requests. Those 2 have different use cases.
- Ygg2 3y agoI've been using it for Sublime and some variant for VSCode. It's pretty nice, but it's missing comments.
- Sankozi 3y agoLack of comments is a showstopper for config file format. JSON also adds some significant amount of bloat due to the double quotes.
- Ygg2 3y ago> JSON also adds some significant amount of bloat due to the double quotes. As opposed to YAML's double quotes (and single quotes, and unquoted, and folded, and literals) or you mean Toml's double quotes (and single quotes and multi-line quote). Quotes aren't a problem. Many different types are.