3 ms·
The difference is not between tags and attributes, the difference is between text and markup. A markup language is human-readable text with added markup. A pla
by goto11 4y ago
The difference is not between tags and attributes, the difference is between text and markup.
A markup language is human-readable text with added markup. A plain text file is basically a valid HTML file (I believe <title> is the only required element). You can then add markup to provide structure and metadata.
This sets it apart from generic data structure formats. You can express the same information in JSON, but in JSON there is no distinction between text content and other information, it is all just structured data.
Something like s-expression is clearly simpler than HTML syntax, and it is endlessly flexible, but it is just not optimized towards writing structured text content the way markup languages are.
- djedr 4y agoThat's more like it! Indeed, markup languages are built around text whereas in JSON/S-expressions/syntaxes designed for expressing data, text is secondary. The syntax I created is uniquely flexible in that it can be used for both data and markup. The first variant of the two in my original comment is more data-like, but minimal enough that it works sufficiently well as markup too. Text is a little harder to mark up in this variant than in HTML, as individual text nodes have to be wrapped in []. However this gives precise control over the content of the text nodes and separates indentation and other whitespace of the document tree from whitespace which is intended as actual content: [paragraph with a ] a [ href=[...] [link] ] The second variant is very much like HTML: text here is primary and interleaved with markup in []: paragraph with a [href[...] a][link] This variant also separates the attributes and tag from the children, much like HTML. However the attributes are technically not restricted to being flat strings. If we weren't translating to HTML, we could have attributes with tree structure. So we have something simpler and more flexible than both HTML and S-expressions. This is the beauty and value of it. I hope I can succeed in communicating this to potential users, so they can benefit from it.