IDL language
Havoc Pennington
havoc.pennington at gmail.com
Fri May 8 16:51:03 PDT 2009
Hi,
On Fri, May 8, 2009 at 4:12 PM, Thiago Macieira <thiago at kde.org> wrote:
> Well, for simple interfaces, it works just fine.
>
> It only breaks down when working with complex structures. For example, if
> the introspection says type="(ii)", what should the generator write? Is
> that a X,Y point, a H,W size or something completely different?
>
> So that's where I think the IDL would help.
>
Changing syntax isn't what helps with this, though. What helps is just
adding the conceptual information "this (ii) is a Point" - which can
be done in XML, in IDL, in a comment annotation, or in the language
itself.
This whole idea is ripped off from Qt in the first place ;-) Qt
generates the metaobject from the C++ source, plus some special
annotations. gobject-introspection is the same way, it generates the
typelib from the C source, plus some magic comment annotations.
The way I think dbus should work, is that the app author can write XML
directly, can write IDL, can write C++, can write C, whatever.
Anything that includes the necessary information. Then, tools build
the type library - aka the XML file - and that resulting type library
can be installed if desired.
If you are working entirely in a single language, such as
javascript-to-javascript, you don't have to generate the type library
unless you have a reason to. If you're publishing an interface for
wide consumption, you probably want to.
Havoc
More information about the dbus
mailing list