That's not a modern message bus, that's a post-modern one.
That's not a modern message bus, that's a post-modern one.
I presume text was edited a few times in different places withou re-checking everything.
The phrasing "The text protocol described in this document" (sic) can not easily be interpreted as "the thing described in this section, but not in the rest of the document".
I stand by my interpretation of incoherent editing.
Oh, technically the dbus auth handshake is defined as not being part of the dbus protocol. That's not convincing.
"D-Bus is low-overhead because it uses a binary protocol" -
Alright, got it. It's binary.
"The protocol is a line-based protocol, where each line ends with \r\n. Each line begins with an all-caps ASCII command name containing only the character range [A-Z_], a space, then any arguments for the command, then the \r\n ending the line. The protocol is case-sensitive. All bytes must be in the ASCII character set."
Wait a second. This section describes a line-based ASCII protocol. Is this some other protocol?
"A nul byte in any context other than the initial byte is an error; the protocol is ASCII-only."
Ookay. So... it's ASCII only, except for the first byte?
"Returns auditing data used by Solaris ADT, in an unspecified binary format. If you know what this means, please contribute documentation via the D-Bus bug tracking system."
Oh, no, okay... unspecified binary format. THIS IS ACTUALLY IN THE "SPEC".
Sorry for yelling. I lost it a bit there. Not quite as much as the authors of the dbus "specification", though.
Oh, just found this in the spec, too:
"The marshalling formats for the string-like types all end with a single zero (NUL) byte"
Perhaps it's confusing but slow down and understand the tech before criticizing. It is not in fact an ASCII-only binary protocol. Other engineers do sometimes know what they are doing.
I also note that you completely ignored "If you know what this means, please contribute documentation via the D-Bus bug tracking system." appearing in the specification. Seriously. This is not a specification. This is a poorly written description of an existing mess of a wire protocol.
Other engineers clearly do not know what they are doing.
The spec has always said it was informal and needed more work, for at least a decade now. Many people have implemented dbus and rewriting the spec hasn't been enough of a priority for any of them to do it. To me that says that while many are willing to say "it should be better" (including me) none of them are willing to say "and it's important enough to spend my next few months on" (including me). But the beauty is that at any time someone is free to change that.
I think it's wrong to say something is must-have when it obviously by existence proof has not been must-have. And in fact a lot of tech that had the must-have failed. Say CORBA, which certainly had specs. They were just specs that specified the wrong thing. I'd rather have the (approximate, good enough) right thing with an informal but good enough spec (to a motivated reader giving it a chance), than pay a bunch of committee people to write down a design that failed to solve the requirements.
I also think it is perfectly fine to have a reference implementation without a formal specification in many cases, and I don't think specification-first necessarily leads to a better protocol. As you point out, CORBA is certainly horrible as well.
Just because no one has replaced dbus it isn't good enough. The ever-appearing mantra of "if you don't like it, write your own" is boring. It is perfectly reasonable to point out what is wrong with a protocol in wide(ning) use without immediately presenting a fully formed alternative. It could be that most people have more pressing concerns than individually fighting Red Hat and all the projects invested in dbus for control over Linux userspace.
There is no dichotomy here, the only choices are not silently accepting the protocols we have or "paying a bunch of committee people".
I don't think you're seriously proposing that anyone could just step in and redesign dbus from within the existing project structure at this point. Any changes would be fought tooth and nail by the people invested in it right now. Any replacement would necessarily be a completely separate project, and it would have extremely slim prospects of succeeding. It's not surprising that people aren't doing that, even though dbus is flawed.
We are stuck with a lot of terrible things. The only way any of them will be fixed is for enough people to get angry enough to do something about it.
I have to ask, though - why engage in a thread like this? Clearly, dbus is successful, it is being integrated into the kernel, it is used all over Linux user space by now and whatever flaws it has are clearly not impeding its use. So why bother arguing about the spec on HN?
I could sit down and discuss what an improved protocol might look like, but I don't even know if I agree that /any/ protocol that does what dbus does is the right approach, and either way, this is not the place to do so.
I do think there's useful stuff to learn and discuss here about software development and dbus itself if people dig in and understand it. Perhaps some bystanders will learn something.
I welcome improving and even disrupting and replacing dbus but I don't think the kind of criticism found in this article will lead to that.
Does he need an excuse for wanting to correct misinformation ?
As the designer of something, you are too invested in it to handle someone going "this sucks!" well. My advice would be to sit back, recognize that the other person saying this is not invested to the same degree, is looking at the problem from the completely opposite perspective and is not familiar with the reasons behind every single compromise made, or why a certain feature seemed like a good idea at the time but turned out not to work in practice. Let someone else handle the defense.
It doesn't matter if there are valid criticisms to be made - inevitably, everyone describing the specification who weren't involved in writing it will misunderstand something, or leave something out, or quote something out of context or incompletely, or have completely different concerns in mind than the authors did - and as that author you are drawn to such things like a moth to the flame. But you have to resist the flame. After all, you wrote it, it does what you intended, you released it. If someone else wants something different, let them be unhappy and maybe if they are unhappy enough they will come up with their own thing.
Based upon this one instance where he shows up and correct misgivings ? Seriously ?
If anything you come across annoyed that your uninformed ranting was corrected.
Hey, all I did in my comment was to quote from the spec. My complaint (well, one of them) is that it's a "binary" protocol but it requires parsing just like an ascii protocol, it encodes data as ascii values and it even embeds a full ascii protocol in the auth sequence. (not to mention XML for reflection with an embedded type DSL in attributes, ...)
https://bugs.freedesktop.org/show_bug.cgi?id=16783
Someone certainly could write a bunch of patches to make the dbus specification better. But to get those patches included into the official dbus specification is a completely different problem. And you know that. Having spent a lot of effort in this thread defending the dbus spec as adequate, you wouldn't be the one spending your time integrating their patches.
You could see the blog post as a bug report. Pointing out weaknesses in the spec that could use improvement. Or you could see it as just another guy ranting on the internet.
The current people doing this kind of work deserve non-abusive informed criticism. It isn't OK to post a long diatribe of BS and then expect people to take it as if it were a helpful bug report. It isn't helpful. It's jackassery and unacceptable and this kind of abuse has done more damage to Linux than anyone knows.
It is entirely OK to ask questions or file bugs without sending patches. Just don't be an ass about it like this article was.
Authentication Protocol
Before the flow of messages begins, two applications must authenticate. A simple plain-text protocol is used for authentication; this protocol is a SASL profile, and maps fairly directly from the SASL specification. The message encoding is NOT used here, only plain text messages.
In examples, "C:" and "S:" indicate lines sent by the client and server respectively.
Protocol Overview
The protocol is a line-based protocol, where each line ends with \r\n. Each line begins with an all-caps ASCII command name containing only the character range [A-Z_], a space, then any arguments for the command, then the \r\n ending the line. The protocol is case-sensitive. All bytes must be in the ASCII character set. Commands from the client to the server are as follows: