3 ms·
I don’t think a generalized mechanism that would simultaneously suport XML and JSON would work, because they have different structures, uses, and generation/par
by Kwpolska 4y ago
I don’t think a generalized mechanism that would simultaneously suport XML and JSON would work, because they have different structures, uses, and generation/parsing mechanisms (XML/HTML is often generated using textual templates, but JSON is generated and parsing by going by plain old objects.
While Scala is perhaps not a “bad language”, it contains many flaws and I don’t see much of a bright future for it. (Also, Scala 3 brings new single-use features, and an entire alternate Python-style syntax, because learning one syntax is apparently not enough.)
- nradov 4y agoMy point was that XML and JSON (and YAML and S-expressions) are fundamentally similar in that they can be modeled as tree structures. So, in principle it might be possible for a programming language to have generalized support for tree structured data literals which could then be encoded into multiple different external formats. As to how that could work syntactically without turning into a huge mess, I'm not sure.