On Tue, May 13, 2003 at 08:51:57PM +0900, Jacky Buyck wrote:
> Hi all.
> 
>     I plan to create a Scripting Engine for my future application (NEtwork
> Tools but also for 3D Demo or Games that represent the fun part of my job
> ;) ).
>     For this I've search after some scripting langage that can be integrate
> into C/C++ apps and I particularly focuse on :
>     - LUA ;
>     - Python ;
>     - and Ruby.
> 
>     The last one really interesting me because it's a true OO langage. And
> it's seem that we can do mass of things with it.
>     The only bad point that I encounter here is the lack of information
> regarding the integration of a potential Ruby VM into a C/C++ apps. I'll not
> learn you something new if I say that we can drain mush more interest of an
> application if we can control it by script. So my questions is the next one
> :
> 
>     - Is there an easy way to integrate Ruby in a C/C++ application like we
> can do in LUA ?

It's very easy! BTW, I'm currently integrating Ruby into a C/C++
application, too. 

A simple example:

  // link with -lruby

  #include "ruby.h"

  int main(int argc, char** argv) {
    ruby_init();

    rb_eval_string("p 'Hello World'");
    
    return 0;
  }



For more information, read the online chapter of Programming Ruby:

http://www.rubycentral.com/book/ext_ruby.html

Ruby Developer's Guide covers this, too, but it's not online.

Regards,

  Michael