Aside from FP, the Ocaml type system is better than the mentioned ones. From one hand type inference means you have to write out types much less, and from the other hand the type system is more powerful and lets you express more things than Go/Java.
Pretty concise code: Go code is full of `if err != nil {...}` song and dance and they seem pretty committed to keeping it that way. Java is stuck with decades of decisions and libraries made in their early days because they can't break backward compatibility. Eg, all the standard library collection types are mutable. And of course, both of them have the 'null pointer' problem, which OCaml doesn't.
Meanwhile OCaml has had the same main type-level tools (record types, variant types) and techniques (pattern matching, first-class functions) since the very beginning and those are still the workhorse till this day.
Certainly better perf: I'd say that really depends on how much tuning has been done. OCaml applications by default are fairly performant and with OCaml 5's multicore support and effect handlers will unlock even more performance wins.
Look at the latest stack overflow developer surveys. It will tell you how much the international community chooses to use (or not) ocaml. To your question, that's people deciding whether it's worth learning.
Have you worked in language with immutable collections by default? It's night and day -- no more defensive copies, no more weird ImmutableList wrappers (Guava) which will (interface-wise) say they're mutable but will throw at runtime, no worrying about multithreading, cheap subsequences, etc. etc.
The difference is so stark that I would literally choose a worse[0] language(!) over a better one if it had immutable collections by default.
EDIT: Since you mentioned Java in a sibling comment -- give Scala a try and try working with the collections there.
[0] Within reason, of course :)
If you haven't learnt anything like it, yes.
> most things can be done in imperative langs like Go/Java with pretty concise code
Which is why learning OCaml will make you a better programmer even if you then go back to Go/Java. You'll most likely never learn how to do those things without taking that step.
> and certainly better perf.
If you implement the same algorithm in both, it will be faster in Java. But you're more likely to find the better algorithm working in OCaml.
Really the only reason I can think to use OCaml over Rust is the compile time, which is quite impressive and significantly better than Rust's. But I don't think that's enough to put up with the other downsides.
I don't think the borrow checker is a factor. OCaml has aspects that are equally painful to learn.
Also if you know Rust you won't really learn much by learning OCaml except "oh that's where that Rust feature came from". Rust stole all the good features from OCaml.
Languages with immutability/lazy seq/etc support built in can be tuned faster than a library (compiler help around sequences/streams rather than pure library based ones), and again the lack of stack types can make some of these immutable collections much slower/take up more memory than other language targets. There's algorithms I can't use in Java which I can use in .NET/Rust/C++/etc without memory penalty or lots of unsafe/hacky code.
For you and I maybe, but no. This is the HN bubble speaking. Most people learn a programming language to get a job or to do something they want to do.
I learn CS for fun too but I hold no illusions about the rest of the world.
"But decided against since Java had an ecosystem, tooling and really good performance."
Correct. Ocaml is not practical for projects or businesses. That's why you didn't pick it.