It replaced Python for everything longer than a couple hundred of lines long for me. Fast language, fast compile times, clean(-ish) syntax, strong typing system, good ecosystem, and now multicore support? Yes please!
I must be more nuanced, though: existing libraries in opam are generally very, very good (I really like cmdliner), but many things may be missing. There is no alternative to Django, for instance. No serious IDE, except emacs. The standard library was so lacking that there is at least an alternative. The situation improved, but there's still missing stuff compared to Python.
> The standard library was so lacking that there is at least an alternative.
While janestreet does have an publish their own stdlib, I personally try to stick to the stdlib whenever possible. Not to knock janestreet. I'm glad they're around and have contributed a bunch.
But overall I agree with you. It's been my favorite language to write in for years now. You can't just reach for off-the-shelf libraries for every little thing. Although the ones that do exist tend to be written halfway decently.
Pros: type safe, GC, fast, (arguably) a simple and practical language if you have a functional mindset (much simpler and pragmatic than Haskell IMHO).
Cons: it's a niche language, so tooling/libraries/online help aren't on par with more mainstream languages. No canonical standard library (different codebases will use different standard libraries and even disagree on pervasive functions such as List.map). Whenever the code uses monad (e.g. concurrency monad / error handling), I find the language loses its simplicity.
Maybe it's true of every languages but I'm disappointed by some OCaml codebases where often two extreme cohabit
1. people who don't know the language and don't write idiomatic code (like, refusing to write .mli, abusing imperative features)
2. OCaml experts who over-engineer things and want to use the latest features and make the code hard to read/maintain
In a professional settings, it can be hard to have these two populations coexisting, and people tend to be quite opinionated when it comes to such languages (love it or hate it -> it's often a source of struggle).
I haven't used OCaml much directly, but F# is a common enough tool in my toolbelt at this point. My experience of F# is that overall it's a good language family. The access to .NET's standard library (the BCL) and easy interop with C# are the biggest reasons F# is the tool I more often reach to as it already fits the ecosystem most of my other development is in, but I'd love to work more directly with OCaml should the need arise.
one of my favourite languages! not so much for its (excellent) technical qualities, but just as a matter of personal taste - it joined ruby and racket in a short list of languages that just feel nice to program in. (i suspect D would join that list too but despite being interested in it for a while i haven't yet had a compelling project to use it for.)
cccbbbaaa|2 years ago
I must be more nuanced, though: existing libraries in opam are generally very, very good (I really like cmdliner), but many things may be missing. There is no alternative to Django, for instance. No serious IDE, except emacs. The standard library was so lacking that there is at least an alternative. The situation improved, but there's still missing stuff compared to Python.
mattpallissard|2 years ago
https://aantron.github.io/dream/, which is new and used by ocaml.org as well as OP
> No serious IDE, except emacs
and vim, and visual studio, and whatever else supports the LSP protocol via https://github.com/ocaml/ocaml-lsp
> The standard library was so lacking that there is at least an alternative.
While janestreet does have an publish their own stdlib, I personally try to stick to the stdlib whenever possible. Not to knock janestreet. I'm glad they're around and have contributed a bunch.
But overall I agree with you. It's been my favorite language to write in for years now. You can't just reach for off-the-shelf libraries for every little thing. Although the ones that do exist tend to be written halfway decently.
mdaniel|2 years ago
https://plugins.jetbrains.com/plugin/9440-reasonml (72k downloads)
https://plugins.jetbrains.com/plugin/18531-ocaml (2k downloads)
I'm not in the ocaml ecosystem enough to evaluate their quality, but anything on top of IJ is for sure a serious IDE
amelius|2 years ago
And how about scientific computing (SciPy), deep learning (PyTorch etc.), or computational geometry (Shapely etc.)?
still_grokking|2 years ago
But "no serious IDE, except emacs" is a non-starter imho, if it's true.
They should really invest in this. Otherwise the language won't attract any professional developers in the large.
yodsanklai|2 years ago
Pros: type safe, GC, fast, (arguably) a simple and practical language if you have a functional mindset (much simpler and pragmatic than Haskell IMHO).
Cons: it's a niche language, so tooling/libraries/online help aren't on par with more mainstream languages. No canonical standard library (different codebases will use different standard libraries and even disagree on pervasive functions such as List.map). Whenever the code uses monad (e.g. concurrency monad / error handling), I find the language loses its simplicity.
Maybe it's true of every languages but I'm disappointed by some OCaml codebases where often two extreme cohabit
1. people who don't know the language and don't write idiomatic code (like, refusing to write .mli, abusing imperative features)
2. OCaml experts who over-engineer things and want to use the latest features and make the code hard to read/maintain
In a professional settings, it can be hard to have these two populations coexisting, and people tend to be quite opinionated when it comes to such languages (love it or hate it -> it's often a source of struggle).
jolux|2 years ago
WorldMaker|2 years ago
zem|2 years ago