Paul Krill
Editor at Large

Ruby picks up the pace for scientific computing

news
Aug 30, 20162 mins

The VirtualModule leverages a Julia transpiler to speed up code execution

speedomter fast speed
Credit: Thinkstock

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.

Paul Krill

Paul Krill is editor at large at InfoWorld. Paul has been covering computer technology as a news and feature reporter for more than 35 years, including 30 years at InfoWorld. He has specialized in coverage of software development tools and technologies since the 1990s, and he continues to lead InfoWorld’s news coverage of software development platforms including Java and .NET and programming languages including JavaScript, TypeScript, PHP, Python, Ruby, Rust, and Go. Long trusted as a reporter who prioritizes accuracy, integrity, and the best interests of readers, Paul is sought out by technology companies and industry organizations who want to reach InfoWorld’s audience of software developers and other information technology professionals. Paul has won a “Best Technology News Coverage” award from IDG.

More from this author