FFI – Foreign Function Invocation

MRI, JRuby, Rubinius and other ruby implementations. What is an extension developer to do? One for each? Enter Foreign Function Invocation. Rubinius and JRuby ship with a version of libffi, and the ‘ffi’ rubygem for MRI. Now we, as extension developers, can write an extension once, and have it run on multiple ruby engines. We will look at differences between building a tradition MRI ruby extension, and building an extension targeting FFI. We will look at the development effort and performance differences between traditional and FFI extensions, and what, if any compatibility issues there are between ruby engines around FFI.