Skip to content

Install

You need opam, OCaml’s package manager, OCaml 5.5 or later, and a Postgres to keep the jobs in. spool brings dune, the build tool, with it.

Terminal window
brew install opam
Terminal window
opam init
eval $(opam env)

Answer yes when opam init offers to set up your shell. It installs the latest OCaml, which takes a few minutes; eval $(opam env) lets this terminal see it, and 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:

Terminal window
opam switch create spool ocaml-base-compiler
eval $(opam env)
Terminal window
opam repo add hypha https://github.com/hyphatech/opam-repository.git
opam install spool rowtype-migrate

spool brings the libraries it runs over: rowtype and its Postgres backend, rowtype-postgres, and wiretype, which describes a job’s payload. rowtype-migrate is the command that makes spool’s table, beside your own.

A program names the libraries it uses in its dune file:

(libraries spool rowtype-postgres eio_main)
Terminal window
$ ocaml -version
The OCaml toplevel, version 5.5.1
$ opam list spool

It lists spool with a version, not --, under Installed. OCaml 5.5 or later and an installed spool mean you are ready.

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:

Terminal window
opam install ocaml-lsp-server

The quick start runs a whole program, next.