I have a Down¹-based REPL for debugging DkCoder scripts. It may be useful to others who want to quickly try out OCaml with a reasonable set of bundled libraries without a prior installation.
In PowerShell on Windows, or a POSIX shell on macOS or GNU/Linux², you can run:
git clone https://github.com/diskuv/dkcoder.git
dkcoder/dk DkRun_Project.Run repl -g dune ./Ok.ml
# Or use `run` not `repl` to run your script
The Ok.ml
script can be named almost anything, but it needs to exist and be capitalized like an OCaml module. You can think of it as an OCaml init script (so an empty script is fine) with some hook functions available if needed:
open Tr1Stdlib_V414All
let () = prerr_endline "ok: module initialization"
let __init () = prerr_endline "ok: standard initialization"
let __repl () = prerr_endline "ok: repl initialization"
There will be a noisy startup since one of the libraries (Bogue) has unusual module initialization. And since the DkCoder libraries, the hook API and the REPL experience will change, you can use git reset --hard c5379e62
to reproduce what is in this post. The related binary downloads will be available until 2025-12-30.
Happy New Year.
¹ Thanks to @dbuenzli for this excellent lightweight OCaml toplevel overlay!
² glibc 2.27+. In particular, musl is not supported.