[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: DSO-style FFI

From: Stephen J. Turnbull
Subject: Re: DSO-style FFI
Date: Wed, 09 Oct 2013 10:48:54 +0900

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).

reply via email to

[Prev in Thread] Current Thread [Next in Thread]