Ruby -- For Science!

Ruby in Academia -- Why Not?
We were just discussing at Flatiron that Ruby was not a typical choice for scientific and academic projects that require programming. The instructors went back and forth a bit about why that might be the case and why Python seemed to be preferred by the majority of those needing numerical data computation.

I have always had a topical interest in numerical and scientific computing because, quite simply, it's damn interesting. I think it is wonderful the things we can do to manipulate and transform data so that we can draw meaningful conclusions from it. To then be able to be put in a position to help bridge the gap between those who write the programs and those who conduct the research is more potential for opportunity than I could ask for.

I just ran across Ruby & Science by Juanjo Bazán on Speaker Deck who was talking about the very same issue, and he seems to come to two main conclusions, one of which we figured out in class just the same:

  • Lack of great open source scientific libraries
  • Small academic user base

A quick note on speed: It's not an issue. Most projects that require speed will know that they require speed and will use a more suitable language like C. Anything in the realm of Python and other interpreted languages is fair game for Ruby to break into.

Let's talk a bit about the other two

Lack of Great Open Source Libraries
It isn't that there are no scientific libraries for Ruby, it's just that they need work. Juanjo mentions that there does exist SciRuby that aims to be what SciPy and NumPy have accomplished for Python, but it is still in very early stages and needs help from developers. We can be those developers! As a new Rubyist and community contributer, this is something that even I can possibly get involved in. Even if it is something simple like writing documentation or playing around with the library's nightly builds or giving feedback on ease of use.

Small Academic User Base
The first thing that comes to most researcher's minds when they hear scientific computation is Python. It is what their Computer Science colleagues showed them when they asked for help writing some code to crunch their numbers. As Juanjo put it, these are very smart people and they do have the ability to tweak programs that have been set up for them. Getting started is the hard part, which is where we as programmers come in.

We can volunteer our time as programmers to help create those academic projects. There is no shortage of research out there! Find a field that interests you and start hanging out in that department of your local college. Go to talks, introduce yourself, meet students and grad students and professors.

But, Why Ruby?
Juanjo argues that Ruby is the perfect choice for Academia for a few reasons. I am going to expand on a few of those points.

Great General Purpose Language
Ruby is famous for being the language behind Ruby on Rails, but that doesn't mean that Ruby is strictly for web applications. Since Rails propelled Ruby into the spotlight, developers have come from all over to contribute to the language, making it even more beautiful, elegant, and powerful than it was before.

Powerful and Beautiful Syntax
Ruby reads almost like a spoken language. Abstracting details of programming from the academic researchers who have to use them will make them happy. The amazing thing about Ruby is that this doesn't even take away from the expressiveness and power of the language.

Increase Happiness
For both academic user and programmer alike. Pushing into the scientific community serves to benefit us all. By giving researchers more expressive power, they want to use Ruby more. The more they want to use Ruby, the better Ruby will get. It's a kind of positive feedback loop. The better Ruby gets, the better academic research gets. The better research gets, the better the world gets.