Summary:
Today I took my first real dive into OCaml — a powerful, elegant functional programming language known for its speed, safety, and expressive type system.
I started from scratch on my Debian machine. After installing opam (OCaml’s package manager), I ran into a small compatibility issue with the newest compiler version, so I switched to the stable OCaml 5.2.1. From there, everything clicked: I installed the essential tools (dune for building, utop for interactive coding, ocamlformat for clean code, and the language server for editor support).
Then came the fun part — I used dune to create my first official OCaml project. I wrote a simple recursive factorial function in a library module, wired it up to the main executable, and successfully built and ran it. Seeing “Factorial of 15 is: 1,307,674,368,000” appear in the terminal felt genuinely rewarding.
It was a smooth and productive first session. I went from “I’ve never used OCaml before” to having a properly structured, working project with separation between library code and executable — all in one afternoon.