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: DSO-style FFI Date: Wed, 09 Oct 2013 10:48:54 +0900 Message-ID: <87hacrjjsp.fsf@uwakimon.sk.tsukuba.ac.jp> References: <877gdqrc9u.fsf@flea.lifelogs.com> <87mwmmp05f.fsf@flea.lifelogs.com> <87fvsdpato.fsf@flea.lifelogs.com> <8738oc20xk.fsf@flea.lifelogs.com> <87d2ngzlyl.fsf_-_@flea.lifelogs.com> <87siwcxda7.fsf@flea.lifelogs.com> <87zjqjfz36.fsf@fleche.redhat.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 X-Trace: ger.gmane.org 1381283355 26836 80.91.229.3 (9 Oct 2013 01:49:15 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 9 Oct 2013 01:49:15 +0000 (UTC) Cc: emacs-devel@gnu.org, Stefan Monnier , jerry.james@xemacs.org To: Tom Tromey Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Oct 09 03:49:17 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 1VTito-0001GK-Ua for ged-emacs-devel@m.gmane.org; Wed, 09 Oct 2013 03:49:17 +0200 Original-Received: from localhost ([::1]:39808 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VTito-0002bG-7I for ged-emacs-devel@m.gmane.org; Tue, 08 Oct 2013 21:49:16 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:56325) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VTite-0002Zi-Mw for emacs-devel@gnu.org; Tue, 08 Oct 2013 21:49:13 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VTitV-0001Xs-Pe for emacs-devel@gnu.org; Tue, 08 Oct 2013 21:49:06 -0400 Original-Received: from mgmt1.sk.tsukuba.ac.jp ([130.158.97.223]:48007) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VTitV-0001We-Fy for emacs-devel@gnu.org; Tue, 08 Oct 2013 21:48:57 -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 7407C3FA0A12; Wed, 9 Oct 2013 10:48:54 +0900 (JST) Original-Received: by uwakimon.sk.tsukuba.ac.jp (Postfix, from userid 1000) id 7206D1A71D9; Wed, 9 Oct 2013 10:48:54 +0900 (JST) In-Reply-To: <87zjqjfz36.fsf@fleche.redhat.com> 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:164028 Archived-At: Tom Tromey writes: > I don't understand why it is preferable to a libffi-based FFI. Offering dynamic loading only preserves the safety of the Lisp language itself, modulo bugs in the called C code. An FFI done simply will make it possible to write buggy Lisp code that crashes non-buggy Emacs and/or non-buggy external libraries. Doing the FFI right is very finicky and probably depends on the internals of libffi and Emacs. As Ralph Nader put it, "unsafe at any speed". > The main difficulty I see is that now you're either promising an > internal Emacs ABI -- hard to do Just for the subr calls. Modules aren't allowed to call ordinary functions from Emacs, just DEFUNs. > -- or you're requiring recompilations whenever Emacs changes -- > hard on users. Perhaps. Worry about this, and the complete lack of demand from non-developer users, is why XEmacs has never made DSOs part of the package system. > Stefan> One issue will be compatibility of various kinds of dl_open > Stefan> mechanisms on various OSes, but you should find lots of help for > Stefan> that here, so the first version can focus on supporting only > Stefan> GNU/Linux. > > GNU already has libltdl. I forget which one it is, but one of the dlopen mechanisms now works on recent versions of all platforms XEmacs supports (I think even native Windows).