From: Charles Calvert Date: 2010-05-14T00:45:21+09:00 Subject: Re: ease of porting (translating) ruby to C (vs. python)? On Fri, 7 May 2010 09:16:36 -0700 (PDT), bwv549 wrote in <3aac7538-b703-4604-8280-79f1d98d5260@j36g2000prj.googlegroups.com>: >In a very small bioinformatics group I know of, they are deciding >whether to code mostly in python or ruby. The lead knows that python >can "easily be ported to C because of its strictness." First, I agree with Peter Seebach that this is nonsense. Second, why would you port code from either language to C? Is it to gain performance in areas of the code where Ruby/Python isn't sufficiently performant? If so, then you're putting the cart before the horse. Here is the correct order: 1. Write the code. 2. Test performance. 3. If performance is not acceptable, profile the code and identify the bottlenecks. 4. Examine the bottlenecks to see if the performance can be improved in the current language, e.g. by switching algorithms or tweaking generic algorithms to work better with your specific data. 5. Make those changes and retest. You might need to experiment with a few versions. 6. If the changes result in insufficient improvement, then look at implementing them in C, compiling to a library and calling into that from Ruby/Python. Note that this assumes that you do not have a current code base written in C. If you do, and it is well tested and performant, then do this instead: 1. Write the code that you need and that does not exist in C, using Ruby/Python. 2. Write the wrappers for the C code and integrate. 3. Follow steps 1 .. 6 above, applying step 6 to the code written in Ruby/Python. [snip rest] -- Charles Calvert | Software Design/Development Celtic Wolf, Inc. | Project Management http://www.celticwolf.com/ | Technical Writing (703) 580-0210 | Research