Вопрос

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.

Это было полезно?

Решение

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.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top