4 ms·
If you use arrays instead of objects, it becomes JsonML[1]: ["note", ["paragraph", "This is a ", ["code", {"vibe": "positive"}, "remark
by quectophoton 4y ago
If you use arrays instead of objects, it becomes JsonML[1]:
["note",
["paragraph",
"This is a ", ["code", {"vibe": "positive"}, "remarkable"], " text."]]
[1]: https://en.wikipedia.org/wiki/JsonML https://en.wikipedia.org/wiki/JsonML
This is also why I find Mithril.js so pleasant to use without JSX, because it's basically JsonML.
- sph 4y agoUse parens and you have S-expressions. No need for all that noise. (note (paragraph "This is a " (code (:vibe . "positive") "remarkable") " text.")) Lisp was invented in 1958 and we routinely rediscover it, and reimplement it badly.
- quectophoton 4y agoYeah, S-expressions are way more pleasant to write. With the benefit of a lot of hindsight, S-expressions seem like a superior choice for writing web applications (instead of HTML + JavaScript + some JS framework that writes HTML again (regardless of DOM vs Virtual DOM)). Even though I prefer dialects like Fennel for programming rather than Common Lisp (I'd probably be fine with Clojure and Janet as well, but I haven't tried them), I wouldn't mind any dialect if that means I could use S-expressions instead of HTML+JS, assuming the amount of effort put into sandboxing that approach were as much as the effort that has been put into the current approach.
- _glass 4y agoI love Lisp, but the quotes, and the structure ... Markup really shines here. Sorry. Same with JsonML, even though I never heard of it before, and will have a look because it just sounds so interesting.