The languages in developing a new algorithm

You have an idea for a new algorithm! Great, what to do next?

You prototype it in Python because of the expressiveness and the dynamic typing is a really cool thing to have while messing around. Performance wise it isn’t anything to show off and you think that you really need something faster.

You choose Go to rewrite the algorithm to take advantage of gorotutines, channels, etc… and you change your app so it can run in your multi-core computer.

Your algorithm is getting to shape, is fast but not the fastest and in your pursuit to make it faster than light, you end up rewriting it in plain old good C just to see how much you can squeeze of those clock cycles.

It is now fast, great and is attracting attention from the industry. You end up writing the algorithm in Java, that gold standard of the industry, and make big money selling it.

But it was developed in academia so you have to publish it in journals and conferences. After all this is your master piece! You rewrite your algorithm in Clojure, just to look smart, you publish several papers on it, and get a tenure on a famous university… doing the occasional consulting sting and getting rich (you hope).

After some time in academia you get a grad student that wants to work with your algorithm. He is excited about the work, but he doesn’t know how to program. You then decide to rewrite your algorithm once again in Python (you lost your original code years ago) to make it easy on your student to learn.

Curiously your code is now shorter, elegant, and very fast. You tell yourself that Guido must have done something magic to CPython in the past few years and contemplate the brilliance of your code.

I could have just called this post ‘some programming languages that you should know or be aware of’

R in the Top 20 of Programming Languages

Programming languages come and go, but its nice to see what’s gaining momentum and what’s not. In the latest Tiobe report for January 2012 we can see some interesting surprises in the top 20 chart of programming languages. C is still highly demanded and closing on Java. Both account for 1/3 of the programming languages panorama.

Other interesting aspect is the fading of Python. Python lost half of it’s market share. Maybe this is because of Python 3 and the incompatibilities with Python 2.x that might have sent many programmers in search other solutions. Another problem might be GIL that hinders thread programming in Python in a time when programming is moving to the concurrent and distributed programming.

Also interesting is the rise of R. R is one of my favorite languages for science. It makes reproducibility of research results very easy (specially if you use Sweave with R) and for any kind of statistical analysis it is almost perfect. It also produces great plots for scientific publications.