Friday, 21 March 2014

Mind scramble: Introduction to Haskell workshop

This week I attended a 3 day intensive introductory workshop to Haskell! The workshop was done by NICTA (with Lambda Ladies) and was facilitated by Tony Morris and Mark Hibberd, held at Red-Hat in Brisbane.

Haskell is a functional programming language, which is quite different from our regular object orientated language like Java, C++.

A simple comparison

This was one of the first exercises that we did at the workshop in which we had to get the product of a list of numbers (1*2*3*4 = 24):

So we're immediately employing recursion as an alternate way to iterate through a list which is different to my instinctive OO logic.

While skimming over the syntax, we slowly assembled our own libraries: lists, parsing, apply and fileIO. While the majority flew of them flew over my head and in some cases, didn't even register, I felt that I had accomplished a lot at the end of the third day. The complexity was always increasing so when looking back, the concepts that we may not have fully understood come back and hit us in the face with blanket obviousness. I was so exhausted that at the end of the last day, I skipped (or deferred) a late night lecture and some extra curricular to go home, put food in face, roll over and become temporarily comatose.

I thoroughly enjoyed myself, but after all this, I do still feel that functional programming is a bit of a luxury - for me specifically. Perhaps it's because I'm still very slowly getting the hang of programming in general. That being said, the core concepts and the different way of thinking that we're forced to employ is really cool. But I think that to really establish a concrete opinion, I should at least get some credible experience with it. They did mention that it has a lot of potential in complex financial calculations and high frequency trading which is supposed to be right up my ally.

Interested in Haskell?

The Haskell Platform
Try Haskell
Lean You a Haskell for Great Good

I used my kawaii 2011 11" Mac Air running OS X (Mavericks). GHCi (Haskell's environment compiler thingy) was a bit of a challenge to get running but I managed to get it working through the combined power of Google Search and my Dad's terminal knowledge. I would strongly suggest using your favourite Linux distribution if you're using Windows and you care about what people think of you.

The library that we were working on can be forked from here:

Apparently these NICTA guys go all over Australia offering this 3 day workshop (3 * 7 hours = 21 hours of Haskell immersion) for free with a supplied lunch. Extreme altruism? I'm not complaining. While it's free, it does not mean that it's not valuable at all. In fact, I recommend that if you were going, ensure that you have nothing on at night to give yourself time to recuperate because after all, you're learning programming again but this time it is much more abstract.

We were given these lovely laser-cut Lambdas from Katie Miller, who was there from Red Hat and Lambda Ladies. Perhaps now we know what they are, we deserve them :3

Also Red Hat's soap smells really nice.

No comments:

Post a Comment