From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: ludo@gnu.org (Ludovic =?iso-8859-1?Q?Court=E8s?=) Newsgroups: gmane.lisp.guile.devel Subject: Re: [PATCH] Doc: protecting procedure->pointer pointers from GC Date: Thu, 02 Feb 2012 22:21:26 +0100 Message-ID: <87ipjpszhl.fsf@gnu.org> References: <87sjiwq3jv.fsf@neil-laptop.ossau.uklinux.net> <87zkd4uryp.fsf@pobox.com> <8739avcw03.fsf@neil-laptop.ossau.uklinux.net> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: dough.gmane.org 1328217711 26380 80.91.229.3 (2 Feb 2012 21:21:51 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 2 Feb 2012 21:21:51 +0000 (UTC) To: guile-devel@gnu.org Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Thu Feb 02 22:21:50 2012 Return-path: Envelope-to: guile-devel@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Rt46H-0006bF-9l for guile-devel@m.gmane.org; Thu, 02 Feb 2012 22:21:49 +0100 Original-Received: from localhost ([::1]:50522 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rt46G-00059P-Pv for guile-devel@m.gmane.org; Thu, 02 Feb 2012 16:21:48 -0500 Original-Received: from eggs.gnu.org ([140.186.70.92]:53151) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rt46C-00058a-5F for guile-devel@gnu.org; Thu, 02 Feb 2012 16:21:46 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Rt468-0001kJ-S4 for guile-devel@gnu.org; Thu, 02 Feb 2012 16:21:44 -0500 Original-Received: from plane.gmane.org ([80.91.229.3]:36556) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rt468-0001jM-N0 for guile-devel@gnu.org; Thu, 02 Feb 2012 16:21:40 -0500 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1Rt466-0006VU-4x for guile-devel@gnu.org; Thu, 02 Feb 2012 22:21:38 +0100 Original-Received: from reverse-83.fdn.fr ([80.67.176.83]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 02 Feb 2012 22:21:38 +0100 Original-Received: from ludo by reverse-83.fdn.fr with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 02 Feb 2012 22:21:38 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 53 Original-X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: reverse-83.fdn.fr X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 14 =?iso-8859-1?Q?Pluvi=F4se?= an 220 de la =?iso-8859-1?Q?R=E9volution?= X-PGP-Key-ID: 0xEA52ECF4 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 83C4 F8E5 10A3 3B4C 5BEA D15D 77DD 95E2 EA52 ECF4 X-OS: x86_64-unknown-linux-gnu User-Agent: Gnus/5.110018 (No Gnus v0.18) Emacs/24.0.93 (gnu/linux) Cancel-Lock: sha1:IyJE8eo0fNuzJxF1WbijKgUUzA0= X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 80.91.229.3 X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Developers list for Guile, the GNU extensibility library" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Original-Sender: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.devel:13784 Archived-At: Hi Neil, Neil Jerram 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’.