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 again Date: Sat, 05 Oct 2013 18:24:30 +0200 Message-ID: References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1380990298 15678 80.91.229.3 (5 Oct 2013 16:24:58 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 5 Oct 2013 16:24:58 +0000 (UTC) Cc: emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Oct 05 18:25:02 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 1VSUf7-0007e5-7W for ged-emacs-devel@m.gmane.org; Sat, 05 Oct 2013 18:25:01 +0200 Original-Received: from localhost ([::1]:52402 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VSUf6-00041C-QA for ged-emacs-devel@m.gmane.org; Sat, 05 Oct 2013 12:25:00 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:41410) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VSUez-000411-0t for emacs-devel@gnu.org; Sat, 05 Oct 2013 12:24:58 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VSUet-0005fy-7C for emacs-devel@gnu.org; Sat, 05 Oct 2013 12:24:52 -0400 Original-Received: from mx2.bahnhof.se ([213.80.101.12]:61161) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VSUet-0005ev-0R for emacs-devel@gnu.org; Sat, 05 Oct 2013 12:24:47 -0400 Original-Received: from localhost (mf.bahnhof.se [213.80.101.20]) by mx2-reinject (Postfix) with ESMTP id 296EB7AF64B; Sat, 5 Oct 2013 18:24:45 +0200 (CEST) X-Virus-Scanned: by amavisd-new using ClamAV at bahnhof.se (MF4) Original-Received: from mf4.bahnhof.se ([127.0.0.1]) by localhost (mf4.bahnhof.se [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 6FyKzEwcjIOb; Sat, 5 Oct 2013 18:24:42 +0200 (CEST) Original-Received: from mta.verona.se (h-235-102.a149.priv.bahnhof.se [85.24.235.102]) by mf4.bahnhof.se (Postfix) with ESMTP id 493A63D74CF; Sat, 5 Oct 2013 18:24:41 +0200 (CEST) Original-Received: from localhost (unknown [127.0.0.1]) by mta.verona.se (Postfix) with ESMTP id AEDC44F3EDC; Sat, 5 Oct 2013 16:24:31 +0000 (UTC) X-Virus-Scanned: amavisd-new at verona.se Original-Received: from mta.verona.se ([127.0.0.1]) by localhost (exodia.verona.se [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id gMDFVWwddmdL; Sat, 5 Oct 2013 18:24:30 +0200 (CEST) Original-Received: from exodia.verona.se (www.verona.se [192.168.200.15]) by mta.verona.se (Postfix) with ESMTP id 8B1854F3ED5; Sat, 5 Oct 2013 18:24:30 +0200 (CEST) In-Reply-To: (Stefan Monnier's message of "Sat, 05 Oct 2013 12:11:26 -0400") User-Agent: Gnus/5.130006 (Ma Gnus v0.6) Emacs/24.3.50 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: Mac OS X 10.x X-Received-From: 213.80.101.12 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:163881 Archived-At: Stefan Monnier writes: > As you may remember, I'd really like for Emacs to grow some kind of FFI. > Last time we discussed it, I mostly remember the following points being made: > - An FFI can be a lot of work, and the benefit is not as obvious as it seems. > - Emacs-Guile would give us an FFI for free. > - The xwidget branch indirectly gives us some limited FFI. > > The Emacs-Guile route seems promising, but I'm not sure I want to depend > on its schedule. The xwidget one seems a bit too limited for my taste. > And I surely don't want to put a lot of work into it. > > So I'd like an FFI, but one that's really cheap to design/implement. > > The main purpose of an FFI, as far as I'm concerned, it to make it > possible for Emacs to use any .so library it feels, rather than only the > ones that it was compiled with. More specifically, so that ELPA > packages can use such .so libraries if they feel like. > > I think a "cheapish" way to do that is to make it possible for an ELPA > package to come with a .c file that exports a "syms_of_module" function > that can call things like defsubsr. > > Installing such an ELPA package would require running a C compiler, > obviously (unless we also provide some pre-compiled versions for > particular target systems?). And we'd need to add some function that > can load the resulting compiled object (along with the .so libraries it > depends on, since in many cases the whole purpose would be to call > functions in those .so libs). > > It's not ideal, but it should be reasonably cheap to implement, and > would let people get access to pretty much any library they want. Whats wrong with libffi? http://sourceware.org/libffi/ Its what everyone else uses, including Guile, Xwidgets, and the existing Emacs FFI patches. > > > Stefan > -- Joakim Verona