emacs-devel
[Top][All Lists]
Advanced

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

Re: DSO-style FFI


From: Tom Tromey
Subject: Re: DSO-style FFI
Date: Tue, 08 Oct 2013 14:43:39 -0600
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux)

Ted> Would any kind of FFI help with data formats?  I don't think so, right?

Sure.

Basically you would need to expose "native" structures (and pointers and
whatnot) to elisp, so that elisp can manipulate their fields in various
ways.  This is pretty easy to do; libffi doesn't provide code for this
specifically, but you can reuse the type descriptor stuff.

Ted> The foreign function has to take Emacs Lisp_Objects (maybe just strings
Ted> and numbers) and package its return data in a Lisp_Object.  So how do we
Ted> handle that glue with libffi or anything else without promising some
Ted> minimal internal Emacs ABI?

The idea is to have the FFI code be part of Emacs.  So when Emacs
changes, it does too.  What doesn't change is the API presented to
elisp.

This is how FFI works in other languages -- Common Lisp, Python,
probably Guile (I didn't check), Java (it's part of reflection there),
etc.

Ted> I don't know much about libltdl but it seems fairly simple, except for
Ted> the requirement to name all exported symbols _modulename_LTX_* which is
Ted> a bit annoying.

I think that's only for preloaded modules.
Most people don't use this feature.

Tom



reply via email to

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