From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Stephen J. Turnbull" Newsgroups: gmane.emacs.devel Subject: Re: FFI again Date: Mon, 07 Oct 2013 13:34:03 +0900 Message-ID: <87hactlmx0.fsf@uwakimon.sk.tsukuba.ac.jp> References: <87iox9luwa.fsf@uwakimon.sk.tsukuba.ac.jp> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 X-Trace: ger.gmane.org 1381120466 10805 80.91.229.3 (7 Oct 2013 04:34:26 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 7 Oct 2013 04:34:26 +0000 (UTC) Cc: joakim@verona.se, emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Oct 07 06:34:28 2013 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 1VT2Wa-0006D2-Os for ged-emacs-devel@m.gmane.org; Mon, 07 Oct 2013 06:34:28 +0200 Original-Received: from localhost ([::1]:57334 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VT2WZ-0001QP-MP for ged-emacs-devel@m.gmane.org; Mon, 07 Oct 2013 00:34:27 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:47554) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VT2WQ-0001PS-41 for emacs-devel@gnu.org; Mon, 07 Oct 2013 00:34:25 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VT2WD-0000qF-Um for emacs-devel@gnu.org; Mon, 07 Oct 2013 00:34:18 -0400 Original-Received: from mgmt1.sk.tsukuba.ac.jp ([130.158.97.223]:40252) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VT2WD-0000pf-L5 for emacs-devel@gnu.org; Mon, 07 Oct 2013 00:34:05 -0400 Original-Received: from uwakimon.sk.tsukuba.ac.jp (uwakimon.sk.tsukuba.ac.jp [130.158.99.156]) by mgmt1.sk.tsukuba.ac.jp (Postfix) with ESMTP id 2F7133FA09E6; Mon, 7 Oct 2013 13:34:03 +0900 (JST) Original-Received: by uwakimon.sk.tsukuba.ac.jp (Postfix, from userid 1000) id 1C05A12842A; Mon, 7 Oct 2013 13:34:03 +0900 (JST) In-Reply-To: X-Mailer: VM undefined under 21.5 (beta34) "kale" 182d01410b8d XEmacs Lucid (x86_64-unknown-linux) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 130.158.97.223 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:163937 Archived-At: Stefan Monnier writes: > > libxml, maybe. libgnutls I would continue to provide a dedicated > > wrapper for. It's very tricky to get the Lisp-to-C type matching > > robust in an FFI, and if there's a problem in the FFI you probably > > break all existing modules by fixing it. In the meantime, if the FFI > > IIUC this is the kind of problem I was referring to, which would be > mostly avoided by using an FFI system based on hand-written C wrappers: > you don't have to export to Lisp all the C-level details. That's not FFI. Are you confusing runtime loading of DSOs with a foreign function interface (FFI)? FFI means you can write bindings to non-Lisp libraries in Lisp, rather than providing the ABI Lisp expects using code in some other language. The library called need not be dynamically loaded, but in a dynamic language like Lisp, that's obviously a very useful property. XEmacs (and I believe SXEmacs) also has a *separate* facility for dynamically loading C (and maybe C++?) modules (conventionally given the extension .ell) with hand-written wrappers, written by J. Johnston with loads of additional work by Jerry James and a few others. This integrates such modules with the feature system (`provide' and `require'). Both facilities are useful but they are different, serving somewhat different use cases.