guile-devel
[Top][All Lists]
Advanced

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

Re: [PATCH] Doc: protecting procedure->pointer pointers from GC


From: Ludovic Courtès
Subject: Re: [PATCH] Doc: protecting procedure->pointer pointers from GC
Date: Thu, 02 Feb 2012 22:21:26 +0100
User-agent: Gnus/5.110018 (No Gnus v0.18) Emacs/24.0.93 (gnu/linux)

Hi Neil,

Neil Jerram <address@hidden> skribis:

> Another relevant factor is that I need relatively few guile-gnome entry
> points because I'm only using gobject/glib to get gdbus, and the UI is
> built with Edje, not Gtk/Gnome.  In fact it's a strange (but IMO fun)
> hotchpotch:
>
> - Edje/Evas for the UI (using 17 pointer->procedures)
>
> - GDBus to access the oFono D-Bus API (using pointer->procedures: 3
>   for basic GObject stuff, 11 for GVariant handling, and 2 for GDBus).
>
> and I will probably add in more stuff for audio routing (PulseAudio?)
> and accessing contact information (whatever the latest evolution of
> Evolution Data Services is).

Sounds like a lot of fun.  :-)

> I think the key benefit is that the (system foreign) approach is so
> immediate.  I just add whatever API I need there, and the hack
> continues...

Yes, that’s really neat.

> My only reservation - and quite a big one - is that it's a bit like
> going back in time to when compilers had no type checking for pointers.
> In that sense it is rather fast and loose, compared to C programming.

Indeed.  Plus, you sometimes have to be careful about memory management,
specifically making sure the lifetime of C objects matches that of their
companion Scheme objects.

> But overall I love it, and I'd suggest that an alternative question (to
> the one you asked above) would be why do you think we need bindings
> anymore?

Well, these are still bindings.  :-) It can be written more quickly, but
you still have to do a bit of polishing to make the API more Schemey,
write a test suite (esp. to mitigate the “loose” aspect of the FFI), etc.

> Well I hope that's of interest, and I'm sure you'll have interesting
> counter-thoughts...  In case you or anyone wants to look at the code,
> I've pushed it to http://git.savannah.gnu.org/cgit/ossaulib.git/.  The
> main script is at scripts/phone.

Looks great!  I had a glance at the E17 bindings, and I see that the API
uses raw pointer objects; using “wrapped pointer types” would provide
type checking, and a nicer UI if you add printers.  :-)

Cheers,
Ludo’.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]