|
|
A dune-project file is at the root of any project, it allows to set configuration for any executable or library in the project (there can be several). |
|
|
|
A dune allows you to declare an executable or a library using [S-expressions](https://en.wikipedia.org/wiki/S-expression) (basically parenthesis everywhere). Here we use dune to define an executable (not a library). |
|
|
|
You find a `dune` file in the same folder as the library or executable files; that folder can be located anywhere in the folder containing the `dune-project` file and it can be named anything. |
|
|
|
You can use the `build` command line tool to build your project. The programs or library files will be generated and stored inside a `_build/` folder under your project's folder. |
|
You can also directly run your program using `exec`. Note that the `.exe` extension has nothing to do with Windows executables. |
|
You can install `ocamlformat` (`opam install ocamlformat`) to auto-format your code, and the language server protocol `ocaml-lsp-server` to support clicking through function definitions in your favorite editor (check [OCaml Platform](https://github.com/ocamllabs/vscode-ocaml-platform) if you use VSCode). |
|
|
|
Just note that you'll need an empty `.ocamlformat` file at the root for `ocamlformat` to work. |
|