From: ptkwt@...1.aracnet.com (Phil Tomson) Date: 2002-09-19T03:09:55+09:00 Subject: Re: Ruby and inline C or C++ In article <5174eed0.0209180802.5157d65@posting.google.com>, Edward Wilson wrote: >Is this conceptial or real? > >Ruby could be used as a macro language for real ($$ professional) >code. This would make writing testing tools and prototypes easy and >viable using Ruby. No doubt, this would bring Ruby into the fold of >professional development shops much quicker. > >I'm with you, I have to invent hobby projects to use Ruby at this >point. All our work is in C++. Something like this would make Ruby >immediately useful for us. Ruby's embeded API hasn't worked for me, >and writing extensions takes too much time to justify for the uses we >have for it. > As an aside (and I'm starting to sound like a broken record here, but I do really think it's a great tool so please forgive me) Have you tried Swig? Swig ( http://www.swig.org) makes it easy to write C/C++ extensions (Swig really shines with C++). Instead of embedding Ruby into your C++, consider using Ruby as your 'main' to tie all of your C++ objects together (see an earlier thread called "embed or swig" for more details). I've used Ruby and Test::Unit to do C++ unit testing by wrapping all of our C++ classes with Swig - worked great. Phil