Building a Modern Ruby <-> C++ Toolchain
summary
Modernized Rice adds C++11+ templates, STL support, ownership semantics and buffer/pointer handling, FFI‑Clang parses headers into an AST and RubyBindGen auto‑generates Rice or FFI glue plus CMake projects, and RubyGems now understands modern CMake. Result: a working OpenCV Ruby gem with ~1,158 classes, ~10,000 methods, 160 enums and ~1,000 fields, a ported test suite, and live demos (webcam face detection, filters and a neural‑net person detector). Builds compile and pass the added unit tests.
AI-written summary · about
chapters (15)
- 0:00Introduction and background
- 3:14Rice library limitations
- 8:34Ruby C++ ecosystem overview
- 10:23FFI clang parsing C++
- 11:45Ruby Bind Genen creation
- 12:48Challenges in C++ binding
- 14:56CMake build system updates
- 17:24RubyGems CMake support
- 18:48OpenCV Ruby binding issues
- 20:57Testing and debugging process
- 21:17Current state of gems
- 22:23Live demo of OpenCV Ruby
- 23:47Documentation and type info
- 26:57Example gem bitmap++ Ruby
- 27:42Conclusion and call to action








