Hacker News new | ask | show | jobs
by djedr 1322 days ago
That'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.