A Pythonista's review of Haskell

Click for: original source

An article by Ying Wang about his experience with trying Haskell after using Python in production for few years. Even as it’s a wonderful Swiss Army knife, Python also feels limiting in some ways. The same classes of bugs (e.g. type casting / translation errors, state management errors) kept cropping up, and Sisyphean bugs frustrate me. Python is also quite slow when you compare the operations you want to execute vs. the theoretical maximum performance of those operations on the underlying hardware. He kept wondering about what was possible if he had used a different tool.

Since Haskell is a lambda calculus, and everything is functional, I thought I could get parallelism trivially. Nope. As far as I can tell, you still have to mutate your source code, and use a library, such as Control.Parallel (external dep) or Control.Concurrent (base stdlib). Simon Marlow’s “Parallel and Concurrent Programming in Haskell” is probably a must-read to understand this topic (and things like Control.Concurrent.MVar).

His experience is divided into the sections:

  • What I like about Haskell
    • The type system
    • An emphasis on structure
    • Streams and stream-oriented programming foundations
    • Property-based testing
    • Hoogle
  • What I dislike about Haskell
    • Cognitive load
    • Indentation
    • Concurrency / Parallelism
    • Package Management
    • Strictness / Non-strictness
    • Compatibility

… and much more. One thing to point out is Haskell isn’t a magical elixir. It’s still a programming language. Good read!

[Read More]

Tags python functional-programming programming