Friday, February 26, 2010

Smoother Sailing

Well for the first time in many months I have nothing in particular to rant about - Gemini has been mostly behaving. Hopefully most of the bad weather is behind me now, and I am finally beginning to enjoy having a top-of-the-line computer more than worrying about it.

This month I took some time to do some recreational programming. Yah, some of us do it for fun. I'm trying to learn a new programming language called Scala. Java has been my favorite programming language for over 15 years now, so now I'm wondering what else is out there to try, will there ever be anything better than Java?

Java was such a revolutionary change from what we had before it has now become the most popular programming language in the world. It has had such an impact on technology that James Gosling (the creator of Java) was made an Officer of Canada. However, Java is 15 years old and the language is not evolving as fast as other languages (like C#). It is incredibly hard to add new features to the language (like closures) because the keepers of the language design are very conservative. Also there is the whole Java Community Process that governs changes to the language and the platform - which is like the biggest committee in the world.

A few years ago a new language came on the scenes - Scala. It was developed as a research project to combing functional and object oriented programming paradigms, as well to as try out a lot of new ideas in programming language design. My first look at it was pretty scary - I could not understand it, and the programs were hard to read. I attended a presentation on Scala while I was at one of the JavaOne conventions - but I left still confused about the language - so much of it was over my head.

Not wanting to be too old a dog to learn new tricks I kept trying to understand Scala until I finally found a couple of good books on the language. Everything else I had been reading always seemed over my head. Finally things started making sense enough for me to try writing some simple programs in Scala and the more I played with the the more I began to like Scala.

One of the reasons I built the computer I did - 2 processors - 8 cores - 16 threads - was so I could experiment with concurrent programming -- that is, programs that are able to make use of all those cores and threads. I took one of the more simple programs I love to play with, prime numbers, and decided I would write a version the could make use of all those threads.

One of the cool things about Scala is that it is designed to handle concurrent programming well. This gave me a great chance to play around with two new things at once - concurrent programming and Scala. I had a few problems along the way, but after a few weeks of trial and error I finally got my program working - which is able to use 90% of the power of my computer. All in all it was a very satisfactory experience, reminding me very much of what first attracted me to computers when I was 12 years old - trying to figure out how to solve a problem using a computer.

In the future I hope to find the time for more 'recreational programming' - time to just play and experiment with new things and ideas. It's a real thrill doing things that you just can't do on any old computer.