Jan Svitok wrote:
> You may also try SWIG, that will generate the extension for you from
> your header file (sometimes it needs little tweaking).
> 
> http://www.swig.org/
> 
> On 8/23/06, Dido Sevilla <dido.sevilla / gmail.com> wrote:
>> On 8/23/06, kandlinger / gmx.de <kandlinger / gmx.de> wrote:
>> > Hello, I am currently developing a webshop which uses a c/c++ shared
>> > object/dynamic link library for some functions. Currently I am
>> > evaluating which technology I should use. As I've got  a completely
>> > free choice I was thinking of Java Server Faces or Ruby on Rails. I
>> > never used Ruby on Rails before, so my question is: How big is the
>> > support of Ruby to access a c/c++ shared object/dynamic link library of
>> > which i only got a c/c++ header file ?
>>
>> Actually, it's incredibly easy to write C extensions for Ruby,
>> compared to many other languages. The file README.EXT in the Ruby
>> source distribution explains how this can be done, and compared to
>> languages such as Perl (which uses a small domain-specific language)
>> and Java (JNI is also messy), it is quite simple.  Which is why too
>> many people don't consider Ruby's general slowness that big a problem;
>> it is easy enough to write C extensions for speed-critical portions of
>> the code.
> 
> 
I'm just now getting to learn SWIG in general and the Ruby interface in
particular. The Ruby/C interfacing is fairly simple, but C++ is a good
bit more complicated. First off, make sure you have the latest
development version of SWIG -- I have swig-1.3.29. The documentation is
all in HTML; they haven't put up a PDF yet. The web site is
http://www.swig.org.

One thing SWIG lets you do is develop code in C/C++, and then make
interface modules that support *all* the scripting languages SWIG
supports! That is, you write one set of C/C++ code and one set of
interface modules, and SWIG builds the wrapper code for all the
scripting languages!. Right now, they support guile, Java, Lua, mono,
Ocaml, Perl, PHP, Python, Ruby, Tcl/Tk and Pike.