Hacker News new | ask | show | jobs
by semisight 3756 days ago
Can't speak for OCaml yet; I've wanted to learn for a while but decided to go with Haskell first.

On the Haskell side of things--it's biggest seller (functional purity) is also the biggest downside. To give you an idea, papers have been written about the best way to implement common data structures purely functionally.

From what I've seen, OCaml has less "abstraction overhead" because it can dip into imperative code. While Haskell is really fun, it definitely has moments where you want to beat your head against your desk.

1 comments

The real downside isn't purity - purity is a good thing! What Haskell suffers from is a lack of flexibility w.r.t. the evaluation strategy of pure functions. More precisely:

(0) Haskell starts with a bad default - laziness.

(1) Haskell uses special annotations to introduce strictness. The presence of these annotations isn't tracked by the type system, which reduces the usefulness of the type system as a tool for understanding your program.

(2) More sophisticated evaluation strategies (e.g., memoizing functions, which can be seen as a generalization of laziness) are difficult to achieve in Haskell, even though it's completely straightforward in ML.