Watch the Monkey Learn Haskell for Your Amusement - Why Haskell
Imma gonna learn Haskell.
You may ask “Why Haskell?”
Good question, let’s go over a few points.
Functional languages are different
I come from a very procedural background. BASIC, C, Asm, C++, Ada, Ruby, and the like. I know Ruby has some functional abilities, but when I learned the language I stuck to OOP style. I’m learning as many different programming paradigms as I can handle to keep myself sharp. When it came time to learn a functional language, Haskell purity made a big impact on my decision. Others saw a lack of procedural features and side effects as a downside, I saw them as a challenge.
Parallel Ready
Haskell has extensions to painlessly add support for multiple processor systems and parallel execution, even on Windows.
Works well on Windows
“Windows?! You should be running Linux!” I hear the audience screaming already. I agree. No, really, I know. Unfortunately the rest of the world isn’t as forward thinking, and they ask me for software. As long as I write programs for Windows users, I will have a Windows development box. GHC, my Haskell compiler of choice, is Windows ready out of the box. NTEmacs, my Haskell editor of choice, integrates with GHC beautifully. I even have all of this running on a thumbdrive for development on the go.
Speed
Haskell is fast. Or, more accurately, GHC produced machine code is comparable to C code in many cases. Now, I don’t want any fanboys to point out some benchmark somewhere that says otherwise. I view benchmarks as mostly useless for any fine grained comparison. Let’s just say Haskell is a lot faster than Ruby and is almost as pretty.
Good lookin’
I’ve seen some ugly syntax in my day, and I prefer not to fill up all my code with capital numbers. Haskell doesn’t win the blue ribbon for code beauty, but it comes close. It makes an effort at helping the programmer type out a program and is not afraid of syntactic sugar. The structure of Haskell statements can even be called elegant at times.
Academic Snobbery
I like the looks I get from the average joe when I say something like “I can make balloon animals” or “I sometimes knit chain maille”. Soon, I’ll be able to tell the average joe programmers I work near that “I wrote that in Haskell!”. “Buh, Haskell? What’s that?” they’ll say, and then I’ll laugh and laugh and laugh because I’m a jerk like that. Ah, hilarious.
Production Ready (almost)
Haskell can be used in production code. It has good library support and is fast enough to keep up. What I don’t know yet is if it can be used effectively in a production environment, with teams and managers and deadlines. From what I’ve seen, I’d say Haskell can beat C++ and Java’s productivity if used properly. Only time will tell, though.
It Makes My Brain Hurt
New paradigms are not for the faint of heart. OOP is just procedural with a coat of paint and some ‘new car’ smell when compared to the difference between functional and procedural. The shift from one to the other makes my brain hurt, which means I’m doing something right ;)
Next time, I’ll go into what I’ve learned so far and where I’m going next.
Tags: Haskell, Programming