Question

I see from impnotes 32.3 that clisp has a FFI system. I also see a CFFI project at http://common-lisp.net/project/cffi/.

Can someone knowledgeable please elaborate on any important differences between these two systems? Which is 'better'/'more official'/'recommended'/'more efficient'/'more reliable' etc.?

Many thanks, R.

Was it helpful?

Solution

CLISP FFI is very high-level and, necessarily, CLISP-specific (just like SBCL FFI is SBCL-specific &c).

CFFI is a cross-implementation compatibility layer which is more low-level, and it relies on the underlying implementation's FFI to work.

So, if you are dead set on using a specific implementation, you should be learning its own FFI.

If you want to write code which will run on many different implementations, use CFFI.

PS. Low-level vs high-level means, roughly, that you need to write more characters to achieve the same effect in CFFI than in CLISP FFI; also the result will probably run faster in CLISP FFI.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top