Get [↓] http://trinitydesktop.org ?
Play with the presets or settings thereof of the contained
[ø] https://github.com/KDE/qtcurve
until you arrive at something similar to
[¹] https://www.pling.com/s/Trinity/p/1100735 &
[²] https://www.pling.com/s/Trinity/p/1100506 &
[³] https://www.pling.com/s/Trinity/p/1100829 &
breathe out, relax!
JSON os just a bag of stuff and there is no grand json standard body to develop common schema systems and other complex and rarely well fitting pile-on layers that devs would be pressured to use
Honestly I never understood how XML became popular in the first place. The problem it tries to solve is not very hard, and it doesn't solve that problem very well.
In my experience, it's a headache to handle namespaces in XML, e.g. when trying to refer to tag names in an XPath query.
That is one example of how XML goes beyond S-expressions. I still don't think it's a particularly hard problem.
To play the devil's advocate, one of the nice features of XML is schemas.
The reason why complex formats with validation etc. don't really work out is that they are most often used for data in transit as opposed to data at rest. The correct format for typed data at rest that conforms to a schema is a SQL database and that won't change any time soon. If you're working with data in transit, schemas, validation etc. are more trouble than they're worth.
For other purposes like configuration files or rpc, the element/attribute distinction is superfluous and just lead to overly verbose syntax.
Unfortunately the hype cycle is such that when a technology becomes fashionable it becomes used even in contexts where it is not appropriate. This in turn leads to a backlash against the overall technology, not just against inappropriate use of it.
Defining a sane schema fit for all the places and use cases where it will be needed is an exercise in frustration. Lightweight markup won for structured text because it is simple to use, and you can expand it in a piecemeal fashion as needed. See Worse-is-better and the adoption of the C language for how this happens.
This happens even for well-designed lightweight markup; everybody prefers Markdown over asciidoc because you only need to learn like 5 syntax elements to get it up and running, even if it forces you to to add by hand later all the functions that were already available in asciidoc.
Structured text with metadata is something like this:
<b>Hello, <a href="foo.org">world</a>!</b>
The element/attribute distinction and mixed content is useful here.Btw. CData-blocks are purely an escape mechanism on the syntactic level. It should be completely transparent on the application level (e.g. like backslash escapes in a JSON string).
As an RPC protocol, JSON is lighter weight and maps more directly to programming structures.
As a config file format, YAML is a bit terser. Especially since most configurations are just key/value pairs. Though there's a growing backlash against YAML so I wouldn't count on this lasting.
As a document format... XML still wins? HTML is still (basically) XML. Lots of business data interchange is still XML. JSON is terrible as a document format, and YAML isn't even in the running.
I used XML as a input file format for a scientific application and I still can't see how I can store same data in a YAML file, with inherent verification capabilities and with some flexibility for reordering blocks.
For smaller stuff, YAML is fine, for transient over the wire data exchange, JSON is fine, but for heavy lifting, XML is indispensable IME.
There's one document standard in particular which is designed for news articles, and in that case you want and need to be able to embed HTML representations in the outer document wrapper: this is a perfect fit for XML namespaces, it's almost exactly the use case they were intended for. But looking at the replacement JSON standard I find string fields called things like "body_html" or "body_text" and it just makes me _weep_.
To some degree, YAML seems to be liked because of the very same feature of Python: Scoping via indentation. However, I'm not sure about that.
XML is akin to space shuttle. Complicated but, well thought out. Well designed for its mission, robust, but somewhat clunky. However, it's a much more accessible member of "software engineering for the enterprise" era.
These features are not fit for today's "fast" software engineering. Who'll parse that XML, yet alone verify it? Who'll write the callbacks? Or is a DOM parser better? Today people "don't have time for that (TM)".
On the more realistic side, XML is really useful and robust. Yes, it's not as fast to implement, but it's forgettable. Add a DTD verification step, then parse away. After ironing the kinks out, your parser can outlive Voyager probes, maybe even humanity itself. But it's overkill for most "move fast, break things" projects of today.
I for one, will use XML for the foreseeable future for my projects. Won't whine for consuming JSON and writing hard to understand YAML files, but if I'm going to exchange big, important data and store it on disk, it'll be XML.
As far as it being easy to consume goes, if we're in the browser, DOMParser is right there - it's a one-liner to get a DOM out.
This annoys me more than it probably should. But it also annoys me that XML didn't inherit `</>` as a generic closing tag from SGML. That would have gone a long way towards satisfying people who think XML is too verbose.
XML had gained complexity: schemas, namespaces, validation, translation, and then was extended to cover RPC behaviour via SOAP, WSDL, etc, with some annoyances and papercuts around escaping things and using CDATA.
At a certain point the onboarding requirement for a new engineer who just wanted to exchange some data between two systems or write a config file was no longer "open a text file and write what you want" but "learn all of this tooling and perform this incantation".
Then, when you factor in that JavaScript was becoming the default for everything on the web and JQuery had given the world a better interface to XmlHttpRequest... but that you had to then translate client-side the XML into JS objects...
At this point convenience won.
Just write the config file in JSON, send data as JSON over HTTP, have the browser just receive native JavaScript objects.
Of course, time passes and now we're slowly adding in all of the complexity again as it turns out it's needed at a certain scale to be sure that systems work as intended.
YAML emerged when managing JSON configs via build tools become troublesome (trailing commas within config files for arrays built via Puppet, etc). YAML solved that, and made it also a little easier to read (for some other compromises, like now being whitespace sensitive).
Perhaps something else more convenient is just around the corner and we can do it all again.
If you were to build a competitor to XML/JSON/YAML today... what would it look like?
Text formats will evolve to the point of being too complex to use. Those that can will be replaced by those that cannot.