upvote
>Unfortunately XMPP is an absolutely terrible protocol

Can you provide more details here? I've never seen an issue with the protocol at all, more issues with feature difference between servers depending on what they have decided to implement or not.

reply
Most times I've seen complaints about it, it boils down to "XML being yucky" and the extension component model being difficult to write clients for, which is true but not really a fault of the protocol, it's more of an inherent tradeoff of supporting opt-in extensions at all
reply
I don't have that many problems with XML myself, but XMPP is weird even in XML land, because it tries to do XML all the way.

For instance, it works as a constant, uninterrupted stream. You never close the document until the disconnection. Which means you absolutely have to parse it with a stream parser.

It could have been something sensible, like a document per message: "Here's 300 characters of XML document: <xml>....". But nope.

And what's up with this? https://xmpp.org/extensions/xep-0394.html

reply
Is there a better standard available? As far as I know, XMPP is a real standard. If it's outdated, is there a better one?
reply
OMG, that XEP is extremely and unnecessarily complex. Just do, I don't know, markdown.

That made me remember IBM JSONx... https://www.ibm.com/docs/en/datapower-gateway/10.6.x?topic=2...

reply
What’s so complex about it? From what I gather (after skimming the document just now), you attach an extra element to a message which says how to style which parts of the message, from codepoint n to codepoint m, essentially. At least conceptually, that seems really simple and straightforward.

Are there more elegant or natural ways to do it? Probably. But when you say ‘extremely complex’, saying ‘codepoints 7 to 15 should be bold’ is not what comes to my mind.

reply
Things I don't like:

* It's not standard. You can't plug in some normal formatting library there and be done with it.

* You'll probably end up having to write conversions back and forth.

* It's fragile -- if anything gets misaligned it'll break

* It's tooling unfriendly. Think things like Nagios, Grafana, etc sending formatted notifications. Everything can do this or <b>this</b>, but practically nothing is set up to accommodate this format.

* It leaks into other subsystems. You can't eg, just search/replace/insert/delete words if you need to for any reason without breaking this.

Is it the worst thing ever? No, but it seems to go with the pattern that nothing in XMPP is normal or comfortable. Everything has this weird particular flavor to it and more complexity than necessary.

If it were up to me, my option would be to support 2 things: Markdown for simple cases, and embedded HTML for when you really have to get fancy. Each of those can be handed out to existing code and you don't ever have to keep adding extensions because what if people want colors or something now.

reply
None of this seems particularly different from doing <i>spans</i> inline (what if you forget to close one? or they overlap?), but it has a major benefit of being very backwards compatible, supporting future variants in parallel for gradual migration, and doesn't require any changes to search tools. And separating markup instructions from content is generally a very good idea.

And you could use markdown. Just get the rendered spanned text result and transpile it. This would be true for any editor as well, just get convert it to spanned text, edit, convert back.

And with HTML you'll still have to specify what subset you support, and many tools won't support that either. Markdown suffers from this too, by supporting embedded HTML, though at least commonmark is pretty baseline and well supported.

reply
The following example (from the spec) seems quite fragile:

    <message>
      <body>This XEP supports many things:
    * inline markup
    * code blocks
    * lists
    * and possibly more!</body>
      <markup xmlns="urn:xmpp:markup:0">
          <list start="31" end="89" ordered="false">
          <li start="31"/>
          <li start="47"/>
          <li start="61"/>
          <li start="69"/>
        </list>
      </markup>
    </message>
reply
deleted
reply
Identities. Creating an identity in XMPP is an absolute mess and requires domains along with approvals. At least in IRC this isn't complicated.

My own preference goes to NOSTR, just a set of public/private keys as identity and nothing else needed.

reply
Or ANproto https://anproto.com/ without the nostr baggage, what little there is.
reply
There is zero baggage on NOSTR regarding identities. An npub became the non-ambiguous way to reference anyone regardless of where they are writing from.

Thank you for the reference to that project called anproto, never had heard of it and I'm still without understanding what problem it really solves. Seems to encrypt texts but then contains zero outside metadata to route it somewhere. The website is very scarce on details for someone unfamiliar the scuttle-something they mention.

reply
Other people provided some info:

https://news.ycombinator.com/item?id=9772968

https://news.ycombinator.com/item?id=31133082 (article and discussion)

But TL;DR:

* It's hard to even parse, XMPP uses an uninterrupted XML stream. * The contents are often baroque and complex * Standards are a mess, and stuff that should be in core isn't * Data loss is possible * Protocol wasn't made for mobile devices * Multiple devices are terribly supported * Data loss is possible

From my attempts long ago, and other testimonials, writing an XMPP client is a full time job of solving weird problems that shouldn't exist in something better designed.

reply
reply
> We hear this too often: “XMPP uses XML. It should use JSON—it’s more modern.”

I can't take this write-up seriously if it starts like that. I still read the whole thing though and I couldn't find any solid argument as to why someone would prefer XML to JSON for XMPP.

> This is especially true in browser environments, where XMPP streams run over WebSockets, which naturally frames the XMPP protocol. That’s why you are never actually working with XML trees consuming large chunks of memory. Modern implementations like XMPP.js go further and use LTX—a lightweight parser built specifically for XMPP’s streaming model—rather than the browser’s DOM parser. The result: developers work with JSON-like objects anyway. The wire format becomes invisible to your application code.

That to me, is an argument for using JSON, not XML. XML is strong when you have elements referencing other elements in your document structure or DOCTYPE for grammar defs. I might be missing something but I don't get how streaming XML is to be preferred over JSON for XMPP.

