IDL language
David Zeuthen
david at fubar.dk
Fri May 8 10:47:11 PDT 2009
On Fri, 2009-05-08 at 19:06 +0200, Lennart Poettering wrote:
> If D-Bus was new and not yet as widely used adopting a different
> language than XML could have been a good idea. But now?
My experience with several dialects of introspection XML (at least
three: Telepathy, ConsoleKit/DeviceKit-disks and eggdbus dialects) is
something I'd rather be without. It's hard to get right, easy to get
wrong and if you show it to someone, they just give you that blurry look
like it's Ada or FORTRAN or ask you if you made money on fixing Y2K bugs
in a previous life. So, no, D-Bus introspection XML is not something
that _I_ want to show to a new person on my team, for example (not
unless I wanted them to nominate me as the PHB on The Daily WTF or
something).
For your consideration:
eggdbus xml for org.freedesktop.DBus:
http://cgit.freedesktop.org/~david/eggdbus/tree/src/eggdbus/org.freedesktop.DBus.xml
DeviceKit-disks xml for org.freedesktop.DeviceKit.Disks.Device:
http://cgit.freedesktop.org/DeviceKit/DeviceKit-disks/tree/src/org.freedesktop.DeviceKit.Disks.Device.xml
Yeah. Really ugly. I know! And it gets worse if you codify existing
practices like dynamic_struct. Which everyone and their mother is using
already.
As previously explained, there is a need in D-Bus for both
1. an "exchange format" describing a service (D-Bus introspection XML)
mostly used for dynamic languages to facilitate method calls,
receiving signals and values coercing into and back from the native
type system; and
2. a format used for describing and documenting a services (IDL)
I'm not sure that there is a good reason that one and two should be the
same. In fact, for 1. there's often a bunch of bloat you want to avoid:
documentation, checked exceptions (e.g. we may want a throws clause in
the IDL language, I don't know) and other stuff.
In fact, many people punt on 2. - "we'll add the docs later" they tell
me, very agile and stuff, I know, just not very useful (in my view) for
production level code.
Either way, I personally maintain enough complex D-Bus services to make
this IDL language worth my while. If there's no interest in an official
IDL language in the D-Bus project, then, hey, less work for me since I
won't have to care about other implementations or deps like libglib-2.0
- and I can just make "didl" mean "David's IDL" (or, preemptive snarky
comment, "Douchebag's IDL") rather than "D-Bus IDL"... since that
happens to be my name ;-)
Hmm, guess I'm being a bit on the defensive here and a bit more
emotional that I'd normally be. Sorry about that. But I find it very
hard to contain my hate for writing code in XML and also that of having
to decipher some D-Bus service because, well, "we'll add the docs later"
mentality. So there you go.
David
More information about the dbus
mailing list