FFI: Creating Cross-Engine Gems
summary
A concrete claim: use libffi to write one binding usable across MRI and JRuby instead of separate C and Java reimplementations. Example: a small libsimplemetrics C library gets a compact FFI DSL mapping header to Ruby that takes ~40 minutes to write versus over an hour for a C extension, and a 1,000,000-call microbenchmark shows roughly ~0.4s extra overhead for FFI while the same Ruby code then runs unchanged on JRuby.
AI-written summary · about
chapters (6)
- 0:00Start
- 2:29What Ffi Stands for
- 15:21Side by Side Comparison
- 17:28Benchmark Screen Repair
- 21:31Opencl
- 23:36Transitions








