RadiozRadioz 13 hours ago

To take a slightly cynical view, but a view I honestly believe in, on the want to switch to JSON: XML looks old, most programmers have shallow opinions and chase new things.

It's not parsing performance, computers are plenty fast for text IM. It's not bandwidth, the difference between JSON and XML is negligible after compression. It's not developer ergonomics, any sane programmer is using a library that abstracts either format. It's not compatibility with the domain, as XML wins for XMPP due to namespaces.

The answer is that XML looks old. New programmers (half of all programmers have less than 5 years of experience) grew up in a world of JavaScript where XML was "legacy" since the day they arrived. In reality it's kept working fine, while the volume of software has increased around it naturally using the trendy tools. They've not looked back to understand why it was made or why it has merits, it's already got negative connotations and they're caught up in the new stuff. The new stuff has merit too, that is why a programmer is wise to respect both.

Also, what use is a stable and mature XML ecosystem when you can earn big nerd points by reinventing XPath for JSON the 5th time?

  • rented_mule 12 hours ago

    XML and JSON only started about 5 years apart (1996 vs. 2001). I think XML's adoption was more broad more quickly, so the gap felt a bit longer than that (XML was a core part of my jobs from 1998-2007 and JSON ever since). I think more of what makes XML look so much older is the fact that so many new projects have been picking JSON over XML for 10-20 years now, and that's why younger folks have seen much more JSON than XML.

    My software engineering career started long before either, and I have used both extensively. While I don't think that it makes sense for most well established projects to switch, just as rewrites often don't make sense, I would almost always pick JSON for new projects. Your points are valid, but one part of the ergonomics that you didn't mention is that it's so much easier for humans to read and write JSON, thereby speeding up development, debugging, testing, etc.

soul_grafitti 6 hours ago

Here's a thought - the thing that will ultimately doom XML, and perhaps JSON as well, will be the extra expense XML incurs when being tokenized for LLMs.

up-n-atom 16 hours ago

Is it really a question about processing performance though? I’ve always assumed it was about bandwidth and latency… Communication protocols don’t need to be human-readable because tooling has always provided that at a higher level. A binary protocol just as a text protocol like S-expression or the divine simplicity of IRC is just as digestible when documented. And there are better facilities to have extensibility regardless. I think we can all agree it’s as much a failure as a success if we’re still talking the same points 25 years later.

  • zamalek 16 hours ago

    XML compresses really well.

    • dafelst 15 hours ago

      Because it contains a ton of redundancy

      • zamalek 15 hours ago

        Exactly? What's your point? Things have to be low entropy/contain a lot of redundancy in order to compress well.

        • dafelst 12 hours ago

          If it were a more compact format, it is likely both the uncompressed AND compressed sizes would be smaller.

          By your logic, if you 10x'd the length of the XML tags in XMPP then it would be even better since you you would get an even further improved compression ratio.

          To be clear, I don't have a problem with XML in XMPP since it is negligible overhead, but "it compresses well because it is full of redundancy" is not the argument that should be used to justify it.

          • zamalek 11 hours ago

            That's a strawman. I am not arguing that we make the tag names longer, I am arguing that there is little benefit to a more concise format.

            If you are so bandwidth constrained that deflated XML won't do, then I doubt deflated JSON would be good enough either (and that exists anyway, Matrix).

            • dafelst 11 hours ago

              Your argument was initially stated as "XML compresses really well", not "there is little benefit to a more concise format".

              However, on your latter point, I am in full agreement.

              • zamalek 11 hours ago

                Where in my original argument did I suggest making the tags longer?

                • dafelst 11 hours ago

                  Your argument was that XML compresses really well, which indicates that compression ratio is your evaluation metric. I just suggested a simple way to improve your metric.

                  My position is that compression ratio is a largely meaningless metric in this instance, so using it as a method for justifying the use of XML (as inferred from "XML compresses really well") is also meaningless. That does not translate to "XML is bad for XMPP", I actually think it is fine, it means "XML compresses really well" doesn't add anything much in the way of justification.

                  I've spent way too much time on this thread already, so take what you will from it, it is all you from here on out, I am done here.

                  • zamalek 10 hours ago

                    "By your logic" is usually a canary for strawman, and it's needlessly combative on top of that. Best to step back and reconsider if you find yourself penning that.

                    The only thing I was saying was exactly what I said, within the context of XMPP, XML compresses really well - I was reinforcing the parent comment. How that relates to metrics in other contexts wasn't what I was talking about at all. I generally avoid XML nowadays, and so your argument with me isn't something I would dedicate thought to in the first place. I see no point in taking anything from this nonsense.

zzo38computer 12 hours ago

I agree that it should not use JSON. I think it would be better to use DER (or SDSER if streaming is needed) rather than XML or JSON, but that is just my opinion. However, if the existing protocol already uses XML, then that is what it will be, but the new one perhaps would not use XML.

hasperdi 16 hours ago

If they did adopt JSON then it wouldn't be XMPP anymore.

As a user, I don't care much. But my experience with XMPP is that was not as solid as other solutions, including closed source ones. I could've been issues in clients' implementation, but overall it wasn't great

  • ezst 15 hours ago

    > my experience with XMPP is that was not as solid as other solutions, including closed source ones.

    Considering that WhatsApp is essentially an old/non-federating fork of ejabberd (from where this blog post originates), I think XMPP is doing alright in that regard.

    • greatgib 12 hours ago

      Looking at how many years ago the fork open, you can easily guess that the protocol doesn't look anything at all like XMPP.