DBUS_TYPE_SUM ? DBUS_TYPE_UNIT ? DBUS_TYPE_DEPENDENT_PAIR ?

Lennart Poettering mzqohf at 0pointer.de
Sun Dec 15 13:37:36 PST 2013


On Sat, 14.12.13 19:38, Andrew Cann (shum at canndrew.org) wrote:

> On the subject of new types that could be added to DBus, it would be cool if 
> there was a type for representing sum types in languages with algebraic
> datatypes. For instance, the DBus equivalent of the haskell type
> 
> data MyType = Foo Int32
>             | Bar Int32
>             | Baz String

We have the "v" type for variants. That sounds like a simpler, more
generic option for this.

Type safety is a good thing and all, but let's not lose the ground under
our feet...

> Anyway, just some ideas. By the way are there actually any real plans to extend
> DBus with major new features like this? Or at this point is the specification
> pretty much set in concrete?

Nope, it is certainly not set in concrete. Note however, that for kdbus
we currently are enforcing GVariant marshalling, as proposed by the
GNOME guys. If you want to make additions to the marshalling, then
please talk to Ryan regarding GVariant. GVariant as it turns out already
has a "maybe" type. That said, we currently do not allow that on kdbus
to guarantee that we can convert forth and back between dbus1 and
gvariant marshalling without losing data.

That all said, I am totally not convinced that adding a a
super-generic-yet-accurate type system like you suggest above really is
the right choice for a general purpose IPC, sounds more like something
for programming language nerds, that would certainly not help making
d-bus the one and only IPC you can use between a variety of programming
languages and that translates well to them, and not just to one specific
one with a type system that's gone overboard...

(That all said, I am not really deciding these things, that's up to the
bigger dbus community)

Lennart

-- 
Lennart Poettering, Red Hat


More information about the dbus mailing list