[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
FFI in Emacs
FFI in Emacs
Thu, 28 Jun 2012 01:36:14 +0200
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 .
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  (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.
- FFI in Emacs,
Aurélien Aptel <=