IDL language

Mark Doffman mark.doffman at codethink.co.uk
Mon May 11 01:52:50 PDT 2009


Hi Havoc, David,

> On Fri, May 8, 2009 at 4:04 PM, David Zeuthen <david at fubar.dk> wrote:
>> No amount of so-called XLST "sugar" is going to fix how you actually
>> describe the service in the first place. Unless you write it in an
>> IDL-ish language and then transform it to (some dialect of) D-Bus
>> introspection XML.
> 
> That's precisely what I meant when I said IDL should be just another binding.


I'm pretty much in agreement. I have started an IDL, but don't think it
needs to be "D-Bus official" to be useful. It will compile to D-Bus
introspection XML. If for the AT-SPI libraries we want to install the
IDL file somewhere for dynamic interface generation we can do so within
our own project.

> 
> If you want to write IDL, write IDL. Then convert it to the
> interoperable XML typelib format.
> 
> MyInterface.xml: MyInterface.idl
>     dbus-idl-to-xml $< --output $@
> 
> dbusxml_DATA=MyInterface.xml
> EXTRA_DIST=MyInterface.idl
> 
> Done!
> 
> Then, anyone can also use the IDL with any generated-code language
> binding; if all the language bindings support generating from xml,
> then you do IDL to XML, then XML to generated code files.
> 
> If you implement all the converters as a single tool suite, you can
> also bypass the XML and just go through an in-memory parse tree
> representation (the dbus-glib-tool code in dbus-glib was, long ago,
> intended to be this many-to-many converter thing, where it would
> support converting each language and IDL and typelib format to an
> in-memory parse tree, and then from the in-memory parse tree out to
> each of the formats).
> 
> But, I think the way things naturally work is that the XML-to-language
> converters come with those particular bindings, rather than fitting
> into a unified tool. Also the language-to-XML scanners. So the natural
> things to have in the unified tool are only the IDL and the XML.


XML-to-language converters are difficult because there is more
information in the IDL than in the D-Bus introspection XML. I think
people would have to choose to write their D-Bus protocol in an IDL
first. If people only want Egg-DBus bindings, then its easy, choose the
Egg-DBus IDL. If people want their protocol to be used by multiple
language libraries then they should choose an IDL that has extensions
for creating language bindings for a number of different D-Bus libraries.

Thanks

Mark



More information about the dbus mailing list