Contents

OCaml is Cool

Contents

Note: This is a filler document

Why is OCaml cool? It’s statically typed, compiles fast, immutable by default, expressive. Below is the basic OCaml hello world.

let _ = print_endline "Hello World!"

or

let _ = Printf.printf "Hello World!"

People have done lots of cool things with it:

It has an easy to use package manager called opam. Opam makes it really easy to keep multiple environments setup, grab the source of packages, upgrade dependencies, pin packages, etc.

Unfortunately there is some community fragmentation. There are multiple standard libraries:

The last one is from the OCaml ‘alternative’ Reason. It’s not really an alternative, it replaces the syntax of OCaml with one that’s closer to JavaScript. Personally, I prefer OCaml’s original syntax. Reason also introduces a new package manager esy which adds to the fragmentation. Luckily the backends are shared (for now) so that the fragmentation isn’t too bad. There are also automated ways to convert between the two syntaxes.