unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
From: ludo@gnu.org (Ludovic Courtès)
To: guile-devel@gnu.org
Subject: Re: [PATCH] Doc: protecting procedure->pointer pointers from GC
Date: Thu, 02 Feb 2012 22:21:26 +0100	[thread overview]
Message-ID: <87ipjpszhl.fsf@gnu.org> (raw)
In-Reply-To: 8739avcw03.fsf@neil-laptop.ossau.uklinux.net

Hi Neil,

Neil Jerram <neil@ossau.homelinux.net> 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	other threads:[~2012-02-02 21:21 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-30 21:32 [PATCH] Doc: protecting procedure->pointer pointers from GC Neil Jerram
2012-01-31  9:44 ` Andy Wingo
2012-01-31 23:06   ` Neil Jerram
2012-02-02 21:21     ` Ludovic Courtès [this message]
2012-02-03  8:56       ` Neil Jerram

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87ipjpszhl.fsf@gnu.org \
    --to=ludo@gnu.org \
    --cc=guile-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).