From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: DSO-style FFI Date: Sat, 12 Oct 2013 14:55:26 -0400 Message-ID: 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> <87wqlitse5.fsf@maru2.md5i.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1381777066 7034 80.91.229.3 (14 Oct 2013 18:57:46 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 14 Oct 2013 18:57:46 +0000 (UTC) Cc: Tom Tromey , jerry.james@xemacs.org, emacs-devel@gnu.org To: Michael Welsh Duggan Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Oct 14 20:57:49 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 1VVnKu-0001Aq-Fq for ged-emacs-devel@m.gmane.org; Mon, 14 Oct 2013 20:57:48 +0200 Original-Received: from localhost ([::1]:38354 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VVnKu-00089G-4x for ged-emacs-devel@m.gmane.org; Mon, 14 Oct 2013 14:57:48 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:52390) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VVnKj-00088c-Jr for emacs-devel@gnu.org; Mon, 14 Oct 2013 14:57:44 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VVnKb-0007OI-EB for emacs-devel@gnu.org; Mon, 14 Oct 2013 14:57:37 -0400 Original-Received: from pruche.dit.umontreal.ca ([132.204.246.22]:53550) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VVnKb-0007Ns-51 for emacs-devel@gnu.org; Mon, 14 Oct 2013 14:57:29 -0400 Original-Received: from ceviche.home (lechon.iro.umontreal.ca [132.204.27.242]) by pruche.dit.umontreal.ca (8.14.1/8.14.1) with ESMTP id r9EIvPaD006554; Mon, 14 Oct 2013 14:57:26 -0400 Original-Received: by ceviche.home (Postfix, from userid 20848) id E992466086; Sat, 12 Oct 2013 14:55:26 -0400 (EDT) In-Reply-To: <87wqlitse5.fsf@maru2.md5i.com> (Michael Welsh Duggan's message of "Sat, 12 Oct 2013 11:34:26 -0400") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) X-NAI-Spam-Flag: NO X-NAI-Spam-Threshold: 5 X-NAI-Spam-Score: 0.4 X-NAI-Spam-Rules: 2 Rules triggered DATE_IN_PAST_48_96=0.4, RV4731=0 X-NAI-Spam-Version: 2.3.0.9362 : core <4731> : inlines <142> : streams <1055822> : uri <1565255> X-NAI-Spam-Level: X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 132.204.246.22 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:164213 Archived-At: > It seems to me that writing libffi support to Emacs isn't that difficult > in and of itself. I have no doubt that I could hack in something > low-level without too much difficulty. Could be. I haven't seen anything concrete (and of course, providing access to libffi is only one half of the problem, the other half is to write the binding to lib, and my impression is that more people would know how to do that if that part were written in C). > The problems I see are A) that it would be trivial to use such an > interface to crash or subvert emacs from elisp, This is a fundamental property of anything that lets gives access to "any" library. DSO or FFI is in the same boat. IOW, if we really consider it as too dangerous, then we can't provide anything related to an FFI or dynamic loading of code. > and B) that such a binding will allow people to write non-free > extensions to Emacs in just the way that RMS has specifically stated > that he would like to avoid. Presumably we can prevent it by checking (before loading the library) that the library is compatible with the GPL (following the scheme designed originally for gcc). > This isn't to say that something that is not libffi itself could use > libffi to create something safer. Don't worry: as long as you want to be able to link libraries written in languages like C, you can't make it safer. Stefan