Next: , Previous: , Up: Top   [Contents][Index]


65 Foreign Function Interface (FFI)

The SXEmacs Foreign Function Interface (FFI for short) adds support for invoking code written in other programming languages from within elisp. The FFI focuses on interaction with C code, but the basic framework can also be used for interfacing to languages other than C, provided they support to be compiled to binary and linked into a shared library.

The SXEmacs FFI can access sharable object files at runtime and use their definition without relocating or relinking the SXEmacs binary. The purpose (and main motivation) therefore clearly is to supply elisp programmers with a convenient way to implement features from underlying libraries without even touching the C level.

The FFI feature itself must be considered experimental, though. It is a lot of effort to secure raw library calls from misuse, especially because the SXEmacs error handler has no influence on the events triggered inside of the foreign library. On the other hand, keeping foreign function calls under exhaustive surveillance would noticably slow down the FFI, if not even limit the capabilities at all.


Next: , Previous: , Up: Top   [Contents][Index]