Install¶
You need opam, OCaml’s package manager, and OCaml 5.5 or later. Spindle brings dune, the build tool, with it.
1. Install opam¶
Spindle should work on Windows, but it is not tested there. If something fails, WSL gives you a Linux to follow the Linux steps in.
2. Set up OCaml¶
Answer yes when it offers to set up your shell. This installs the latest OCaml, which takes a few minutes. Then let this terminal see it – a new terminal does by itself:
Already had opam?
Check ocaml -version. If it is older than 5.5, make a switch – an
environment of its own – with the latest OCaml:
3. Install Spindle¶
This installs the framework and everything it needs, dune and the
ppx_wiretype deriver included. The database and the command line are
packages of their own, so an app that uses neither never installs them;
their tutorials install them when you get there:
| Package | Libraries | What for |
|---|---|---|
spindle |
spindle, spindle.http, spindle.client |
The framework, HTTP itself, and a client for calling other servers |
spindle-postgres |
spindle-postgres |
Database |
spindle-cli |
spindle-cli |
Client schemas |
Check it worked¶
It lists spindle with a version, not --, under Installed.
OCaml 5.5 or later, dune 3.19 or later and an installed spindle mean you
are ready.
Your editor¶
For completion, types on hover and errors as you type, install the language server, then the OCaml Platform extension in VS Code – or the OCaml support of your editor:
A program names the libraries it uses in its dune file;
your first app writes one, next.