IDL language

Havoc Pennington hp at pobox.com
Fri May 8 18:37:54 PDT 2009


Perhaps it isn't obvious, one assumption I'm making: there should be
kind of a continuum of how formal you want to be.

Level 1: If your app is just implemented in two pieces, think
something like Google Chrome where each window is its own process, or
metacity which has dialogs in another process, then you know you have
the same implementation language on both sides and both sides are in
the same tarball. So here you can just happily never care about
typelibs, most likely.
(You may have to if you need to generate code for static languages,
but in dynamic languages, you never care.) In essence you just have
within-app method calls, that happen to be marshaled cross-process and
(hopefully) async. For dynamic languages, cross-process calls are no
more or less typesafe than regular calls.

Level 2: If your app is the sole provider of an implementation, but
lots of other apps might talk to your app, you likely need to install
a typelib. But it could be generated from your app's code via some
sort of scanner. e.g. it would be nice if your app is written in Java,
to write a Java interface with some special dbus annotations if
needed, and during the build, install a typelib based on that - which
could include docs, struct names, the works.

Level 3: If your app is one provider of an interface that you want to
specify and standardize, you probably want to spec that interface as
IDL or raw XML, put it in a spec, and put it in a tarball by itself.
Here you want to be independent of a particular implementation.

You can pretty much iteratively evolve along this continuum as needed,
in a given case, if it turns out you want to make a "private"
interface public, or standardize an interface.

But there's no reason to force people to jump right to Level 3. I
think the gjs dbus bindings are so easy, since they support level 1,
that there's almost no cost to coding an app in multiple processes.
But they can also work in a level 3 situation, when there's value in
that. I think one of the nice things about DCOP that people loved, is
that it also supported level 1. CORBA on the other hand feels very
"heavy" because it's Level 3 or nothing; it forces you to treat all
IPC as an RFC specification instead of as an application-internal
call.

Havoc


More information about the dbus mailing list