6 ms·
I never did find a solution to the performance problem when it comes to writing numeric code in Ruby. I ended up doing most of my Matlab-suggested assignments i
by adambard 13y ago
I never did find a solution to the performance problem when it comes to writing numeric code in Ruby. I ended up doing most of my Matlab-suggested assignments in Python with numpy instead.
- vjoel 13y agoI used to do a lot of scientific programming in ruby. I got around the slowness of the interpreter by generating C code on the fly. You don't have to give up Ruby as the DSL and utility language. It's the best of both worlds, if you can invest the time to set up the code generating machinery. As I posted on the coderwall discussion: If you are working with continuous systems (ODEs) or hybrid systems (ODEs plus discrete state transitions and dynamic dataflow networks), then you might be interested in RedShift. For example, here's a simulation of a simple thermostat controller: https://github.com/vjoel/redshift/blob/master/examples/thermostat.rb https://github.com/vjoel/redshift/blob/master/examples/therm.... (I am the author of RedShift. You can find my RubyConf 2009 presentation on the confreaks site.)