Tools for Scientific Computing in Ruby

First Pre-alpha Release

We made it to the top spot on Hacker News on Halloween (three days ago now). We weren’t quite prepared for the level of interest generated by that posting, so we’ve experienced a few growing pains. (Please please please don’t send us to Slashdot.)

But growing pains are a good thing! They are, of course, the result of growth – which we like!

We’ve had experienced Ruby developers coming out of the woodwork and admitting – albeit only after looking over their shoulders – that they, too, have secretly been using Ruby for science, and are thrilled about this project.

Noah from 37signals offered an extremely helpful piece of advice. He pointed out the way redis uses its issue tracker to facilitate contributions from people who aren’t as familiar with the project status. So now if you want to get involved, instead of checking the Roadmap, you should check the SciRuby issue tracker.

We had a couple of people who indicated confusion over what features had already been implemented in SciRuby. The source of the confusion was most likely that we hadn’t released a gem in a while, but had still been updating the master branch in the repository.

Our plan had been to wait until we had numeric array and matrix support ready before releasing another gem version. But we capitulated, and have now put out a “pre-alpha,” version 0.1.3, available through your friendly neighborhood RubyGems. As of this posting, the v0.1.3 tag corresponds to the code in master.


Plotter GUI

The most useful feature is probably Plotter, which is a GUI for Rubyvis. You can instantiate it in a couple of different ways. I prefer this one:

sciruby-plotter my_test_plot.rb

You can modify your source file and the plotter should automatically update the plot. If you want to save your plot, push the ‘s’ key.

Similar to the plotter is a basic Rubyvis code editor. You can instantiate it from irb by calling


We thought it would be super cool if SciRuby could be used for a lot of those examples people used to write for R. You know, R has all those cool datasets, like Old Faithful’s eruption times.

faithful = SciRuby::dataset(:r, 'faithful')

You might be wondering, “Why do you have to indicate that it comes from R if it only loads R datasets?” Wonder no more.

I wrote a module for searching online databases for useful datasets as well. It’s very buggy. Right now it only works on the Guardian World Government Data repository, which is itself somewhat flaky. In other words, this feature might get removed unless some people express an interest in improving it.

Statistical Analysis DSL

Claudio Bustos’ Statsample::Analysis has been migrated into SciRuby. It should eventually ease the transition to SciRuby for those who are familiar with R.

It should work almost exactly the same way as the version from Statsample, but you’ll call it with SciRuby::Analysis instead of Statsample::Analysis.


As always, if you want to install SciRuby, you should look at the installation instructions.