IDL language
David Zeuthen
david at fubar.dk
Fri May 8 08:14:01 PDT 2009
Hey Havoc,
On Fri, 2009-05-08 at 10:50 -0400, Havoc Pennington wrote:
> Hi,
>
> I think a nice human-readable IDL should just be considered another
> language binding.
>
> Make the XML the interchange format (that would be installed, for
> example); everyone already has code to deal with it. Generate it from
> IDL, or for those of us who could do without IDL, we can generate the
> XML from something in the original language.
I think we have seen that this doesn't really work
o No-one really installs introspection XML anywhere. And if they did,
it would probably be a dialect anyway.
o For example the online-desktop D-Bus APIs don't even _have_
introspection XML because it's all defined in code.
o You'd be forcing other bindings to use anonymous structs if they
want to access your service. That, or they'd rewrite your XML
to IDL to have non-anonymous structs.
o We are _all_ using a{sv} for extensible stuff instead of a struct,
and you don't have that with D-Bus introspection XML.
Of course if you hate the very idea of generating code, you're going to
hate the latter two points.
FWIW, just the other day when I was talking to Jon McCann about this, he
told me that he had once spent quite some time figuring out how the
online-desktop D-Bus interface worked (he was doing this as part of
researching some stuff related to directory services). This involved
looking through the code.
As mentioned earlier, the online-desktop team actually themselves spent
some time reverse-engineering the services to produce the D-Bus
introspection XML, only to add docs via an dialect (the ConsoleKit) and
use a dbusxml2docbook script to generate reasonable docs.
So there is real value in having an official IDL language. It's just
easier all around than using D-Bus introspection XML. It makes it a lot
easier to actually have a discussion on xdg-list.
Everyone who write non-trivial D-Bus services with non-private
interfaces already extends D-Bus introspection XML (we have seen this:
Telepathy, ConsoleKit, DeviceKit-*), this is just an effort to
consolidate all this work.
Personally I think having an IDL is something that will help with people
realizing what D-Bus interface they are actually providing. It will help
these people document this stuff too if we put appropriate social
engineering constructs like "warning: method Foo is not documented" into
the tools.
Of course, no-one can force anything upon anyone, if you really don't
want to use IDL or if your service is private/internal you'd just not
use it. Simple as that. I'd still encourage you to use IDL though since
it will help you write more solid services. But that's just my opinion.
David
More information about the dbus
mailing list