Subject:
Re: [ruby-ffi] Re: c++ examples
From:
Wayne Meissner
Date:
12/1/09 10:21 PM
To:
ruby-ffi@googlegroups.com

2009/12/2 rogerdpack <rogerpack2005@gmail.com>:
>
>> Unlike C, C++ does not have a stable ABI, so supporting C++ in FFI
>> would be a huge undertaking (i.e. supporting the bazzilion of
>> different ABIs in existance so far). I think your best bet right now
>> is to write C wrappers around the Boost stuff and then use FFI to talk
>> to the C wrappers.
>
> Thanks for the suggestions.  I'll look into using rice or writing my
> own wrappers to it.  I assume that having to do so will make my code
> slightly harder to integrate with jruby, is that right?


If you do a C API wrapper around the C++ bits you need, then you
should be able to use the C wrapper from FFI on either MRI or JRuby.

If you use rice, then it won't work on jruby at all.  Although, the
rice C++ api does look semi-sane, so it might be interesting to
implement support for it in JRuby - but its not going to happen this
week.