Install
Start hereYou 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.
1. Install opam
Section titled “1. Install opam”brew install opambash -c "sh <(curl -fsSL https://opam.ocaml.org/install.sh)"2. Set up OCaml
Section titled “2. Set up OCaml”opam initeval $(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:
opam switch create spool ocaml-base-compilereval $(opam env)3. Install spool
Section titled “3. Install spool”opam repo add hypha https://github.com/hyphatech/opam-repository.gitopam install spool rowtype-migratespool 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)Check it worked
Section titled “Check it worked”$ ocaml -versionThe OCaml toplevel, version 5.5.1
$ opam list spoolIt lists spool with a version, not --, under Installed. OCaml 5.5 or
later and an installed spool mean you are ready.
Your editor
Section titled “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:
opam install ocaml-lsp-serverThe quick start runs a whole program, next.
