Ruby picks up the pace for scientific computing

Ruby picks up the pace for scientific computing

The Ruby language is more commonly associated with web applications than it is with scientific computing. But VirtualModule, now in development, could help change that by making Ruby code run much faster.

"From my quick benchmarking, with VirtualModule, Ruby code runs 10 to 50 times faster when the number of loops is big," developer Kei Sewada said. The GitHub repo for VirtualModule says it can hopefully make Ruby code more than three times faster. VirtualModule is not the first venture for bridging Ruby and scientific computing; Sewada noted SciRuby as another project in this vein.

Provided as a rubygem, open source VirtualModule uses ruby2julia to transpile from Ruby to the Julia dynamic language for scientific computing.The transpiled program uses the msgpack interprocess messaging library to complete each RPC call, Sewada said.

Akin to writing Python code using the Cython static compiler, VirtualModule enables a reduction in execution time in exchange for a  limitation in Ruby syntax due to the ruby2julia transpiler. When this restriction is lessened, the project will be promoted to a beta stage.

Julia is supported as the back end of VirtualModule as of the current 0.1.0 release. Other language VM processes, such as JRuby or Rubinius, may be supported in the future. Ruby 2.1 or higher is necessary for running VirtualModule, the GitHub repo states, and Docker containers can be used with VirtualModule to run the Julia VM.

While focused on simplicity, Ruby has at times lagged in speed. With VirtualModule, Sewada hopes to ride the momentum of recent projects like the Ruby Deoptimization Engine that aim to improve Ruby's overall performance.

IDG Insider


«White House fears U.S. taxpayers will pay for Apple tax bill


Which countries have open-source laws on the books?»
IDG Connect

IDG Connect tackles the tech stories that matter to you

Our Case Studies

IDG Connect delivers full creative solutions to meet all your demand generatlon needs. These cover the full scope of options, from customized content and lead delivery through to fully integrated campaigns.


Our Marketing Research

Our in-house analyst and editorial team create a range of insights for the global marketing community. These look at IT buying preferences, the latest soclal media trends and other zeitgeist topics.



Should the government regulate Artificial Intelligence?