How does ocaml compare to F# in the family of ml languages

It may be helpful if you define you’re really looking to do. It would also help if you share what you’ve researched. Are you looking for production work or more exploratory? Just scripting against web apis, against linux apis? Perhaps sharing bits of your research can help others curate answers for you.

Here’s a fun looong discussion of the hard bits of OCaml for beginners: What are the biggest reasons newcomers give up on OCaml? - #251 by olleharstedt.

I’ll reiterate the same points everyone always point out, and also share personal one.

  1. I like knowing that I can produce a single executable. Idk why, but it just feels simpler. In practice, everyone has a CI + dockerfile for their specific OS anyways.
  2. You can basically do more “real” functional programming in OCaml because OOP is much less used. I dislike having to wrap functions from C# that throws exceptions, which a lot do. Even a simple LINQ method like .First throws an exception. It’s not hard to wrap but it just eats time.
  3. And my personal favorite feature: you’re now cool because you get to be the one of the first to ever try algebraic effects in an industry-used language and see how a language evolves from single threaded to multi-threaded.
3 Likes