From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: =?UTF-8?Q?Aur=C3=A9lien_Aptel?= Newsgroups: gmane.emacs.devel Subject: FFI in Emacs Date: Thu, 28 Jun 2012 01:36:14 +0200 Message-ID: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: dough.gmane.org 1340840181 11758 80.91.229.3 (27 Jun 2012 23:36:21 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 27 Jun 2012 23:36:21 +0000 (UTC) To: Emacs development discussions Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Jun 28 01:36:21 2012 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 1Sk1mX-00021X-42 for ged-emacs-devel@m.gmane.org; Thu, 28 Jun 2012 01:36:21 +0200 Original-Received: from localhost ([::1]:49346 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Sk1mX-0000D7-0m for ged-emacs-devel@m.gmane.org; Wed, 27 Jun 2012 19:36:21 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:55244) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Sk1mU-0000Cy-NN for emacs-devel@gnu.org; Wed, 27 Jun 2012 19:36:20 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Sk1mS-0000KW-LN for emacs-devel@gnu.org; Wed, 27 Jun 2012 19:36:18 -0400 Original-Received: from mail-ob0-f169.google.com ([209.85.214.169]:32777) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Sk1mS-0000JT-DM for emacs-devel@gnu.org; Wed, 27 Jun 2012 19:36:16 -0400 Original-Received: by obhx4 with SMTP id x4so2681029obh.0 for ; Wed, 27 Jun 2012 16:36:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:date:x-google-sender-auth:message-id:subject :from:to:content-type; bh=dKfpvwHJl+gOy+YI9cxwqjdfbb82lzFDVq1mHnPyFjk=; b=d0alfFQXywrmCIwCkt0VjJfNE2RmEDOjnJsOJDKroIH8zirftDdgTepUiKntj3nvT/ Qnok4f1jkbZbPNhYOgFinlr15Td/IgW0NYcN4skWxzvv+Cf6DTA9nnyD8Ilj63rTnvX4 AuQuEdtL3e6G4O3wCzOa3XAXWOps4/D7beY1PaLupkB2r0PhcDaMbGjnVYsjB9poCTGj AdFivrmxduuMx6rD8fWdu+uISIXnm51aZVKSCsHou7V5RKPSeYwvCgvV3HhdYM0DEc+D f/kk/UhXlHL91wXW9iAjUyRT4OcxoovqODGDnkcmPShIOe5yT5hD4KZZd2ZMyKc6cuL1 oFLg== Original-Received: by 10.60.13.228 with SMTP id k4mr11250018oec.28.1340840174240; Wed, 27 Jun 2012 16:36:14 -0700 (PDT) Original-Received: by 10.182.241.7 with HTTP; Wed, 27 Jun 2012 16:36:14 -0700 (PDT) X-Google-Sender-Auth: mwcBdCCnCLT0B9SLKu6RkjkEhSo X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 209.85.214.169 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:151243 Archived-At: Hi all, I know this subject has already been discussed in the past but the people involved and their opinions may have changed since then. For those who don't know, a Foreign Function Interface is basically a way to use code from one language in another. More on wikipedia [1]. Here, it's calling dynamically C code from Emacs-Lisp. Dynamically, means without the need to recompile/link Emacs. One could use a function in a C library from ELisp just by knowing its prototype. It has already been done in SXEmacs [2] (a fork of a fork of GNU Emacs) and I think I've heard on IRC that someone ported it but it was never merged or suffered from bitrot. By the way, SXEmacs also has some very nice features like raw strings (= more readable regex), new data structures (skip lists, double linked list, ...) or compiled regex that could be ported. All in all, FFI is a really cool feature. The only real problem is that some people (and particularly Dr. Stallman) think that a FFI might lead to the development of proprietary plugins. Someone could write a nice plugin, only give away a compiled version of the plugin and an elisp wrapper. Not so long ago, there was a similar problem with GCC that you might have heard about. GCC did not provide any plugin interface for the same fear of having a proprietary plugin. It all changed in the 4.5 release (2010) and you can know write a plugin without recompiling GCC. I think transition to GPLv3 has a lot to do with this change because the new license is more secure (legally speaking) and covers more cases that used to be problematic in v2. Maybe it's time to do the same for Emacs and start moving forward. 1: http://en.wikipedia.org/wiki/Foreign_function_interface 2: http://www.sxemacs.org/