Integrate Ruby into my futures C/C++ apps

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
:wink: ).
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 ?

From what I've see (a question posted 26 april 03) it's plane for Ruby

2.0 but is there existing way to do it now or did you discourage me to take
this way for the moment ?

Really thanks to you.
Hope to have news soon.

Jacky Buyck
jacky.buyck@wanadoo.fr

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

···

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
:wink: ).
    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 ?

I am working on a tutorial on how to embed Ruby into C++. It is still in a
very early state. The basic code is working. I am doing some in-depth
studies of more advanced issues at the moment (capturing output,
multithreading)… these things of couse needs rework.

http://metaeditor.sf.net/embed/

Feedback is very welcome. I would like to know how to make it more
intuitive. Especialy if you have any breakdowns I would like to know so I
can improve that part.

···

On Tue, 13 May 2003 14:48:12 +0200, Jacky Buyck wrote:

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.

- Is there an easy way to integrate Ruby in a C/C++ application like we

can do in LUA ?


Simon Strandgaard

This may be like swearing in church but I’d also consider IO
(iolanguage.com) on that list. Very impressive and dirt simple to
integrate with C/C++. Ruby is still closer to my heart (and I use it
much more) but IO impress me a lot.

Regards,

Robert Feldt

···

On Tue, 13 May 2003, 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
:wink: ).
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.

I want to thanks all people that have give me hint.
I’m really surprise to see that theintegration of the interpreter is so
simple ! I’ll study this more in depth to see how ruby can interact with
object of my C++ apps.

I'll try to make a web page on my different test and as soon as it was

avilable I’ll give you the link.

Thanks again.

“Jacky Buyck” jacky.buyck@wanadoo.fr a écrit dans le message de
news:b9ql8i$5bg$1@news-reader11.wanadoo.fr

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
:wink: ).
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 ?

From what I've see (a question posted 26 april 03) it's plane for Ruby

2.0 but is there existing way to do it now or did you discourage me to
take

···

this way for the moment ?

Really thanks to you.
Hope to have news soon.

Jacky Buyck
jacky.buyck@wanadoo.fr

“Simon Strandgaard” 0bz63fz3m1qt3001@sneakemail.com schrieb im
Newsbeitrag news:pan.2003.05.13.11.59.16.175154@sneakemail.com

I am working on a tutorial on how to embed Ruby into C++. It is still in
a
very early state. The basic code is working. I am doing some in-depth
studies of more advanced issues at the moment (capturing output,
multithreading)… these things of couse needs rework.

ruby embedded into c++

Feedback is very welcome. I would like to know how to make it more
intuitive. Especialy if you have any breakdowns I would like to know so
I
can improve that part.

How about putting this on the Wiki?

robert

I already have added a few link from Rubygarden to the tutorial:

http://www.ruby-lang.org/en/hotlinks.html

Should I make more attempts to create links back to this tutorial ?
Any suggestions?

···

On Tue, 13 May 2003 18:01:09 +0200, Robert Klemme wrote:

“Simon Strandgaard” 0bz63fz3m1qt3001@sneakemail.com schrieb im
Newsbeitrag news:pan.2003.05.13.11.59.16.175154@sneakemail.com

I am working on a tutorial on how to embed Ruby into C++. It is still in
a
very early state. The basic code is working. I am doing some in-depth
studies of more advanced issues at the moment (capturing output,
multithreading)… these things of couse needs rework.

ruby embedded into c++

Feedback is very welcome. I would like to know how to make it more
intuitive. Especialy if you have any breakdowns I would like to know so
I
can improve that part.

How about putting this on the Wiki?
http://www.rubygarden.org/ruby?HomePage


Simon Strandgaard