Monday, February 09, 2009

Real World Haskell: Pre-Reading Survey

A long time ago, I was an aficionado of a language that told me that the three traits of a great programmer are laziness, impatience, and hubris. Then I discovered Ruby, which taught me about the Principle Of Least Surprise and that programming should be fun. Now, in Real World Haskell, Bryan O'Sullivan, John Goerzen, and Don Stewart promise me three things as I read their book to learn about Haskell: novelty, power, and enjoyment. That sounds like a pretty good deal to me.

After conducting an interview with Bryan, John, and Don I kept looking for a break in my reading list where I could put RWH, and I finally decided to make the room instead of waiting for it to occur on its own. Yesterday, my copy arrived.

I was immediately struck by the size of the book. Programming in Haskell (which I wrote about, briefly, here ) is a relatively modest 155 pages while RWH weighs in at 640 — and what I've read so far is very approachable.

Reading through the ToC and Introduction, I've built the following list of questions I want to keep in mind as I read:

  • What value do I gain from strict, static typing? How does this compare to the value I gain from strict, dynamic typing?
  • What about Lazy Evaluation?
  • What about Polymorphism?
  • Why bother with whitespace?
  • How do I think in Haskell?
  • What about Composition and code re-use? (How does it conpare to Factor/Forth?)
  • How do I keep code readable? How is this different than in Ruby?
  • How does the FFI work? How does this compare to Ruby's?
  • How does concurrent programming work? How does this compare withErlang? With Ruby?
  • How does STM fit into things? What should this teach me about threads? About Actors?
  • How do I profile, benchmark, and optimize?
And of course, the biggest question of them all: When should I be reaching for haskell instead of Ruby, bash, or C?

I've also put together three little goals for myself. By the time I finish the book, I want to use haskell to write:

  • a wiki
  • a twitter scanner
  • a log analyzer

I'll try to write about my progress through the book, insights into the questions above, and progress toward my three goals. Feel free to share your thoughts as well.

Click here to Tweet this article

3 comments:

Don Stewart said...

Be sure to consult the extensive libraries, for inspiration. e.g.


* gitit, a git + happs-based wiki

* orchid, a library for building wikis

* hs-twitter, a library for building twitter tools

* hs-logger, a versatile logging framework.


Good luck!

Toby Ho said...

Haskell is a great language. Would love to see how you make out with it.

Fernando Sanches said...

I'm midway trough the book, started reading it about a month ago.

I found the contents dense, so I was advancing slowly, but even so I believe the book already showed me answers to most of these points.

At the time I began reading, I was with my mind divided between Python and Ruby, and Haskell was just a curiosity. Now I really want take it as my main language.

The book is awesome and Haskell is fascinating. Even if I end up never using it in the real world, the experience is being totally worth it.

I hope your experience with the book will be as pleasant as mine!