Re: GVariant for prez!



Hey Ryan,

On Wed, 2009-04-08 at 10:17 -0400, Ryan Lortie wrote:
> Hello Everyone!
> 
> I'm proposing GVariant for inclusion in glib this cycle.
> 
> I've created a 'gvariant' branch of glib and pushed it to the official 
> repository.
> 
> For those who don't know what GVariant is, please see the announcement 
> email here:
> 
> http://mail.gnome.org/archives/gnome-announce-list/2009-March/msg00103.html
> 
> 
> 
> GVariant is currently used by GBus and dconf/GSettings.  It has general 
> usefulness to anyone who wants to do any of the following things:
> 
>    - send structured data over network sockets
> 
>    - save structured data to disk
> 
>    - efficiently deserialise this data (particularly out of mmaped
>      regions; only as much is faulted in as is needed; this makes it
>      great for icon/schema/font/etc type cache files)
> 
>    - do anything with dbus, really.
> 
> The type system, of course, is that of DBus.

Just a few short comment, I haven't looked a lot on this so maybe I'm
missing a few key points here, so apply salt etc. However

 - GVariant brings in a completely new type system

 - The API looks very similar to DBusMessage and DBusMessageIter

While I can see the general usefulness of having a DBusMessage-ish API
being used outside libdbus let us focus on what it is we need (or a
least what I think we need)

 - Low-level D-Bus integration and utilities at the GLib level. Havoc
   made a lot of good arguments for having something like hippo-dbus-
   helper available in GLib/GObject. Which would expose libdbus stuff
   like DBusMessage so higher-level stuff can take advantage of it
   without us copying data around and allocating/freeing stuff all the
   time.

 - High-level D-Bus object mapping for C with GObject, ie. something
   like the EggDBus stuff. Would use the low-level bits (e.g. either
   GVariant and/or the hippo-ish stuff and/or GBus; doesn't really
   matter because low-level details would be abstracted out as much
   as possible).

 - High-level D-Bus object mappings for other languages. Again, building
   on top of the low-level stuff.

 - Some kind of replacement for GConf. I understand your proposal is
   not dconf per se, it's GSettings, right? Do you expect people to
   use the GVariant API in GSettings?

Basically my impression is that GVariant is a lot like DBusMessage and
frankly, for application writers, I'm not sure that is good API (while
for bindings / low-level stuff it is fine). Then again, I'm known to
favor type-safety / generated code which some people regard as an
extremist view. And I haven't tried GVariant so in some way I'm just
speaking out of my ass.

Anyway, for at least the D-Bus stuff I think it's much cleaner to just
use e.g. DBusMessage for low-level bits instead of reinventing the
wheel. For the GSettings stuff, I don't know, I haven't looked at it but
I would hope the API is simpler than something involving
DBusMessage/GVariant. For your other use cases, I don't know, haven't
thought about it.

Btw, the copyright headers in your glib branch still says GPLv3. You
should probably change that...

     David




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]