Having recently started working on a chat client that was intended to speak first-and-foremost XMPP, I have to agree: XMPP is... it's decades out of date and missing a number of absolutely critical, central ideas that are essential to making stuff work.
Examples:
- unique message IDs? Absent. XEPs kind of provide; but I can't tell you which of the three or for relevant ones are the most relevant (AMP IDs from XEP 0079? Stream Management from XEP 0198? Acking from XEP 0184? Something from Carbons or MAM in 0313 or 0280? You know, if you wanted some light reading...).
- multi device? Oh. My. God. It's bananas. The spec behavior is that whenever a client sends a message, the server is supposed to consider that one the most alive, and then route all future messages exclusively to that one. So you send a message on your phone? Yeah, your desktop is just going to silently stop receiving messages.
- there's a concept of "message carbons" to deal with this. This involves re-sending all your messages back to the server after you receive them, with special instructions to send them back again to your other clients. The amount of redundantly redundant XML involved is eyewatering.
Combine that multidevice behavior (messages can get randomly routed anywhere at any time) with the wild-west nature of message delivery acks, and you can see how ridiculously difficult this makes the basic idea of "all clients should see the same picture".
Overall, the XEP process, conceptually, is a great example of open extensibility. The trouble is, so much of this stuff is core to sane message delivery semantics that it really, practically speaking, causes huge problems when it's all considered "extensions". Stuff like message IDs fundamentally shouldn't be an extension because it's just too critical that all minimum-viable clients agree. You just can't build higher level stuff without that. XEPs are great. A community process for extensions should exist. It just needs to exist for extensions, not subsume the total set of realistic minimum viable features.
I want an open chat protocol.
I thought XMPP might be the one. Then, as the parent comment jibes, I actually looked at it. Tried to write something with it.
XMPP is not prepared to be the one, in any sense at all except for legacy support. I have all the respect in the world for all the folks who put effort into trying to make an open chat standard, but... honestly, we need a stronger foundation than this.
Since this seems to be resonating with a lot of folks, I'll also follow with something more constructive:
What I'd like to see is a messaging system that gets the basics right, and that's deeply aware that it's AP out of CAP. Messages are inherently commutative (think CRDTs) and can be received in arbitrary order; people on two sides of a partition should have no trouble reconciling coherent logs regardless of if there was a two minute netsplit or someone was backpacking for two weeks. I'm looking for any existing stuff that suits this, and willing to collaborate on making it if it needs to be made!
You may find happiness with matrix (https://matrix.org/). It's basically a "message synchronization protocol" done with today's technology (HTTP+JSON). The synchronization approach versus the messages being sent on the socket actually makes me think about mosh vs ssh.
Thanks for the suggestion. I skimmed their docs before briefly; I'm giving it a second look now, and realizing I passed by way too quickly last time.
It looks like they did tackle acausality head-on; I like what I see about previous message IDs being included in https://matrix.org/docs/spec/#pdus
Nervous about ever christening JSON "today's technology". JSON has the same problem XML in XMPP does: can't tunnel binary e.g. video without extreme backbending (jingle for XMPP is pretty much a textbook example of "too much friction -> not fit for purpose and near zero adoption"). But it looks like matrix is pluggable on transports, too, so that's potentially a sweet spot for lazy REST clients and powerful performance situations to coexist.
... And I popped into their self-hosted chat room. Observation 1: It works (!). Observation 2: the devs are dogfooding and seem both knowledgeable and friendly :) I haven't taken the leap to self-host yet (will later!); but from preliminaries, matrix is looking remarkably solid and well thought out. I'm going to try to build something with this! Thanks again for the link!
> Nervous about ever christening JSON "today's technology".
I use this to say "XML was the hot when XMPP was created, the way JSON is the hot today, when Matrix is created". I 100% agree with you that using a non-binary-friendly format sucks for pretty much anything that goes beyond plain text messaging:
- encryption
- files/emoticons/voice
- on the server side, any routing stuff
But still, like XMPP I hope this will not be enough to hamper its development.
> jingle for XMPP is pretty much a textbook example of "too much friction -> not fit for purpose and near zero adoption"
Amen to that. XMPP is basically an entity-to-entity messaging protocol, and yet because it can't handle binary there needs to be a negotiation step and yet another connection for binary stuff... blah.
The client-server API of Matrix only uses http+json as the lowest common denominator baseline for compatibility. Folks are more than welcome to implement custom more efficient transports like COAP/CBOR or whatever.
The server-server API is currently just targetting https+json just for expedience in getting started, but nothing to stop us negotiating more efficient transports in future - capn proto has come up a lot in conversation as a possible option. Handling signing is a bit more fun as we currently rely on signing canonical json, but surmountable.
As for binary transfers... well, random blobs are just handled as pure HTTP with a mimetype currently :)
Examples:
- unique message IDs? Absent. XEPs kind of provide; but I can't tell you which of the three or for relevant ones are the most relevant (AMP IDs from XEP 0079? Stream Management from XEP 0198? Acking from XEP 0184? Something from Carbons or MAM in 0313 or 0280? You know, if you wanted some light reading...).
- multi device? Oh. My. God. It's bananas. The spec behavior is that whenever a client sends a message, the server is supposed to consider that one the most alive, and then route all future messages exclusively to that one. So you send a message on your phone? Yeah, your desktop is just going to silently stop receiving messages.
- there's a concept of "message carbons" to deal with this. This involves re-sending all your messages back to the server after you receive them, with special instructions to send them back again to your other clients. The amount of redundantly redundant XML involved is eyewatering.
Combine that multidevice behavior (messages can get randomly routed anywhere at any time) with the wild-west nature of message delivery acks, and you can see how ridiculously difficult this makes the basic idea of "all clients should see the same picture".
Overall, the XEP process, conceptually, is a great example of open extensibility. The trouble is, so much of this stuff is core to sane message delivery semantics that it really, practically speaking, causes huge problems when it's all considered "extensions". Stuff like message IDs fundamentally shouldn't be an extension because it's just too critical that all minimum-viable clients agree. You just can't build higher level stuff without that. XEPs are great. A community process for extensions should exist. It just needs to exist for extensions, not subsume the total set of realistic minimum viable features.
I want an open chat protocol.
I thought XMPP might be the one. Then, as the parent comment jibes, I actually looked at it. Tried to write something with it.
XMPP is not prepared to be the one, in any sense at all except for legacy support. I have all the respect in the world for all the folks who put effort into trying to make an open chat standard, but... honestly, we need a stronger foundation than this.