reply
If it was actually using XML as a markup language then that would be a reason to stick with it. But XML seems to be complicating things much more than it simplifies.

>> XML remains the best format for representing trees—deep hierarchies of nested data. JSON handles flatter structures well, but good messaging protocols are extensible: extensions can be embedded at different levels and composed together, like Lego bricks. That’s where XML shines.

Anything reasonable you'd be doing with messaging protocol is pretty flat.

reply
deleted
reply
What part part, sorry?
reply
That there are issues with feature differences is a problem with the protocol.

Good protocols are opinionated and make concrete choices.

Extensibility typically leads to compatibility issues like the ones you are describing.

reply
IRC is good in that it is open, durable, and slow moving. All of those points are intentional features that make it a stable cockroach in a nuclear world.

I briefly entertained building a modern chat experience on top of IRC when I came to this realization.

reply
Slack was originally a side project built by a game dev company as a set of scripts on top of IRC. https://en.wikipedia.org/wiki/Slack_(software)#History
reply
IRC really is good. It's reliable too, but it really fell behind the times and never pushed forward with additions to the spec and such. When the clients and libraries tapered off too it just felt like it froze.
reply
IRCv3 aimed to do this, with mixed results.
reply
I once implemented the presence and basic messaging functionality of XMPP for a web site, using a braindead bridge (that I also wrote; so, the meaningful logic lived in the browser).

Considering I'd never hosted an XMPP daemon and didn't know anything about the protocol (I'd used XMPP clients a little bit, but had never looked at the protocol) and got a server (that part, I didn't write), an auth connector for our website's authentication system (so the daemon would authenticate against that instead), prod-ready and the features I wanted all working smoothly and reliably in maybe three weeks of very part-time work (this'd be, like, 3-4 part-time days with LLMs now, tops, from the same starting point)... seems decent to me? I mean I did direct work with the protocol, didn't just glue together libraries, and it was pretty damn good. Also (and I know browsers seem to be retreating on this front, which sucks) being XML made it very nice to work with in a Web context, since you can just ask the browser to turn ~any XML into a DOM for you, and get a bunch of functionality for free.

What's wrong with it?

reply
These days complicated and/or complex == hard == bad.
reply
Which is understandable when messaging shouldn’t be a hard problem to solve.
reply
> I don't know how it just happens that sending text messages to people can manage to result in specs that are painful to implement.

This is what boggles my mind. We're talking: Text. Over the Internet. It should not be a complex, difficult problem! We've been sending text over the Internet from the moment the Internet went online. So how is it that 10 companies have managed to find 30 different ways to do it, which are all incompatible with each other? You have to TRY to fail this badly.

reply
This is what boggles my mind. We're talking decades of arguments and discussions, dozens of different ways to do it, with dozens of tradeoffs that you could start listing with 20 seconds of thought, and still people just pop in like "why isn't it simple??" as if that's some award winning insight.

Come on, try! Start listing some of the core features of the different protocols/clients and answer your own question as to why it isn't simple! Presence. Chat history while offline. Threading. Mobile devices. Intermittent/mobile/cellular/wifi/CGNAT connectivity. Multiple clients on the same identity and presence. Identity establishing and confirming. Encryption. End-to-end encryption. Backing up and restoring chats, encrypted chats, group chats. Federation. Friends/groups/permissions/trust boundaries. Markup, markdown, formatting, images, emoji, unicode, code blocks. Audio, video, broadcast, multicast. Discovery. Extensibility. Federation. Store-and-forward.

> "We've been sending text over the Internet from the moment the Internet went online"

And IRC has RFC 1459, RFC 2810, RFC 2811, RFC 2812, RFC 2813, RFC 7194 and it does almost none of those things.

And you can still use IRC. But IRC is not good. At this point it's either wilfull ignorance of what people use computers for, or it's indistinguishable from deliberate trolling.

reply
Threading? God, I hate threads in a live chat. Is it never not awkward to use? Slack is the example I'm thinking of, though I'm sure it's shit everywhere else too. In Slack, rather than display the one threaded reply just below (maybe indented), it makes me go to another window, but then someone else is replying non-threaded, so I have to bounce back and forth for the next 10 minutes.
reply
As an anecdotal counter-point, I love threads in a live chat. When used correctly, it means when my idiot friends start having a heated discussion about some random topic while I'm at work, I get one 'ding' from my phone and then never again until I start interacting or they @ me. As opposed to the 427 new notifications I get on my phone about whether Golden Eye was better than Mario Kart 64.

Ultimately the tech is only as good as the humans that use it. If you're chatting with folks that can't understand the difference between a thread or not, that's a meat-bag issue and not anything an RFC can fix.

reply
I completely agree. Threads in Slack should be a great way to make conversations easy to navigate but damn did they fsck up ever part of the UX:

- opening threads in a new window is in some hard to find and hard to remember location

- threads can’t be inlined (like you’ve described). I actually like how they’re in a pane to the right but sometimes that causes issues (as you’ve described). Sometimes it’s just that the view is too narrow.

- there’s no way to shift non-threaded comments into the thread. I’ve lost count of the number of times conversations have happened over multiple threads and/or non-threaded replies.

The way they implemented it is a complete clusterfuck.

reply
I have half-wondered many times whether it would be possible/practical to build a chat system on top of MQTT or similar. Chat seems like mostly a pub/sub problem from where I sit.
reply
Why is it terrible?
reply