According to https://yaml.org/spec/1.2.2/, YAML 1.2 (from 2009) is a strict superset of JSON. Earlier versions were an _almost_ superset. Hence the confusion in this thread. It depends on the version…
According to https://yaml.org/spec/1.2.2/, YAML 1.2 (from 2009) is a strict superset of JSON. Earlier versions were an _almost_ superset. Hence the confusion in this thread. It depends on the version…
> Addendum/2009: the YAML 1.2 spec is still incompatible with JSON, even though the incompatibilities have been documented (and are known to Brian) for many years and the spec makes explicit claims that YAML is a superset of JSON. It would be so easy to fix, but apparently, bullying people and corrupting userdata is so much easier.
I assume these are something related to non-ascii string encoding / escapes?
"Please note that YAML has hardcoded limits on (simple) object key lengths that JSON doesn't have and also has different and incompatible unicode character escape syntax... YAML also does not allow \/ sequences in strings"
> Addendum/2009: the YAML 1.2 spec is still incompatible with JSON
The author also details their issues in, ah, getting some of the authors of the YAML specification to agree.
> An implementation may set limits on the length and character contents of strings.
So this length limit is not a source of incompatibility with JSON.
I'm not even sure why I'm playing the devil's advocate, I hate Yaml actually :D
There was also an article here some time ago but I cannot find it right now.
Then we said it's too verbose. We named some subsets XML, HTML, XLSX.
Then we said it's still too long. So we named some subsets Markdown, and YML.
Then we said it's still too long, and made JSON.
What's wrong with subsets? Ambiguity in naming things.
https://martinfowler.com/bliki/TwoHardThings.html
Is JSON the same as YML?
NO.
Norwegian?
If anything, XML as an SGML subset is more verbose than SGML proper; in fact, getting rid of markup declarations to yield canonical markup without omitted/inferred tags, shortforms, etc. was the entire point of XML. Of course, XML suffered as an authoring format due to verbosity, which led to the Cambrian explosion of Wiki languages (MediaWiki, Markdown, etc.).
Also, HTML was conceived as an SGML vocabulary/application [1], and for the most part still is [2] (save for mechanisms to smuggle CSS and JavaScript into HTML without the installed base of browsers displaying these as content at the time, plus HTML5's ad-hoc error recovery).
[1]: https://www.balisage.net/Proceedings/vol17/html/Walsh01/Bali...
But I came for the angle brackets. Because I < We, eternally.
> Then we said it's still too long, and made JSON.
JSON is older than markdown and yaml.
SGML and its descendants are okay for document markup.
XML for data (as opposed to markup) is either evil or clown-shoes-for-a-hat insane — I can’t figure out which.
JSON is simultaneously under- and over-specified, leading to systems where everything works right up until it doesn't. It shares a lot with C and Unix in this respect.
Lots of <for something> <other stuff> </for> sorts of evil.