Alice the Caml

Alice is a radical, experimental OCaml build system and package manager. Its goal is to allow anyone to program in OCaml with as little friction as possible.

Install on Windows with WinGet:

winget install OCaml.Alice

Alternatively you can install Alice from its opam package:

opam install alice

Additionally, you’ll need a C compiler to use Alice on Windows. It’s recommended to install msys2 and add the path to the directory containing cc.exe to your PATH variable. For example assuming the default install location for msys2, in PowerShell run:

$env:PATH += ";C:\msys64\mingw64\bin"

…or in CMD.EXE run:

set PATH=%PATH%;C:\msys64\mingw64\bin

Install on macOS with Homebrew:

brew install alicecaml/homebrew-tap/alice

…or run the install script:

curl -fsSL https://alicecaml.org/install.sh | sh

You’ll need curl and git to be installed in order to run the script. After completing the installation the alice command will be available in new terminal sessions.

Alternatively you can install Alice from its opam package:

opam install alice

Install on Linux with the install script:

curl -fsSL https://alicecaml.org/install.sh | sh

You’ll need curl and git to be installed in order to run the script. After completing the installation the alice command will be available in new terminal sessions.

Alternatively you can install Alice from its opam package:

opam install alice

On NixOS you can instead use the flake github:alicecaml/alice, for example:

nix shell github:alicecaml/alice

Install on any platform supported by opam by installing Alice’s opam package:

opam install alice

See more installation options here.

Here’s how to run your first OCaml program on a computer with no pre-installed OCaml tools (you will need a C compiler though!):

$ alice tools install
$ alice new hello
$ cd hello
$ alice run

Hello, World!

That first line downloads an OCaml compiler toolchain and a couple of development tools (ocamllsp and ocamlformat). Skip it if you already have an existing installation of OCaml. Alice runs the OCaml compiler (ocamlopt.opt) searching the directories in your PATH variable and only uses its own installation of the tools (installed by alice tools install) as a fallback.

This project is exploring alternative approaches to OCaml packaging than those chosen by Opam and alternative approaches to building projects than those chosen by Dune.