Back in about 2000-2001, I was doing first tech support and then configuration management work for a big company in Chicago, and, basically because I was lazy and curious I would spend more time than I should have reading, on the web, about programming, especially programming languages, especially unusual ones.
That was when I first started getting interested in Ruby, and read the online Pickaxe Book; that’s when I read beating the averages and wanted to be an Eager Young Lisp Cadet (much like the inimitable Bruce!), I downloaded Squeak and learned a little Smalltalk; and I got geeked about pure functional programming by reading John Hughes’ paper, Why Functional Programming Matters. Hey, anything but do the work I was being paid to do!
The Hughes paper led me to Haskell, and I read the Gentle Introduction to Haskell , at least up to the IO chapter, which linked forward to the Monads chapter, which was too much for my poor little brain.
The thing was, at the time, I wasn’t programming professionally or really much at all. I’d read about programming, done tiny little fun programs, done a lot of system scripting in Perl, and learned about the languages, but I’d never been a “real” programmer. This kept my mind open to wacky languages but it kept my understanding shallow.
A couple jobs later, I was doing actual programming for a living, but in Perl (the first language I’d actually used on the job, and so the one I was best at). While I wasn’t paying attention to it, Ruby suddenly became really popular thanks to this “web application framework” called Rails, maybe you’ve heard of it.
Now it seems like Haskell is starting to accumulate buzz. There’s almost as much jibberjabber on Reddit about Haskell (especially Monads) as there is about Ron “we can safely assume 95% of black males are criminals” Paul.
I’ve recently gone back to it, got a copy of the compiler working on my , and followed some of the good tutorials, and I finally realized that Haskell’s “monads” weren’t really as hard to understand or weird as I had thought.
I even wrote a little program that rolled dice. It compiled. It used the IO Monad. It used the Random Monad (indirectly — you can just pull random numbers into an IO Monad). It was maybe a dozen lines long, and verbose at that. I rewrote every part of it several times, so I wasn’t just cut and pasting code, butunderstood exactly how it was doing its thing, and I played around with the monad operators and “do-notation” and all that.
In the end it all turns out not to be a big deal.
OK, now what?
I’d love to go learn more about Haskell. But you know what? I don’t actually program in my spare time much. Just stupid little utility scripts from time to time. Convert videos from flv to mpg using mencoder. Generate clever passwords (I have a command line script that does what this does). Automate an rsync backup. I guess I could try writing those in Haskell instead of shell or Ruby, which is what I usually use. Maybe eventually it will lead to something interesting.
We’ll see. Haskell isn’t the only language that fascinates me but it’s the one I’ve had a long fascination with and done very with, mostly because of the silly “oh no I can’t grok monads” hurdle. I was prompted to write this up because I just started following the fascinating notes on haskell blog, whose author, Adam Turoff (a pointy-headed comp sci sounding name if there ever was one), wrote up a spiffy three-part intro to Haskell for ONLamp.com, beginning here.