Haskell is fun!January 8, 2007
Lately, I’ve been doing a lot of Haskell. I must warn you, I always have a Programming Language Of The Month, but now I feel as if it’s different. Haskell is a programming language where you get the feeling that a lot of things are just perfect.
First off, the way the type-system works, many, many, many errors that you’d normally make in your imperative language are simply impossible to make. It’s very strict, and although ruby is me second language of choice, this is also a really good thing. For example, I recently read that it’s virtually impossible to generate invalid XML. And that’s not because the author is some crazy god-like person, it’s just an intrinsic feature of the data-types in Haskell.
Furthermore, Haskell gives you a really good intellectual challenge. You really spend more time thinking than typing. The information density in your code is quite high compared to a lot of other languages I work in.
Also, having no side-effects is a Good Thing. The first time that I worked in Haskell, I was really disappointed that IO was so hard to do, with all that incomprehensible Monad-stuff and more. As it turned out, it’s really not that hard, and debugging will get so much easier. You just don’t need logger statements all around your code.
Ruby is my second language of choice, and that’s because you don’t have to type that much. But one of the powers of ruby is the meta-programming, which is a bit of a hack. But less typing means you’ll get stuff done sooner and it’s harder to make errors. In Java, you’ll have to type a lot (even with Eclipse), because of the type-system (pun intended). In Haskell, the type-system is really smart, and you don’t have to type a lot of trivial things. The compiler will automatically deduce the types of functions for you. So you’ll end up having the advantages of a static typed language, but better, and having the advantages of dynamic languages, less code.
Finally, there are a lot of really smart people in the Haskell community. There’s lots of really advanced stuff being done, but most people are also very good writers. Just google for “Simon Peyton Jones“, and read some of his papers. Most are explaining beautiful, advanced things, and he has a really clear writing style. Maybe he’s one of the best, but there’s lots of other people that write excellent programs, articles and other stuff.
So, if you feel at least the tiniest bit excitement, I can recommend that you download a haskell compiler, do some tutorials, don’t give up and get just as excited as I am! And don’t forget: the best way to get to know a language is to program in it!