|
|
|
|
|
by fayden
4941 days ago
|
|
That is actually one of my concerns about Haskell. It's a bit off-topic to this HN post, but it's relevant to your comment and you seem to have some experience. I find Haskell's syntax very elegant and concise, but I am scared about performances. Often, I read about three or four different ways to do one thing. If I were to pick Haskell as my go-to language, and let's say I wanted to build a performant (memory wise and speed wise) program, would I have a hard time? Now obviously, for day to day applications, the performance topic is irrelevant, but how would Haskell compare for the example above instead of, let's say, Ocaml? |
|
That said, as I noted, the performance is usually good enough even with naively written code; you would only have to spend time optimizing a few select parts of most programs.
Another little problem is that there are not many resources on how to optimize Haskell code. This is a little annoying if you're learning on your own; however, I think it's offset by the Haskell community. I've seen some of the best Haskell programmers give very detailed responses on StackOverflow and the mailing list, so there is always somebody to help you while you're learning.
There are also some advantages to OCaml--it's a very fast language itself and it behaves in a way that's easier to predict especially since you can leverage more of your existing experience. OCaml is also a very nice languages; while I prefer Haskell, I would be perfectly happy with OCaml (and, in fact, I've only used OCaml and not Haskell in production).
I should add a big caveat to this whole post: while I've used both Haskell and OCaml a fair bit, I've avoided doing anything super performance sensitive. I usually care more about having correct, readable code quickly than I do about how fast it runs. So I am definitely no expert on optimizing either Haskell or OCaml!