Declarative origami language, built on the Huzita-Justin axioms — compiles .bel source to folded states, crease patterns, and folding diagrams (FOLD output). https://beloch.toph.so
  • OCaml 81.7%
  • JavaScript 8.1%
  • TypeScript 5.5%
  • C 2%
  • TeX 1%
  • Other 1.7%
Find a file
2026-07-05 18:34:04 +02:00
.vscode feat(vscode): live preview — per-step diagrams synced to cursor (#42) (#60) 2026-07-04 18:46:16 +00:00
bench feat(num): primitive-element tier in real_roots for compositum fields (#56) 2026-07-04 13:45:30 +00:00
bin feat(cli): render Beloch errors as source-context diagnostics 2026-07-01 17:41:37 +02:00
blog docs: design spec for dogfooding blog tooling (build) 2026-06-28 22:12:59 +02:00
decisions docs(adr): 0016 — typed operands; design: fold scope (moving/up to/@fold) (#65) 2026-07-05 01:59:02 +02:00
docs/superpowers docs(plan): fold scope implementation plan 2026-07-05 01:59:02 +02:00
editors/vscode feat(vscode): live preview — per-step diagrams synced to cursor (#42) (#60) 2026-07-04 18:46:16 +00:00
examples feat(cross): material crossings — paper space, on the marks (v0.19-dev) (#69) 2026-07-05 16:05:31 +00:00
lib feat(cross): material crossings — paper space, on the marks (v0.19-dev) (#69) 2026-07-05 16:05:31 +00:00
notes Merge branch 'main' of git.toph.so:toph/beloch 2026-07-05 18:34:04 +02:00
paper docs(bib): add D5 dynamic-evaluation sources (ddd1985, duval1994) 2026-07-03 00:08:09 +02:00
plans feat(lang): the at operator — crease-segment selection (#50) (#63) 2026-07-04 21:43:07 +00:00
spec feat(cross): material crossings — paper space, on the marks (v0.19-dev) (#69) 2026-07-05 16:05:31 +00:00
tests feat(cross): material crossings — paper space, on the marks (v0.19-dev) (#69) 2026-07-05 16:05:31 +00:00
tools feat(fold): emit per-face isometries for the future 3D viewer (#31) (#61) 2026-07-04 18:55:21 +00:00
.envrc chore: scaffold project — ADRs, docs, OCaml/nix skeleton 2026-06-28 16:42:19 +02:00
.gitignore docs(spec): authoritative axiom-numbering table + gitignore learn/ (#22) 2026-07-01 09:39:41 +00:00
.ocamlformat chore(quality): ocamlformat config + fatal warnings in dev (#6) 2026-06-29 13:32:54 +00:00
antipatterns.md feat(cross): material crossings — paper space, on the marks (v0.19-dev) (#69) 2026-07-05 16:05:31 +00:00
bibliography.md docs(bib): add D5 dynamic-evaluation sources (ddd1985, duval1994) 2026-07-03 00:08:09 +02:00
bun.lock tools: fold2svg — render FOLD to SVG/PNG via Rabbit Ear (#4) 2026-06-29 10:07:55 +00:00
CLAUDE.md docs: add references.bib, citation discipline, gitignore refs/ 2026-06-28 17:59:58 +02:00
dune chore(quality): ocamlformat config + fatal warnings in dev (#6) 2026-06-29 13:32:54 +00:00
dune-project build: add zarith/alcotest/menhir setup and error module 2026-06-28 20:25:19 +02:00
flake.lock chore: scaffold project — ADRs, docs, OCaml/nix skeleton 2026-06-28 16:42:19 +02:00
flake.nix feat(kernel): back irrational numbers with FLINT qqbar (#41) 2026-07-03 13:07:12 +00:00
ideas.md docs(notes): rescue local working notes after main realigned to origin 2026-07-03 09:30:49 +02:00
LICENSE.md chore: initial commit 2026-04-18 02:38:44 +02:00
package.json tools: fold2svg — render FOLD to SVG/PNG via Rabbit Ear (#4) 2026-06-29 10:07:55 +00:00
README.md feat: def/apply/export/step — reusable folding sequences, instances, panels (#35) 2026-07-03 00:39:21 +00:00

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.md for the language, and notes/ 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
x-midpoint.bel rendered as a crease pattern: two diagonals --d1 and --d2, their crossing labelled .center, and the fold crease from .a to .center x-midpoint.bel folded: the corner .a flap reflected onto .center

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