The dune playground
The lectures run OCaml snippets in a toplevel, one expression at a time. Real projects are built with dune, OCaml's build system: source files in a project tree, a build command, a test runner. This page gives you that experience without installing anything: pressing Start boots a tiny Linux machine inside your browser tab with OCaml 5.4, dune, and the bisect_ppx coverage tool preinstalled. It is a real shell: everything you type runs locally in your browser, and your work disappears when you close the page.
Things to try
Three sample projects live in the home directory:
hello, morse, and bowling.
| Command | What it does |
|---|---|
cd hello && dune build | build your first project |
dune exec ./hello.exe | run the executable |
cd ~/morse && dune runtest | build a library and run its tests |
nano lib/morse.ml | edit code (Ctrl-O save, Ctrl-X exit), then rebuild |
cd ~/bowling && dune runtest --instrument-with bisect_ppx | run tests with coverage instrumentation (bowling comes pre-built; instrumenting a project from scratch takes a minute or two) |
bisect-ppx-report summary | how much did the tests cover? |
bisect-ppx-report html && sync | then press the terminal's coverage report button to view it in a new tab |
The first build fetches compiler files on demand, so it is slower than the ones after it. No code or telemetry leaves your browser from this page.