ffi-compiler is a ruby library for automating compilation of native libraries for use with ffi. To use, define your own ruby->native API using ffi, implement it in C, then use ffi-compiler to compile it.