IDL language
Mark Doffman
mark.doffman at codethink.co.uk
Mon May 11 01:38:34 PDT 2009
Hi,
> On Fri, 2009-05-08 at 21:35 +0200, Lennart Poettering wrote:
>> On Fri, 08.05.09 13:47, David Zeuthen (david at fubar.dk) wrote:
>>
>>> On Fri, 2009-05-08 at 19:06 +0200, Lennart Poettering wrote:
>>>> If D-Bus was new and not yet as widely used adopting a different
>>>> language than XML could have been a good idea. But now?
>>> My experience with several dialects of introspection XML (at least
>>> three: Telepathy, ConsoleKit/DeviceKit-disks and eggdbus dialects) is
>>> something I'd rather be without. It's hard to get right, easy to get
>>> wrong and if you show it to someone, they just give you that blurry look
>>> like it's Ada or FORTRAN or ask you if you made money on fixing Y2K bugs
>>> in a previous life. So, no, D-Bus introspection XML is not something
>>> that _I_ want to show to a new person on my team, for example (not
>>> unless I wanted them to nominate me as the PHB on The Daily WTF or
>>> something).
>> Maybe you are doing something wrong if you just show the XML sources
>> around. I mean, stuff like the following doesn't look too bad, does it?
>>
>> http://avahi.org/download/Server.introspect.xml
>>
>> This is pretty old stuff, now if we'd have the documentation stuff
>> properly integrated into the XML format this could look much, much prettier.
>
> That's not the point. Of course I use an XSLT script to generate docbook
> from so I get e.g.
>
> http://hal.freedesktop.org/docs/DeviceKit-disks/Device.html
>
> from the abomination that is the 2385 lines of annotated introspection
> XML for the same
>
> http://cgit.freedesktop.org/DeviceKit/DeviceKit-disks/tree/src/org.freedesktop.DeviceKit.Disks.Device.xml
>
> Because, sure, it's easier to read HTML with hyperlinks than this XML
> thing.
>
>> I don't find this particular example that unreadable. And with some
>> XSLT sugar this could actually really nice. Much nicer than a C
>> inspired low-level syntex ever could. But yepp, that's just a matter
>> of taste again.
>
> It's not so much about reading. The point is really that I shouldn't
> need to edit some weird dialect of XML to describe a service that is
> much easier described in a domain-specific language. I shouldn't need to
> read/write XML either when discussing an interface on a mailing list
> either. And I shouldn't need to mentally parse XML when I'm looking
> in /usr/share/dbus-1/interfaces either.
>
> No amount of so-called XLST "sugar" is going to fix how you actually
> describe the service in the first place. Unless you write it in an
> IDL-ish language and then transform it to (some dialect of) D-Bus
> introspection XML. XSLT wouldn't be a natural choice for that though.
The issue I have with the "XSLT for everything" argument is that XSLT is
hard work for me. So much hard work in-fact that using a decent parser
framework I'm probably more productive just writing a complete parser
anyway.
Take a look at the front end parser code at:
http://git.codethink.co.uk/?p=didl;a=blob_plain;f=didl.g;hb=97dffc228440655c1d3f6724b8bea49c5f5c073f
Yep, thats about 150 lines of code to parse the syntax into an AST. Once
I have an AST its no more difficult to transform that than it is a tree
of XML nodes.
Thanks
Mark
More information about the dbus
mailing list