Friday, April 13, 2007

Erlang and Haskell Books: First Impressions

I recently picked up a beta copy of Programming Erlang: Software for a Concurrent World to go along with my (paper) copy of Programming in Haskell. I figured if I had both books, I could make quick runs through them as I try to decide between Haskell and Erlang as the FP language I'm going to focus on this summer. What follows isn't really a review of either book, just a few first impressions.

Programming Erlang: Software for a Concurrent World looks like to be a very accessible book, that also goes into enough depth to be worthwhile. The version I got yesterday had 279 pages in the PDF, but an update was released today and my new copy hasn't found it's way here yet. I like what I've read of Joe Armstrong's writing and examples, and have caught on quickly to the initial concepts.

Programming in Haskell surprised me by being really small, only 171 pages (including the index). It on the scale of 'The C Programming Language', and so far it reminds me a lot of that book. I have to admit though, that I've always been put off by the seeming need of Haskell writers to use 'special Haskell characters' in their text, Programming Haskell even includes a table of 15 such symbols and how to represent them in ASCII. Bleargh!

So far, I'm leaning towards Erlang (mostly because of concurrency), but I'm not going to make up my mind for a while yet — too many other deadlines I need to deal with right now. As I get closer to the summer, I'll let you know which way I decide to go. (I'll also get real reviews of the two books up fairly soon.)

10 comments:

chromatic said...

The special characters are awkard in the Haskell book, but apart from one typo in an exercise in chapter 6, that's the worst thing I've found. I'm halfway through it.

Joe said...

Man that does sound annoying and pretentious, re: the Haskell special characters.

Is it that hard to type "lambda" instead?

Amr Malik said...

I just got my beta pdf this morning.. This book seems more accessible than the Prentice Hall one that Joe also co/authored.

Brian said...

I've been looking at the beta Erlang book myself during my free time. I'm not sure what I think about the language, but concurrency sure is a tempting feature. The book looks like a good resource, and the new material is definitely worthwhile. Still, I hope the book doesn't get too big. I still haven't had a chance to finish Ruby Way 2nd Edition simply due to the fact that I can't fit it into my bag for bus reading!

Anonymous said...

I wanted to learn a functional language as well. Thought about Haskell, but I finally settled on OCaml because it's multi-paradigm as opposed to being very pure like Haskell. I figure it'll be a bit easier to transition from Ruby. I'm also learning scheme as well. Often what I do is go back to Ruby to try out certain functional ideas. Turns out Ruby is very amenable to the functional style.

Anonymous said...

Since you're in "discovery mode", you may want to take a look at Factor. Wikipedia has an introductory article about one of the "hottest" languages around today: http://en.wikipedia.org/wiki/Factor_(programming_language)

pate said...

Anonymous 1: I've looked at OCaml a bit too, and I like some things about it. I'm looking for an approachable book about it.

Anonymous 2: Factor does look cool, but this year is going to be a functional language. I've had Forth on my list of 'want to learn' stuff for a while, but maybe Factor is a better way to go these days.

chromatic said...

joe, it's worse than that. Haskell (the language) already uses perfectly good ASCII typographic characters in code. The book's source code uses different characters.

Curt Sampson said...

I've looked at both OCaml and Haskell, and Haskell is looking like the better option to me, if only because even if it doesn't work out, it will really force me to learn to program without using structures from paradigms that I already know. But I also have the impression that Haskell has more powerful abstractions.

I wrote a rather harsh review of Practical OCaml; this book quite put me off that language. I'd had trouble getting through Haskell books, but this one sent me straight back to Haskell without a second glance. Had it been another Practical Common Lisp, the result could have been quite different.

Anonymous said...

"Programming Haskell" is a very good introductory text on functional programming (clear and concise). Its ambition is to be used as teaching material and it doesn't cover in details trickiest aspects of "real-world" Haskell (I/O, Exceptions, etc...). Hopefully, the coming O'Reilly book will fill that gap.

As for the special characters, well it's not a big deal, they are very close to Haskell syntax and pretty much self-explanatory, in any case there is a conversion table at the end of the book.

I heartily recommend it to anybody interested in learning FP.

As for Haskell vs Erlang vs OCaml,
well take your pick, they should all be interesting coming from the imperative world.

Haskell type system is wild, subject to a lot of research and experiments. Lazyness and purity makes it very special (and mind bending). You might not end up programming every day with it, but you will likely learn a lot !


OCaml books :
http://www.cs.caltech.edu/courses/cs134/cs134b/book.pdf
http://caml.inria.fr/pub/docs/oreilly-book/ocaml-ora-book.pdf

Haskell books :
http://darcs.haskell.org/yaht/yaht.pdf
http://www.haskell.org/onlinereport/