From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Michael Welsh Duggan Newsgroups: gmane.emacs.devel Subject: Re: DSO-style FFI Date: Sat, 12 Oct 2013 11:34:26 -0400 Message-ID: <87wqlitse5.fsf@maru2.md5i.com> 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 X-Trace: ger.gmane.org 1381592089 28026 80.91.229.3 (12 Oct 2013 15:34:49 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 12 Oct 2013 15:34:49 +0000 (UTC) Cc: Tom Tromey , jerry.james@xemacs.org, emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Oct 12 17:34:54 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 1VV1DR-0005uC-Ay for ged-emacs-devel@m.gmane.org; Sat, 12 Oct 2013 17:34:53 +0200 Original-Received: from localhost ([::1]:58565 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VV1DQ-00042C-Tr for ged-emacs-devel@m.gmane.org; Sat, 12 Oct 2013 11:34:52 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:39129) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VV1DJ-00041q-Ee for emacs-devel@gnu.org; Sat, 12 Oct 2013 11:34:50 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VV1DF-0004r9-2q for emacs-devel@gnu.org; Sat, 12 Oct 2013 11:34:45 -0400 Original-Received: from md5i.com ([75.151.244.229]:36895 helo=maru2.md5i.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VV1DE-0004ql-TQ for emacs-devel@gnu.org; Sat, 12 Oct 2013 11:34:40 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=md5i.com; s=dkim; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date:References:Subject:Cc:To:From; bh=BdfW2PEuQShhgCaVH5fb+8Q0MZUHNix3sFzoi+k6/vI=; b=OEoDb1o6hXctnp/6OcW3bg+QvmXEhFQb4wJfUmyiDGWKCbwznqH1BHJLNA5gfrldw5QU6alUr1nU/4qZgnMQv2zevbGhZz98anOVpgbz3FUFyaZ8DdxoRp5qdQGM8YWM; Original-Received: from md5i by maru2.md5i.com with local (Exim 4.80) (envelope-from ) id 1VV1D0-0006Ag-53; Sat, 12 Oct 2013 11:34:26 -0400 In-Reply-To: (Stefan Monnier's message of "Tue, 08 Oct 2013 22:40:59 -0400") User-Agent: Gnus/5.130008 (Ma Gnus v0.8) Emacs/24.3.50 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 75.151.244.229 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:164148 Archived-At: Stefan Monnier writes: >> This approach seems very weird to me. > > Yup. > >> I don't understand why it is preferable to a libffi-based FFI. > > I don't claim it's a better solution, really. I just don't see anny > movement towards providing libffi support (other than people saying we > should do it). > > I think the reason is that I don't know anyone who's willing/able to add > libffi support to Emacs and write the corresponding code to link to > (say) libgnutls. 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. The problems I see are A) that it would be trivial to use such an interface to crash or subvert emacs from elisp, 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. As an example, it would be possible to use a raw libffi binding to call memset with appropriate arguments to tromp right over any memory that emacs has access to. This isn't to say that something that is not libffi itself could use libffi to create something safer. Though I don't know what that would be. -- Michael Welsh Duggan (md5i@md5i.com)