6 ms·
> YAML is (or at least, is declared by its maintainers to be) a superset of JSON, making any JSON document also a valid YAML document. > So surely if YAML is st
by fodkodrasz 20d ago
> YAML is (or at least, is declared by its maintainers to be) a superset of JSON, making any JSON document also a valid YAML document.
> So surely if YAML is streamable, JSON must be too?
Given YAML is not a subset, but a superset of JSON, as you correctly noted, I'm not sure how you reached that conclusion.
> Or are the YAML maintainers incorrect?
I think you should check this page before making snarky comments: https://en.wikipedia.org/wiki/Superset https://en.wikipedia.org/wiki/Superset
See also the comment below: https://news.ycombinator.com/item?id=49476489 https://news.ycombinator.com/item?id=49476489
Offtopic note: I wanted to dig the wiki superset link up the lazy way, so searched for superset, and all I got was endless list of marketing trash links. Even on DDG. RIP, we are on the Dead Internet.
- feelamee 20d agoI think you should check this page before making snarky comments: https://en.wikipedia.org/wiki/Inference https://en.wikipedia.org/wiki/Inference See Examples section.
- feelamee 20d agoHe misspelled subset/superset, but the idea with streaming is right. Given: - YAML support streaming - any JSON is valid YAML Conclusion - any JSON is streaming
- fodkodrasz 20d agoNope? The "streamed JSON" needs --- line sparators, which is not a JSON spec feature, thus that data stream is valid YAML from that point, bot not a valid JSON stream. NDJSON is a different beast.
- dghf 17d ago> snarky comments How was my comment snarky? The YAML maintainers may have intended YAML to be a superset of JSON, but failed by not incorporating some obscure feature of it that bore on whether it was streamable or not.