Jeremy H. wrote:
theory you might also be able to generate the FFI code from this at
the same time.
That’s my plan, but SWIG is an interesting option too.
Once you’ve had a chance to try things out, I’d be very interested in
hearing about your experiences. I work on the bindings for a large C++
library (wxWidgets) and I’m looking at options for the next version.
We use SWIG at the moment to generate a (MRI-only) wrapper, but this
means that hacking on the core library is a daunting prospect (SWIG is
powerful but complex, C++ is hard and requires a compiler).
I looked a Rb++ for the whole work but there didn’t seem to be enough
gain for the pain of switching over a large code base. SWIG deals with
several C++ features that aren’t supported in Rb++ as far as I can tell:
overloaded methods, implementing virtual methods in Ruby, keeping a
one-to-one link between Ruby instances and C++ objects.
So I’m keen to find out if there’s a way of reducing the complexity of
the SWIG/C++ code and doing more of the wrapping work in Ruby - as well
as being able to potentially run wxRuby on JRuby.