Wednesday, 20 January 2010

Experience Report: Haskell in Industry

Curt Sampson published a report describing the good, the bad and the ugly sides of trying to use Haskell to write production code in industry.

Curt cites brevity, powerful static typing, portability and interoperability among Haskell's advantages but unpredictable performance, memory leaks, lack of good documentation and literature and lack of modern development tools for refactoring and profiling as Haskell's primary weaknesses.

The report is fascinating and a highly recommended read for anyone considering trying to use Haskell outside academia.


Curt Sampson said...

Thanks for the mention!

The profiling issues appear to have been in great degree resolved by the new profiling tools presented at ICFP 2009 (where I presented this paper). However, I've not used them extensively in anger yet. (Upgrading compilers and libraries in the midst of a production rollout was a bit more than I cared to take on for something that had quite adequate performance anyway.)

The lack of "modern development tools for refactoring" is also true of many other languages, such as Python, Ruby and so on. It just seems to feel worse in Haskell because you tend to be a lot more precise about what you're doing, the language can actually support the tools, and some weird psychological thing about running something broken feeling like making more progress than fixing something that doesn't compile, but will work when it does.

I'm still going back and forth on the laziness issue. In my presentation I said that, once you get used to it, figuring out how performance will work in a lazy language is not all that hard. I still stand by that. It's just that it's "not that hard" in the same way that some interesting type and pointer issues in C++ are "not that hard"; it's far from trivial, and it's something you need to put a fair amount of work into understanding and keeping in mind on a regular basis.

Whether specifying lazy evaluation turns out to be a bit of inspired genius or a tragic blot on an otherwise great idea, I must say that Haskell is probably the most beautiful and comfortable language I've ever used, and I don't regret choosing it. Don't take this as anything against OCaml and F#, since the majority of that beauty comes from things taken from ML.

PJW said...

The link to the report is not working for me is it this report?