Skip to content

Installation

Beloch’s evaluator core is written in OCaml. The repo ships a Nix flake that provides the full OCaml toolchain (dune, menhir, sedlex, ocaml-lsp, …).

  • Nix with flakes enabled, or a working OCaml + dune setup and Bun for the docs site
  • direnv (recommended) — direnv allow drops you into the dev shell automatically
Terminal window
# Option A — dev shell (direnv or nix develop)
direnv allow # or: nix develop
dune build
dune exec beloch -- --version
# Option B — Nix build (no dev shell needed)
nix build # produces ./result/bin/beloch

The CLI exposes beloch fold FILE.bel, which evaluates a program and emits FOLD JSON on stdout.

Terminal window
cd site
bun install
bun run build # runs beloch for every <Beloch> component on the page

The build resolves the binary from _build/default/bin/main.exe (dev shell build) or you can point it elsewhere:

Terminal window
BELOCH_BIN=/path/to/beloch bun run build