From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: joakim@verona.se Newsgroups: gmane.emacs.devel Subject: Re: FFI in Emacs Date: Sat, 25 Aug 2012 20:20:19 +0200 Message-ID: References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1345918850 7732 80.91.229.3 (25 Aug 2012 18:20:50 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 25 Aug 2012 18:20:50 +0000 (UTC) Cc: emacs-devel@gnu.org To: =?iso-8859-1?Q?Aur=E9lien?= Aptel Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Aug 25 20:20:50 2012 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1T5KyT-000741-Ad for ged-emacs-devel@m.gmane.org; Sat, 25 Aug 2012 20:20:45 +0200 Original-Received: from localhost ([::1]:42775 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T5KyR-0001RK-7l for ged-emacs-devel@m.gmane.org; Sat, 25 Aug 2012 14:20:43 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:40132) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T5KyP-0001RD-8s for emacs-devel@gnu.org; Sat, 25 Aug 2012 14:20:42 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1T5KyO-0001NA-9z for emacs-devel@gnu.org; Sat, 25 Aug 2012 14:20:41 -0400 Original-Received: from mx1.bahnhof.se ([213.80.101.11]:51605) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T5KyO-0001My-3W; Sat, 25 Aug 2012 14:20:40 -0400 Original-Received: from localhost (mf.bahnhof.se [213.80.101.20]) by mx1-reinject (Postfix) with ESMTP id 66AC32954BF; Sat, 25 Aug 2012 20:20:36 +0200 (CEST) X-Virus-Scanned: by amavisd-new using ClamAV at bahnhof.se (MF3) Original-Received: from mf3.bahnhof.se ([127.0.0.1]) by localhost (mf3.bahnhof.se [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 2o8e73PHMNAr; Sat, 25 Aug 2012 20:20:30 +0200 (CEST) Original-Received: from exodia.verona.se (h-235-102.a149.priv.bahnhof.se [85.24.235.102]) by mf3.bahnhof.se (Postfix) with ESMTP id CD68E605079; Sat, 25 Aug 2012 20:20:29 +0200 (CEST) Original-Received: from chopper.vpn.verona.se (DIR-655.verona.se [192.168.200.86]) by exodia.verona.se (Postfix) with ESMTP id DFE834E008A; Sat, 25 Aug 2012 20:20:19 +0200 (CEST) In-Reply-To: (=?iso-8859-1?Q?=22Aur=E9lien?= Aptel"'s message of "Sat, 25 Aug 2012 19:25:05 +0200") User-Agent: Gnus/5.130006 (Ma Gnus v0.6) Emacs/24.2.50 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: FreeBSD 6.x (1) X-Received-From: 213.80.101.11 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:152834 Archived-At: Aur=E9lien Aptel writes: > Hi all, > > Joakim, thank you for your work! Did you make any progress since then? > I was wondering, is anyone else working on this? > > The patch mentioned earlier to load dynamically compiled modules is > not a FFI but it can be useful nonetheless. Why not have both? I commited the GIR patch to the xwidget emacs repo. You can already do interesting=20 ings with it: - create gnome objects dynamically(previously only hardcoded objects were possible) - dynamically call their methods, with an (early) lisp to C object marshaller Anyway, a FFI needs type information from somewhere, and with GIR you get that from=20 e library provider. Therefore GIR is IMHO more interesting than plain FFI. You can also provide GIR typelib wrappers that would benefit all GIR implementations, not only the xwgir one in the xwidget branch. Well maybe that wasnt so clear. Hear is a concrete example: - you want to call the libmagic file info functions - wrap libmagic in a tiny wrapper that provides gir typeinfo - now you can call these libmagic functions from Emacs, and the xwgir functions can figure out how to convert elisp data to the data needed by the library. - but now your friends using gir from python etc can also benefit your work! I think this is the right aproach, but it does not exclude a plain FFI implementation. -- Joakim Verona