Skip to content

Functional Programming at the Haskell Hackathon

2010 September 14

HaskellLogoHaskell Hackathon Organiser Jasper van den Jeugt tells us about where Haskell came from, the importance of parallel programming, how it compares with Perl and Scala, where Haskell is being used, the benefits of lazy programming languages and why you should attend the Haskell Hackathon in Ghent, Belgium, over the weekend of the 5th-7th November 2010.

 
I am told that Haskell is an old language, I believe it was released in 1990. How do you explain the renewed popularity of this language?
Haskell indeed is an old language, and it has never been a popular language. It even became a sort of unofficial slogan for the language: “avoid success at all costs”.
I think the key feature attracting people to Haskell (and functional languages in general) is that it is relatively easy to write parallel code in Haskell, as opposed to traditional programming languages such as Java or C.

Why is it important to be able to write parallel code?
Modern computers typically have multiple cores. A simple program only runs on a single core — this is fine if it’s a simple task, but if your program gets more complicated, it is desirable to use more than one core, it will run noticeably faster that way.

How did Haskell come to life?
Haskell has a very long history: the first version of Haskell was released in the year I was born: 1990.
It was mostly inspired by the Miranda language. Miranda sparked interest in lazy, functional languages, and soon, these languages were all over the place. A committee was formed and after a lot of hard work, a Haskell specification was
agreed upon.

Why start a new language – if Miranda was so inspirational, why not develop using that?
Miranda was widely used, but the main problem was that it was a closed-source initiative. One of the goals of Haskell is to create an open standard for lazy programming languages.

Where does the name Haskell come from?
Haskell is named after a logician called Haskell Brooks Curry, known for his in the area of combinatory logic. This spawned lambda calculus — lambda calculus is a very low-level functional language: most functional languages are based on lambda calculus in one way or another.

Jasper van der Jeugt

Jasper van der Jeugt

Who uses Haskell and for what purposes?
Haskell is used by academics, but also by the industry. Since Haskell is a general purpose language that allows low-level programming and interfacing with C, but also highly abstract interfaces, it can basically be used everywhere — from kernels to web application servers or desktop applications.
People are using Haskell for a variety of reasons. Because of it’s very strong type system, Haskell applications are generally very unlikely to crash or show unexpected behavior. It is also very easy to create EDSL’s in Haskell: small mini-languages for very specific purposes.

Is there a relationship between Haskell and other languages such as Erlang, Perl etc.?
Most languages are related in some way or another. Haskell has been influenced by Miranda and lisp dialects, and now Haskell is influencing other programming languages.
For example, Scala, a relatively new language closely related to Java, has been heavily influenced by Haskell (especially the type system). Erlang has a totally different type system but is also a functional language, and thus resembles Haskell in some aspects.
Perl, on the other hand, is not very closely related to Haskell, in fact, Perl is more closely related to the more classical, imperative programming languages.
To summarize: Haskell is totally different from imperative and objective-oriented languages, but it does resemble some other functional languages.

Michele Beltrame, a YAPC organizer, told me that “Haskell is a great language as it really makes you a better programmer in any language and make you think on how you write your code.” Why is Haskell such a good teaching language and what is so different in its approach?
I think the reason here is the fact that Haskell is very different from most programming languages: even for an experienced programmer, learning Haskell feels a bit like learning to program for the first time. It forces you to write your code in another way.
For example, you cannot have variables in Haskell: once a value is assigned, it can never change. Neither can you write a loop: you have to use recursion instead. It forces you to think in another way — and this way of thinking can be applied to most programming languages.
Besides that, learning Haskell is fun! There are very good tutorials on the internet, I heavily recommend interested readers to have a look at http//learnyouahaskell.com.

What is a lazy language? And what is the relationship between Haskell and a lazy language?
A lazy language means the language has “lazy execution”. I think I can best illustrate this with a small example.
Say, you have a really complicated formula to calculate X. When you call this formula in a non-lazy (also called strict) language, your processor works for a bit and calculates X, and continues with the rest of the program once X is calculated.
A lazy language, however, works differently. When you call this formula, your program will simply continue without calculating X! It is only when the value of X is really needed, that X will be calculated — for example, when you want to print the value of X. If you don’t use this value anywhere, it will never be calculated at all!
This makes it possible to have, for example, lists with an infinite length in Haskell.

What is Haskell Hackathon?
A Haskell Hackathon is a gathering of the Haskell community. Haskell users from all over the world come together to collaborate and work on new projects, or improve existing libraries. It is also a social event — a great place to meet new, interesting people with similar interest.

When is it?
The 12th Hackathon (“BelHac”) will take place in Ghent, Belgium. It starts on Friday, the 5th of November and ends on the 7th.

Is attendance open to all?
Yes, you do not have to be a Haskell guru to attend — all you need is some interest in Haskell, a willingness to learn, and a project you’re excited to help with (or a project of your own to work on).

What do you hope to achieve there?
To improve the state of Haskell, meet new people and old friends and, of course, have lots of fun!

Leave a Reply