Ruby rocks! HELP converting Ruby to C++?

I need to use legacy C++ code in a C++ environment on a Windows 2000

machine.

I would like to request your expertise converting this simple Ruby

program to C++.

In am using wxWidgets in C++. It may be easier to embed this Ruby

code into C++

however, it seems unnecessary to embed an entire language (namely Ruby

into C++)

for such a simple program.

The following Ruby code is a whittled down version of
http://rubyforge.org/frs/?group_id=287\. This code was written using
Ruby version 1.8.1-13 the accompanying wxRuby on a Windows 2000

machine.

If you need to use C++ code from within Ruby, take a look at SWIG:
http://www.swig.org/\.

If you want to translate an existing wxRuby code into C++... I don't
know of any automated tool that'll help you do that, but the wxRuby
interface is fairly similar to the wxWidgets calls.

HTH,
Assaph

If you need to use C++ code from within Ruby, take a
look at SWIG:
http://www.swig.org/\.

I'm pretty sure he is not wanting any Ruby code in his
program or depending on Ruby.

If you want to translate an existing wxRuby code
into C++... I don't
know of any automated tool that'll help you do that,
but the wxRuby
interface is fairly similar to the wxWidgets calls.

It might be similar but implementation is very
different. You have to deal with all the nice C-based
language ways. Points, References, Memory locations,
nice callbacks, function pointers, yadda yadda yadda.
All fun and, C++ compiles :). Too bad we don't have a
Rubycc compiler yet. --David Ross

···

__________________________________
Do you Yahoo!?
Vote for the stars of Yahoo!'s next ad campaign!
http://advision.webevents.yahoo.com/yahoo/votelifeengine/

Hello David,

From: David Ross [mailto:drossruby@yahoo.com]
Sent: Friday, July 23, 2004 12:05 AM
To: ruby-talk ML
Subject: Re: Ruby rocks! HELP converting Ruby to C++?

> If you need to use C++ code from within Ruby, take a
> look at SWIG:
> http://www.swig.org/\.
>

I'm pretty sure he is not wanting any Ruby code in his
program or depending on Ruby.

You are correct.

> If you want to translate an existing wxRuby code
> into C++... I don't
> know of any automated tool that'll help you do that,
> but the wxRuby
> interface is fairly similar to the wxWidgets calls.
>

It might be similar but implementation is very
different. You have to deal with all the nice C-based
language ways. Points, References, Memory locations,
nice callbacks, function pointers, yadda yadda yadda.
All fun and, C++ compiles :).

I feel have a fairly good grasp on compiling and linking C++ console
programs on my Windows 2000 machine. Yeah right, I can even get this simple
code to work. I am working on getting up to speed in wxWidgets for C++.

Too bad we don't have a
Rubycc compiler yet. --David Ross

It seems that the main reason to use C++ is not just that C++ compiles, its
that there is so much C++ legacy code out there.

Todd

···

-----Original Message-----

I feel have a fairly good grasp on compiling and
linking C++ console
programs on my Windows 2000 machine. Yeah right, I
can even get this simple
code to work. I am working on getting up to speed
in wxWidgets for C++.

I don't doubt that you couldn't do it. The rest of the
people in the Ruby community *shrug* at the thought of
a pointer. I don't. Have you tried FOX yet? Its a
really good GUI Toolkit.

> Too bad we don't have a
> Rubycc compiler yet. --David Ross
>
It seems that the main reason to use C++ is not just
that C++ compiles, its
that there is so much C++ legacy code out there.

I am aware of how portable C++ is, I program in C and
C++. I was trying to make some fun. Plus, I was being
serious. I wish Ruby could compile. (and I don't mean
byte compile) --David Ross

···

__________________________________
Do you Yahoo!?
Yahoo! Mail is new and improved - Check it out!
http://promotions.yahoo.com/new_mail