Just checking as another relative beginner in OCaml who wasn’t forced to use it!
The language is (almost) perfect. It doesn’t need early returns or better loops. OCaml was the first functional language I really dug into, and I love it! Modeling computations in terms of expressions is great. If anything, I would be happy to see more functional features, like maybe making various kinds of effects encoded into the type system (not like it all has to be in monads, just a little tip that you’re using a function which isn’t referentially transparent). Some days I want modular implicits, and other days I feel like functors are better from a maintenance perspective. Could be cool if there was an annotation or something to tell OCaml to do type specialization reified type variables on certain code paths for speeding up some things (floats), but I also understand this is kind of challenging to reconcile with the uniform object representation that makes OCaml’s garbage collector so awesome and compiler so fast.
I would also say that I find OCaml extraordinarily readable, and this almost (but not quite) makes up for the lack of good documentation for most third-party libraries. Because I the documentation situation is so miserable, I’ve often resorted to reading code and been pleasantly surprised how easy it is.
Started learning OCaml with the old horrible website and this wasn’t very good, but quickly switched to RWO. I just got set up with Dune, Merlin and Base, and I’ve been pretty happy with those things. Don’t get too many inscrutable compiler errors because Merlin shows them up in my editor. If they types are too nested and opaque, I just write some aliases and annotate functions with them so I don’t have to see all the crazy nested stuff and get readable types in my errors.
Base is great for me. It goes more in the direction of labelled arguments and result types instead of exceptions, and this is exactly what I want. I don’t always use it for small projects, but it’s pretty awesome in a larger codebase.
I do wish the standard library was better. It’s bad that the only real way to manipulate strings is Str
and everyone immediately tells you not to use it. Re
is nice once you know about it.
Not totally satisfied with the pretty printing situation of records, but at least there is this sexp stuff with Jane Street stuff.
I’m in general very happy with the prevalence of s-expressions in Jane Street tooling. It’s such a blindingly obvious and simple way to format structured data, and for some reason the rest of the world is chasing after JSON and XML. JSON is fine. XML is whatever. S-expressions are just on another level of simplicity and elegance. Love that.
OCaml’s ecosystem isn’t perfect. Sometimes I don’t know wtf is going on with Dune and Opam, but then I just ask and someone helps me. Documentation is terrible way too much of the time. Can’t always get the library for the thing you want to do, etc.
Still, this beginner had a very different experience from the OP. I <3 OCaml.