- OCaml 81.7%
- JavaScript 8.1%
- TypeScript 5.5%
- C 2%
- TeX 1%
- Other 1.7%
| .vscode | ||
| bench | ||
| bin | ||
| blog | ||
| decisions | ||
| docs/superpowers | ||
| editors/vscode | ||
| examples | ||
| lib | ||
| notes | ||
| paper | ||
| plans | ||
| spec | ||
| tests | ||
| tools | ||
| .envrc | ||
| .gitignore | ||
| .ocamlformat | ||
| antipatterns.md | ||
| bibliography.md | ||
| bun.lock | ||
| CLAUDE.md | ||
| dune | ||
| dune-project | ||
| flake.lock | ||
| flake.nix | ||
| ideas.md | ||
| LICENSE.md | ||
| package.json | ||
| README.md | ||
Beloch, named after Margherita Piazzola Beloch, is a declarative language for origami, built on the Huzita-Justin axioms, that compiles source models into folded states, crease patterns, and step-by-step folding diagrams.
Status: the evaluator implements all seven Huzita-Justin axioms over an exact real-algebraic number kernel and emits FOLD. See
decisions/for the architecture,spec/SPECIFICATION.mdfor the language, andnotes/for the design journal. More at beloch.toph.so.
Quick example
paper square
--d1 = through .a .c
--d2 = through .b .d
.center = cross --d1 --d2
@map .a onto .center
Two diagonals, a named crossing, one fold — @ actually folds .a onto
.center (a bare map would just mark the crease) along the crease axiom 2
derives. That program produces a FOLD file, which renders into
this — crease pattern and folded state, named constructions overlaid:
| crease pattern | folded |
|---|---|
More programs, from simple midline folds to Messer's cube-root-of-two
construction (axiom 7), are in examples/.
Development
The evaluator core is OCaml; tooling lives at the edges in TypeScript (see decision 0001). A Nix flake provides the OCaml toolchain (dune, menhir, sedlex, ocaml-lsp, …):
direnv allow # or: nix develop
dune build
dune exec beloch -- --version
Layout
lib/ evaluator core (OCaml library)
bin/ the `beloch` CLI
spec/ human-readable language specification (grows per increment)
decisions/ architecture decision records (ADRs)
notes/ dated design journal
examples/ .bel programs, tagged works / aspirational / anti
paper/ the eventual write-up (arXiv / JOSS / OSME)
antipatterns.md dead ends and rejected approaches
bibliography.md annotated sources