OxCaml Playground
Use GitHub Codespaces to try out OxCaml without installing anything. See instructions here. Note that, currently, initializing an OxCaml codespace takes 30+ minutes, but we plan to improve this in the near future.
Local Installation
To install OxCaml on your machine, we recommed using the opam package manager.
Start by creating a new switch including our repository in opam:
# Update to make sure you get the latest version of all packages
opam update --all
# This may take some time to install
opam switch create 5.2.0+ox --repos ox=git+https://github.com/oxcaml/opam-repository.git,default
eval $(opam env --switch 5.2.0+ox)
If the installation was successful, you can now use OxCaml!
Now, let’s install developer tooling and some libraries:
opam install -y ocamlformat merlin ocaml-lsp-server utop parallel core_unix
After configuring it to work with your editor of choice, you’re ready to tackle our tutorials.
Build from Source
The source code for OxCaml is available at our GitHub. Use instructions there to build OxCaml from source.
Known issues
Platforms other than x86_64 or ARM64
OxCaml does not yet support architectures other than x86_64 or ARM64.
musl-based distributions
OxCaml depends on glibc, so musl-based Linux distributions like Alpine are not yet supported.
Windows
OxCaml does not yet support Windows. Windows users are recommended to use WSL 2.
Autoconf
Installing OxCaml requires autoconf. Normally, OPAM will prompt you to install autoconf through your system package manager if needed, but if that doesn’t work, you might have to install it manually.
Beta extensions
Some Jane Street extensions, like comprehensions
, are unstable and thus hidden behind the -extension-universe
compiler flag.
You can use the flags
field in dune
files to enable them:
(library
(name your_lib)
(flags (:standard -extension-universe beta)))
SIMD support on ARM
The SIMD compiler extension is not yet supported on ARM architectures.