3 ms·
JSON is a subset of YAML. (you can just dump JSON in your YAML document and it’s a valid YAML.) So parsing YAML will be strictly harder, as it needs to include
by shp0ngle 4y ago
JSON is a subset of YAML. (you can just dump JSON in your YAML document and it’s a valid YAML.)
So parsing YAML will be strictly harder, as it needs to include a JSON parser.
- jefftk 4y agoIf language A is a subset of language B it doesn't follow that parsing B is strictly harder. This is not guaranteed. Consider two languages: 1. Some number of "a" followed by the same number of "b". For example, aaabbb but not aabbb. 2. Any number of "a" followed by any number of "b". For example, aabbb but not aba. In this case (1) is a subset of (2), but parsing (2) is easier than parsing (1) since in (1) you have to verify that the numbers match (which, in technical terms, means its not regular).