Hello, ruby-talk. I have a question about choosing between Ruby, Ruby
with C extensions (InlineRuby, ruby2c, etc.) and pure C++. I’ll try to
keep it short and to the point; thanks in advance for any answers, and
of course I’m more than happy to clarify/extend the below if needed.
Background: I’m a PhD student at Warsaw University of Technology and
I need to write a project that’s going to be fairly intensive in both
computing and memory usage (symbolic functional decomposition of FSMs
for FPGA implementation); in particular, the project will implement
a lot of set operations and graph colouring. I like Ruby a lot, and
the project has to work first, but ultimately it has to be efficient
in the end. I don’t know a lot about C/C++ other than the basic classes
I took years ago (i.e., I’ll have to learn C/C++ from scratch anyway).
The question: in my case, which approach seems to make most sense?
Pure Ruby. This will most probably not be an option; my gut
feeling is that pure Ruby will end up being way too slow and
memory-inefficient. Still, definitely the fun approach, and actually
maybe the fastest prototyping.
Ruby with C extensions. Code in Ruby first, then optimise the slow
parts one after another. This is tempting (mmm, Ruby…), but I’m
not sure how viable; if I’m going to have to rewrite 90% in C anyway,
I might as well start with C++ (again, only a gut feeling).
Pure C++. I have to learn C/C++ anyway almost certainly (for point
2 above), so maybe trying to have fun and going with Ruby is not the
best way this time, and I should simply install CDT, stock on C++
tutorials and be a brave, if sad, person?
Note: My supervisor doesn’t know Ruby one bit and writes everything in
C++, so he would not be too happy with 1 and 2; still, it’s my PhD, and
he’s an open-minded person, so if I’m sure about either 1 or 2 being
viable I should be able to go with Ruby.
Thanks a lot for your time and in advance for any responses.