Improve extension API: C++ as better language for extension
summary
Proposal replaces manual C bindings with a C++ layer that wraps Ruby’s C API to provide cleaner, template‑based conversions, lambdas, default args and initializer lists; existing prototypes Ext++ and Rice implement these ideas and reuse C macros so no extra bindings are needed. Ext++ adds delayed method definition and measures defining 10,000 methods at 5 ms vs 1 ms when delayed (a 5× relative speedup, 4 ms absolute). Notes cover implicit cast traps, exception bridging, and tradeoffs in build complexity.
AI-written summary · about
chapters (7)
- 0:00Introduction and announcements
- 3:41Why improve extension APIs
- 9:50Goals for extension API design
- 13:38Advantages of C++ for APIs
- 27:21C++ API benefits and optimizations
- 35:47Challenges and future plans
- 36:08Q&A on API stability
related talks
24mThe State of C Extensions: Alive and Well, so Learn to Deal
47mRewriting a Ruby C Extension in Rust
46mAvoiding Pitfalls in C Extensions
31mHelix: Native Extensions for Everyone
01h 08mC++ Metaprogramming: A Paradigm Shift
36mIntroduction to C++ python extensions and embedding Python in C++ Apps
35mRuby’s C Extension Problem and How We're Solving It
01h 37mC++ And Beyond: Discussion
