I talked about how one could find packages written to support linking Lisp to many popular external libraries. But what do you do if you want to use a less prominent library, one that hasn’t been set up in that way, or if you have a privately developed C library that you want to link to your Lisp code?
This is where we make use of the CFFI for Lisp. I’m not going to repeat how to use it, there are certainly tutorials available on the web. You might start with this one. My purpose here is to point out its existence and describe some of its abilities.
To put it simply, you can use CFFI to link into a shared object library which exports a C interface. Using the library’s header file, you can create a Lisp wrapper that calls into the library, and then easily use this library in any of your Lisp projects.