Axel,


Axel Etzold wrote:
> -------- Original-Nachricht --------
>> Datum: Sat, 7 Jun 2008 04:19:12 +0900 Von: Philip Rhoades
>> <phil / pricom.com.au> An: ruby-talk / ruby-lang.org Betreff: Re:
>> RubyToC - Second Question
> 
>> Ryan,
>> 
>> 
>> Ryan Davis wrote:
>>> On Jun 5, 2008, at 16:57 , Rob Biedenharn wrote:
>>> 
>>>> Perhaps you want to check out treetop or one of the other
>>>> parsers as this project looks like it hasn't been touched in 2
>>>> years.
>>> it's been touched, but none of the changes have been released.
>>> 
>>> ruby2c has a lot of dark corners and isn't meant for general use.
>>> expect a lot to break.
>> 
>> The reason I am interested is that I have CPU and IO intensive
>> C/C++ genetics simulation program that I would love to rewrite in
>> Ruby but it probably would not be viable from a speed point of
>> view.  I thought maybe if I could develop/debug etc to a working
>> Ruby app and then, when it is a going concern, turn it into a
>> faster, compiled binary, I would get the best of both worlds . .
>> 
>> Regards,
>> 
>> Phil.
>> 
>> -- Philip Rhoades
>> 
>> Pricom Pty Limited  (ACN 003 252 275  ABN 91 003 252 275) GPO Box
>> 3411 Sydney NSW	2001 Australia E-mail:  phil / pricom.com.au
> 
> Philip,
> 
> if you have a lot of C/C++ code and look for wrappers, you could also
> try SWIG
> 
> http://www.swig.org/Doc1.3/Ruby.html
> 
> or the rbplusplus gem
> 
> http://rubyforge.org/projects/rbplusplus/
> 
> There have been rumours on this list some time ago that SWIG could
> also "wrap" Ruby into C, but I couldn't confirm this from the docs.
> 
> I think the rbplusplus gem is very comfortable, but it's still work
> in progress ... 0.1.1 doesn't seem to support struct for instance,
> but the last build from git does...
> 
> What is it that's most time-consuming in your application ?


I am thinking about a complete rewrite (to better simulate the real
world) but I would be quite unenthusiastic about doing it in C++ and
also it would not help very much to be able to re-use parts of the
existing stuff via swig or rb++.

What does '"wrap" Ruby into C' mean?

A rewritten application would be quite different but the existing app
has an array whose cells point to lists of parental and offspring
objects that completely change with each generation.  Output is
continuously written to disk.

I would love to produce a new version in Ruby because writing OO in Ruby
is so much nicer but it would be just too slow and I am not really
interested in writing parts of it in C/C++ . . defeating the purpose of
rewriting really . .

Thanks,

Phil.
-- 
Philip Rhoades

Pricom Pty Limited  (ACN 003 252 275  ABN 91 003 252 275)
GPO Box 3411
Sydney NSW	2001
Australia
E-mail:  phil / pricom.com.au