TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Don't Invent XML Languages (2006)

48 pointsby MrVandemarabout 1 year ago

13 comments

account-5about 1 year ago
This is less about hating on XML and more about not reinventing the wheel.<p>I quite like XML. Things like xpath make working with it, or getting data from it much easier than JSON; though I love jq syntax and can&#x27;t wait until it starts being incorporated into languages. I don&#x27;t even mind xslt provided it&#x27;s not being over used.
评论 #39651762 未加载
评论 #39652382 未加载
评论 #39650189 未加载
userbinatorabout 1 year ago
2006, well into the era of XML being the trendy fad that every piece of Serious Business software was supposed to use.<p>Now 18 years later, JSON seems to have displaced it.<p>Personally, I&#x27;ve never found text-based formats to be a good choice for data that humans will rarely need to read or write; I much prefer simple and efficient binary formats, which can be just as extensible without the additional inefficiency and needlessly-introduced-failures of string handling.
评论 #39650064 未加载
评论 #39649963 未加载
评论 #39650207 未加载
评论 #39652067 未加载
评论 #39650237 未加载
评论 #39649955 未加载
评论 #39650163 未加载
评论 #39650007 未加载
评论 #39652009 未加载
评论 #39650170 未加载
评论 #39652098 未加载
评论 #39650195 未加载
lpapezabout 1 year ago
Thankfully we&#x27;ve moved on and no longer invent XML languages.<p>We use YAML now which is obviously much better.
评论 #39650992 未加载
评论 #39650173 未加载
评论 #39651726 未加载
simpaticoderabout 1 year ago
If you squint at XML, JSON, or YAML you see a kind of lispy data-structure shape, an n-arry tree. The reader has a context stack that they are pushing and popping from as they read. The real problem is that every problem space is isomorphic to one that has successively tighter context. And a format that is applicable to every problem is one that is applicable to no problem. I believe that computer languages <i>must</i> get worse at some things to get better at others in a zero-sum way. Any attempt to avoid this trade-off leaves you with a very powerful mush.
评论 #39658941 未加载
435345345about 1 year ago
I don&#x27;t even know why we have any *ML. Everything they can do can be done with Lisp-syntax better.
评论 #39649819 未加载
评论 #39649889 未加载
评论 #39649832 未加载
dkerstenabout 1 year ago
I still see people, in 2024, writing new software and using XML as the data format. I don&#x27;t have an example offhand, but I recently saw a hobby game engine using XML to store its engine-specific game object&#x2F;scene data.<p>Personally, I like to use TOML for anything that is likely to also be edited by humans and JSON or binary for something that will only ever be used by machines.
评论 #39652279 未加载
评论 #39652036 未加载
评论 #39652063 未加载
greenyodaabout 1 year ago
Another standardized XML language that the article doesn&#x27;t mention is RDF: <a href="https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Resource_Description_Framework" rel="nofollow">https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Resource_Description_Framework</a>
评论 #39650121 未加载
评论 #39650028 未加载
olivierggabout 1 year ago
I still remember working briefly in 2008 with a thing called Magic (now uniPaas I think) XML all way down. Even the code : each line was a XML . You were supposed to code with a weird GUI. Still have nightmares
评论 #39650128 未加载
joshlkabout 1 year ago
Side question: when did XML start to loose favour to JSON? Did this happen because of something in particular or was it a gradual transition?
评论 #39650167 未加载
评论 #39650048 未加载
评论 #39650050 未加载
评论 #39650142 未加载
评论 #39649946 未加载
评论 #39650118 未加载
评论 #39650077 未加载
评论 #39649993 未加载
评论 #39651714 未加载
评论 #39651199 未加载
jiggawattsabout 1 year ago
I love listening to young developers <i>guess</i> at the history of XML, and why it was &quot;complex&quot; (it wasn&#x27;t), and then turn around an reinvent that wheel, with every bit of complexity that they just said they didn&#x27;t like... because it&#x27;s necessary.<p>So a bit of history from someone who was already developing for over a decade when XML was <i>the new hotness:</i><p>The before times were bad. Really bad. Everybody and everything had their own text-based formats.[1] I don&#x27;t just mean a few minor variants of INI files. I mean wildly different formats in <i>different character encodings</i>, which were literally <i>never provided</i>. Niceties like UTF-8 weren&#x27;t even dreamt of yet.<p>Literally every application interpreted their config files differently, generated output logs differently, and spoke &quot;text&quot; over the network or the pipeline differently.<p>If you need to read, write, send, or receive <i>N</i> different text formats, you needed at least <i>N</i> parsers and <i>N</i> serializers.<p>Those parsers and serializers didn&#x27;t exist.<p>They just didn&#x27;t. The formats were not formally specified, they were just &quot;whatever some program does&quot;... &quot;on some machine&quot;. Yup. They output <i>different text encodings</i> on different machines. Or the same machine even! Seriously, if two users had different regional options, they might not be able to share files generated by the same application on the same box.<p>Basically, you either had a programming &quot;library&quot; available so that you could completely sidestep the issue and avoid the text, or you&#x27;d have to write your own parser, personally, by hand. I <i>loooved</i> the early versions of ANTLR because they made this at least tolerable. Either way, good luck handling all the corner-cases of escaping control characters inside a quoted string that also supports macro escapes, embedded sub-expressions, or whatever. Fun times.<p>Then XML came along.<p>It precisely specified the syntax, and there were off-the-shelf parsers and generators for it in multiple programming languages! You could generate an XML file on one platform and read it in a different language on another by including a standardised library that you could just <i>download</i> instead of typing in a parser by hand like an animal. It even specified the text encoding so you wouldn&#x27;t have to guess.<p>It was glorious.<p>Microsoft especially embraced it and to this day you can see a lot of that history in Visual Studio project files, ASP.NET web config files, and the like.<p>The reason JSON slowly overtook XML is many-fold, but the key reason is simple: It was easier to parse JSON into JavaScript objects in the browser, and the browser was taking off as an application developer platform exponentially. JavaScript programmers outnumbered everyone else combined.<p>Notably, the early versions of JSON were typically read using just the &quot;eval()&quot; function.[2] It wasn&#x27;t an encoding per-se, but just a subset of JavaScript. Compared to having to have an XML parser in JavaScript, it was very lightweight. In fact, <i>zero</i> weight, because if JavaScript was available, then by definition, JSON was available.<p>The timeline is important here. An in-browser XML parser was available before JSON was a thing, but only for IE 5 on Windows. JSON was invented in 2001, and XMLHttpRequest become consistently available in other browsers after 2005 and was only a standard in 2006. Truly universal adoption took a few more years after that.<p>XML was only &quot;complex&quot; because it&#x27;s not an object-notation like JSON is. It&#x27;s a <i>document markup language</i>, much like HTML. Both trace their roots back to SGML, which dates back to 1986. These types of languages were used in places like Boeing for records keeping, such as tracking complex structured and semi-structured information about aircraft parts over decades. That kind of problem has an essential complexity that can&#x27;t be wished away.<p>JSON is simpler for <i>data exchange</i> because it maps nicely to how object oriented languages store pure data, but it can&#x27;t be readily used to represent human-readable documents the way XML can.<p>The other simplification was that JSON did away with schemas and the like, and was commonly used with dynamic languages. Developers got into the habit of reading JSON by shoving it into an object, and then interpreting it directly without any kind of parsing or decoding layer. This works kinda-sorta in languages like Python or JavaScript, but is horrific when used at scale.<p>I&#x27;m a developer used to simply clicking a button in Visual Studio to have it instantly bulk-generate entire API client libraries from a WSDL XML API schema, documentation and all. So when I hear REST people talk about how much simpler JSON is, I have <i>no idea what they&#x27;re talking about</i>.<p>So now, slowly, the wheel is being reinvented to avoid the manual labour of RETS and return to machine automation we had with WS-*. There are JSON API schemas (multiple!), written in JSON (of course), so documentation can&#x27;t be expressed in-line (because JSON is not a markup language). I&#x27;m seeing declarative languages like workflow engines and API management expression written in JSON gibberish now, same as we did with XML twenty years ago.<p>Mark my words, it&#x27;s just a matter of time until someone invents JSON namespaces...<p>[1] Most of the older Linux applications still do, which makes it ever so much fun to robustly <i>modify</i> config files programatically.<p>[2] Sure, these days JSON is &quot;parsed&quot; even by browsers instead of sent to eval(), for security reasons, but that&#x27;s not how things started out.
评论 #39652045 未加载
评论 #39651982 未加载
maxrecursionabout 1 year ago
I used the OVAL &quot;Open source Vulnerability Assessment Language&quot;, written in XML, daily to automate STIGs. Finding documentation for it was awful, but once I knew the syntax development was a breeze. Most chill job I ever had. A job like that is my retirement plan once I have enough money that salary no longer matters.
megaperplexabout 1 year ago
The author makes an argument against designing new XML languages. I think his arguments are weak. This does not mean I think we should design more XML languages, but that the arguments this particular author brings against it are weak. That having be said, the mid section with the tooling suggestions by use case is neat.<p>One thing he condemns such endeavors for is that it is unpleasant and somehow &quot;political&quot;. I can see what he means, but this has nothing to do with &quot;overdoing the extensibility&quot; of XML. As Aaron Schwartz put it<p>&quot;Instead of the &quot;let&#x27;s just build something that works&quot; attitude that made the Web (and the Internet) such a roaring success, they brought the formalizing mindset of mathematicians and the institutional structures of academics and defense contractors. They formed committees to form working groups to write drafts of ontologies that carefully listed (in 100-page Word documents) all possible things in the universe and the various properties they could have, and they spent ours in Talmudic debates over whether a washing machine was a kitchen appliance or a household cleaning device. [<a href="https:&#x2F;&#x2F;www.cs.rpi.edu&#x2F;~hendler&#x2F;ProgrammableWebSwartz2009.html" rel="nofollow">https:&#x2F;&#x2F;www.cs.rpi.edu&#x2F;~hendler&#x2F;ProgrammableWebSwartz2009.ht...</a>]&quot;<p>It is true that similar endeavors are prone to looking for an Absolute Cosmic Eternal Perfect Ontological Structure (credit: Lion Kimbro). If you drop that idea in any office, you will get as many proposals for entities as there are anuses, as if anyone is entitled to an ontology.<p>Don&#x27;t get me wrong, anyone might be entitled to submit an entity or criticize a hierarchy, but I think this is meaningful mostly in the context of targeted audience research and agile development practices. All in all, I think that the problem here is not with the &#x27;X&#x27; in XML, but with poor organization-level practices.<p>Furthermore, I did follow the link and surveyed the XML languages. I did not see the apparently self-evident truth the writer sees in there. Sure, there are many of them, but how is this even an argument? Some of the listed languages seem quite cool to me, especially the science ones. And the next person might dig the legal ones. If the argument here is that &quot;there are so many of them languages, they just can all be important&quot; (or &quot;real&quot;) does not sit well with me. There are tons of different programming languages, web frameworks, linux distributions, not to mention the incomprehensible multitude in other domains, such as car maker models or, well, birds.<p>It is just simplistic to disparage any number of things because they are too many to make readily sense of, and this is a cognitive stance I can&#x27;t endorse. Look at Medical Subject Headings, or the Dewey Decimal or the Library of Congress cataloging systems. There is just a ton of things out there and for each one of those, there is a person that has more expertise on than yourself. These taxonomies might be important to them, what are you gonna do? Stop them?<p>A bird&#x27;s view exasperation of the sheer number of things is the hallmark of a small town mentality that is untenable for the hacktivist mindset. The response here is, I guess, reusability of existing standards, and agile practices involving the user in the development process. But the author did not bring up any of these.
calvinmorrisonabout 1 year ago
I hate xml.
评论 #39651956 未加载