Template for an ocaml project with modern tooling.
The setup should be installable as easily as possible.
opam switch create . 5.2.0 --no-install
opam install . --deps-only --with-dev-setup
The current goto build system in ocaml is dune. Version 3 or superior of the
dune lang should be used if possible. Unless the goal is to write a library
that must be compatible with legacy environements. The base of the project has
been generated with dune init project modern_ocaml
.
The CI setup is relying on github actions. It is kept as simple as possible. It checks for compilation of the project, tests, code formatting.
This repository has ocamlformat enabled. With the default configuration. In a
modern editor setup, using it should be mostly transparent. It can also be
triggered with dune build @fmt
.
Over the past year a very good implementation of a LSP server for ocaml has been developed. It should be automatically installed during the setup of the project.
After running the setting up commands, you can check that it works by running:
$ dune build
$ dune exec bin/main.exe
Hello, World!
This repository contains a AGPLv3+ license file. I made this choice because I support free software and I believe that it is the best license to use for personal projects. But this repository is meant to be used as a template. It doesn't contain any original code by itself. So it can't be covered by a license. Feel free to use this template for your projects and pick the license you prefer. It is also totally fine to use it for a closed source project.
If you need help selecting a license, the Free Software Foundation provides a short guide for picking a license.