Defying Classification

by Malcolm Tredinnick

Topic: software/haskell

Thu 6 Mar 2008

"Taming Effects" -- A Use Of Functional Programming

Posted at 00:24 +1100

I've been overwhelmed a bit by a head cold that sprung into life on Monday and am thinking at the speed of molasses. Turning lemons in lemonade, I spent today catching up on some reading and video watching (interspersed wtih napping). This meant I got around to watching some of the videos from a functional programming seminar given to Ericsson employee's last month, the full list of which are available on Ulf Wiger's blog.

The video I'd like to draw attention to is Simon Peyton Jones' initial talk (he gave two): Taming Effects - The Next Big Challenge. If you've ever wondered why functional programming might be relevant or why there it seems to be gaining more visibility on websites, this talk should provide some food for thought.

Simon is a fantastic speaker, providing you can keep up with somebody who speaks fairly fast. He always conveys a real enthusiasm for what he's talking about, looks very well prepared and manages to present complex things in a very simple fashion. He's one of the people I'm slowly trying to emulate in my own presentations, although I'm miles away at the moment. Simon's best known as one of the authors of Haskell and maintainer of the main Haskell compiler, GHC. However, you don't have to know Haskell to follow this talk; he introduces the necessary terminology as he goes along (that being said, some familiarity with programming is assumed).

One of the things I like in the introduction to this talk is pointing out that functional programming — results driven by data dependencies, rather than execution order — are actually really familiar to us all. It's how a spreadsheet works! This was also brought up in a presentation I referenced last year and I like the analogy a lot. Even when we're using procedural/imperative programming techniques we can benefit from understanding a functional approach to algorithms. This talk expands one aspect of that point: as we work with larger and larger data sets, we need to be more concerned about unintended and even intended side-effects.

Finally, if you're interested in a fairly fast-paced, but excellent introduction to Haskell, I would also recommend Simon's tutorial from last year's OSCON. Part 1 and Part II. It will take a bit of attention, reading of the slides and possibly some rewinding in places, but it's a very nice introduction to the language for programmers who may be familiar with other languages. Plus, who else uses the basics of an X windows manager as their example application?

Topics: technology/algorithms, conferences, software/haskell

Tue 12 Jun 2007

Functional Programming In The Real World

Posted at 06:33 +1000

Somewhat against the run of play, programming.reddit.com has been throwing up some very useful links lately. Today, somebody turned up this presentation by Howard Mansell of Credit Suisse from last year's Commercial Users of Functional Programming conference (the 2006 talks are here).

After writing some Python code lately that was very functional in style (using lazy infinite streams to produce successive results in the computation), I have been enjoying playing around in Haskell a bit more. I sort of learnt the language back in 2001, but never really had the time or inclination to play with it much. Now, I'm becoming a bit more hooked. Functional programming should appeal to me, after all — I'm a mathematician at heart! Twisting problems into a series of proof steps is fun, in many ways. I'm already reasonably competent in Scheme; adding another arrow to that quiver seems worth it.

What impresses me about this presentation, though, is how Credit Suisse started with a pragmatic approach (use Excel's formulas for most things) and then started extending further and further. However, some people had the intelligence to step back and realise they were inventing a functional language and there already were rather a lot of those. So they switched to working out how to leverage what already existed.

For a short presentation with no real "glitz" to it, these slides get the information across very well. It's a nice encouragement piece for anybody thinking about whether functional programming is relevant.

Topics: software/haskell