Hacker News new | ask | show | jobs
by dmix 1495 days ago
I needed an excuse to try out OCaml...
1 comments

Its a good time to try it. The tooling has come a long way and OCaml has an excellent build system [1] (dune is probably the best build tool I've used and I miss it whenever I use other programming languages), excellent editor tooling for vscode [2], emacs and neovim. OCaml 5.0 will bring multicore support [3] and an effect system that will cover a lot of interesting use-cases. As an example with OCaml 5 it'll be feasible to have concurrency libraries that still let you write in direct-style [4] [5]. I don't intend to say that OCaml will fit every use-case, but there is a lot going for it even in its current form before multicore support lands. If you want a language that compiles fast (it does compile really fast, at-part with Go if not better), has excellent performance characteristics, and has a good story for concurrency, you should give OCaml a chance!

[1] https://dune.build/

[2] https://marketplace.visualstudio.com/items?itemName=ocamllab...

[3] https://discuss.ocaml.org/t/the-road-to-ocaml-5-0/8584

[4] https://github.com/ocaml-multicore/eio

[5] https://github.com/anuragsoni/sandbox/tree/main/ocaml/effect...

I'm really really excited for and curious about the effect system, but isn't the effect system considered unstable except for any multicore usage?
It is indeed true that the effect system will evolve in the future, and there is no syntactic support for effects in the 5.0 release. That said, the standard library in 5.0 does contain functions that will expose the same set of features, and can still be a very useful way to build things using effects. I'm hoping experiments in the wild will prove to be useful feedback as the effect system evolves in the future OCaml releases.

EDIT: https://discuss.ocaml.org/t/multicore-ocaml-september-2021-e... is a forum post that goes into more detail about the state of effects in OCaml 5.0