News for hackers. Stuff that matters.
Re:I accidentally used YAML.parse instead of JSON.parse and ... by peterburkimsher on Sunday January 23, 2022 @10:55PM (#30053568)
In the beginning was the SGML.

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?

https://news.ycombinator.com/item?id=26671136

Re:I accidentally used YAML.parse instead of JSON.parse and ... by tannhaeuser on Monday January 24, 2022 @04:27AM (#30055235)
> Then we said it's too verbose. We named some subsets XML, HTML, XSLX

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]: http://info.cern.ch/hypertext/WWW/MarkUp/MarkUp.html

[2]: http://sgmljs.net/docs/html5.html

Re:I accidentally used YAML.parse instead of JSON.parse and ... by coldtea on Monday January 24, 2022 @02:55AM (#30054669)
Well, Markdown and YML and JSON are not subsets of SGML, nobody claims they are, and nobody intented them as such. So there's that.
Re:I accidentally used YAML.parse instead of JSON.parse and ... by tannhaeuser on Monday January 24, 2022 @04:09AM (#30055088)
While indeed neither markdown, much less JSON syntax has been intended as an SGML app, that doesn't stop SGML from parsing JSON, markdown, and other custom Wiki syntax using SHORTREF [1] ;) In fact, the original markdown language is specified as a mapping to HTML angle-bracket markup (with HTML also an SGML vocabulary), and thus it's quite natural to express that mapping using SGML SHORTREF, even though only a subset can be expressed.

[1]: https://www.balisage.net/Proceedings/vol17/html/Walsh01/Bali...

[2]: https://daringfireball.net/projects/markdown/

Re:I accidentally used YAML.parse instead of JSON.parse and ... by dudeinjapan on Monday January 24, 2022 @04:12AM (#30055111)
First they came for the angle brackets. And I did not speak out. Because I did not use XML...
Re:I accidentally used YAML.parse instead of JSON.parse and ... by peterburkimsher on Monday January 24, 2022 @04:17AM (#30055138)
You didn't use XML? But We use XML to read the comments here on this HTML web page.

But I came for the angle brackets. Because I < We, eternally.

Re:I accidentally used YAML.parse instead of JSON.parse and ... by slightwinder on Monday January 24, 2022 @05:44AM (#30055887)
> 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.

JSON is older than markdown and yaml.

Re:I accidentally used YAML.parse instead of JSON.parse and ... by peterburkimsher on Tuesday January 25, 2022 @05:27AM (#30070267)
Thank you for correcting history! I'd forgotten >_<
Re:I accidentally used YAML.parse instead of JSON.parse and ... by eadmund on Monday January 24, 2022 @08:21AM (#30057247)
I think you'll find that in the beginning were M-expressions, but they were evil, and were followed by S-expressions, which were and are and ever will be good.

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.

Re:I accidentally used YAML.parse instead of JSON.parse and ... by tlavoie on Tuesday January 25, 2022 @02:29AM (#30069169)
If XML for data is bad, check out XML as a programming language. I think this has cropped up a few times, one that stuck with me was as templating structures in the FutureTense app server, before being acquired by OpenMarket and they switched to JSPs or something.

Lots of <for something> <other stuff> </for> sorts of evil.

Re:I accidentally used YAML.parse instead of JSON.parse and ... by irrational on Monday January 24, 2022 @10:29AM (#30058820)
note: HTML5 is not a subset of SGML.