Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

What advantage does OCaml have over Haskell here? I find software transactional memory in Haskell so simple to work with that I have lost all fear of concurrency, but what am I missing out on?




I personally find OCaml more pragmatic than Haskell.

Haskell has a steeper learning curve IMHO: monads are pervasive and are hard to understand, laziness isn't a common programming pattern and it adds complexity. I find type classes confusing as well, it's not always clear where things are defined.

I like that OCaml is close to the hardware, there are no complex abstractions. The module system makes it easy to program in the large (I love mli). If you avoid the more advanced features, it's a super simple language.


I should have specified. I wasn't asking about OCaml vs Haskell in general[0], but what advantage does OCaml have with respect to concurrency?

[0] I think most people just end up post-rationalizing whatever choice they have already invested in, I know I do :) With that in mind, maybe I as a mainly-Haskell dev should instead list some things I miss from OCaml: faster compile times, non-recursive `let` by default, polymorphic variants, labeled arguments


Its mostly about practicality. Haskell is kind of pain when you need IO, as in when you go there there is no way out.

Ocaml is more practical, and less punishing (you can do IO without monads), but the most important diffrence is performance. Haskell is VERY hard to make predictable because its lazy. Ocaml is strict so general system performance is much easier to predict.

But they are sibling languages in my book, while i still prefer ocaml over haskell.


Also IMO the dev tooling is better for OCaml. Far better compile times.

A big part of interacting with APIs (which I imagine Stategraph does) is just dealing with records, and working with records in Haskell is really annoying unless you bring in lenses which bring a lot of complexity.


Tooling was kind of bad previously. But dune has got really good. I like the new dune developer preview thing that is still in beta.

https://preview.dune.build/


Wow that looks slick!



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: