D/BUS IDL compiler ...
Tue, 9 Mar 2004 21:32:50 +0100
Havoc Pennington [Monday 8 March 2004] :
> I don't like the dict thing all that much, seems to me either we stick
> to only basic types (primitives and recursive arrays thereof) or we
> should add structs. Some native type systems e.g. python could treat a
> struct as a dict.
> We could do structs without requiring an IDL spec for the struct type,
> as in XML-RPC:
> i.e. basically the same thing as a dict, except call it a struct and
> expect a struct mapping in languages that have it. There's no type tag
> for "struct Foo" though, that is only in the binding, not on the dbus
A problem with the "struct as dict" approach is that it introduces lots
of overhead when transmitting arrays of structs: the complete type
information for the struct i.e. member names + typecodes for the
data is transmitted for each element of the array.
Introducing a type tag for structs would fix this. Another possibility
is to use tuples ie something like structs but without the member
names, a (short) collection of values of different types.