Late with purpose

by baggers

I didn't get an entry in on time as I was holding out on finishing a feature yesterday. Which I did so now I have something to report.

I have finished the FFI groveler caching feature. < cue fireworks >

Ok so quick background:

  • An FFI lets your language call another language
  • Lisp's FFI is called CFFI
  • CFFI lets you use C libraries from lisp
  • CFFI has something called the groveller
  • The groveller can generate helper C & lisp code to help interface with interacting with C
  • The groveller required you to have a C compiler set up on your machine so it can compile the C libraries it generated

That last note there was an issue for me as some of my users don't have C compilers set up on their machine, they just want to code lisp.

The answer is to allow users with C compilers to contribute the dll/so files from their build to the projects. That would mean that people on machines without compilers can use this cached version of the generated libraries.

This is done now.

Before you would write the following in your lisp project definition in order to use the groveller

(:wrapper-file "wrappers" :soname "libosicat")

Where wrappers is a file that tells the groveller what to generate wrappers for.

Now you can write this:

(:wrapper-file "wrappers" :soname "libosicat" :cache-dir "grovel-cache")

Where grovel-cache will be the folder where the results are cached. Simple!

This system takes into account a bunch of details to make sure it handles operating systems, architectures and varying lisp features correctly.

It ended up being not much code, but it took quite a while to learn enough to understand where/what to write.

Next is getting back to converting OSX Frameworks into regular .so files that can be shipped with projects more easily.