IDL language
Mark Doffman
mark.doffman at codethink.co.uk
Mon May 11 05:21:36 PDT 2009
Hi Matthew,
>> If that is useful to people working in Python, JS, Ruby then great. I'd
>> just prefer to staticly generate my bindings, even in Python, to gain
>> some more flexibility.
>
> (speaking as the dbus-java author) I also want to statically generate my
> bindings, but I want to do so from a file which specifies the API. At
> the moment I can do this by introspecting something which has the
> appropriate interface, but I'd rather do it from a repository of
> interface files which are shipped with the software.
It would be very nice to have a 'Standard' IDL format that everyone who
wrote D-Bus Services used, to make the life of client bindings writers
easier.
This IDL shouldn't carry too much information about the way a protocol
is mapped to the language or library, but should include some extra
annotation such as struct and enum types that are pretty universally
useful. The ability to describe new complex types and use them in D-Bus
messages is a gaping hole in the D-Bus XML, affecting both the protocol
documentation and the ability to generate decent bindings. Telepathy
added annotations for this, EggDBus did too.
It should look, IMHO, much like the examples in:
git://git.codethink.co.uk/git/didl
Now, the only reason you would want to have a typlib (Binrary or
simplified representation of the information contained in the IDL) is
for speed purposes. Think of the typelib as a pre-parsed version of the
IDL. The pre-parsing and all the work of providing ANOTHER
representation of the information is only really useful for dynamically
importing the module. When you are statically generating Java bindings
why not just parse the IDL itself.
About the 'Standard' IDL though. We don't need to standardize one like
the OMG did. We can just write one, evangelize it, and hope service
providers start using it. Having a standard place to install the IDL
files is the only thing we need to do from there.
>
> If I'm _writing_ an API (rather than using someone else's) then I want
> to write it in Java and have the introspection/typelib/IDL/etc generated
> from the Java, not the other way round. In my world I wouldn't expect
> anyone to write the XML, it would all be inferred from the original
> program and then used to create the binding in subsequent programs.
>
Different folks different strokes. For Java only client and server this
makes complete sense. For multi-language stuff I think its usually
easier to start with the language agnostic bit in the middle.
Thanks
Mark
More information about the dbus
mailing list