Mohit Sindhwani
10/29/2008 2:48:00 AM
Hi Axel,
Axel Etzold wrote:
> thank you all for your responses.
> Actually, choosing what the code I'll have to deliver is written in has to be C/C++, since the
> customers here want something they can feed into gcc and understand when they read it.
> I am not absolutely sure, but I don't think they know Ruby very well and probably aren't willing to consider its
> use in this problem, because of the speed issue.
>
I find that sometimes customers don't appreciate a new tool/ device -
they like to stay with what they know best... which is fine. My advice
to you would be to prototype in Ruby if there is an element of
uncertainty in the program you're developing. Once the customer sees it
working, they may be convinced. On the other hand, once it's already in
Ruby, translating to C/ C++ isn't that far a step... even if you do it
manually. The only problem is that you need to maintain updates by hand
(or update only one or the other).
> I was just wondering whether there'd be some tool that would translate some of my Ruby
> code into C/C++ to speed up the development process.
>
I haven't used anything that would help.
> I looked at RubyToC and at cplus2ruby, but it seems that I'd spend almost as much time writing
> C from scratch as editing the translated code. (This might be due to the fact that I couldn't find more
> documentation than the examples provided, and there doesn't seem to be a way of translating Ruby's
> Hashes to C or its IO routines etc... with these softwares).
If you're using C++, hashes can be translated into STL Maps if you need
it... though anything C/C++ is going to be more strongly typed than the
duck typing in Ruby.
Cheers,
Mohit.
10/29/2008 | 10:47 AM.