clerical
clerical copied to clipboard
Command-like expressions for real infinite-precision calculations
Clerical
An implementation of an imperative langauge for exact real number computation.
Prerequisites
To compile the OCaml implementation of Clerical and a sufficiently new version of OCaml (version 4.10 or later should work). You also need the following:
- the MFPR library
- the Dune build system
- the Menhir OCaml parser generator
- the Ocaml libraries
menhirLib,sedlexandmlgmpidl
OCaml & OPAM
Follow these instructions for installing OCaml and the OCaml package manager OPAM.
MPFR
The GNU multiple-precision floating-point library MPFR is aviable through various package managers. On MacOS you can install it using Homebrew:
brew install mpfr
OCaml tools & libraries
Install OCaml tools and libraries with
opam install dune
opam install menhir
opam install sedlex
opam install mlgmpidl
Note: At the time of writing (2023-03-12) OPAM does not yet support mlgmpidl for OCaml 5, even though the code compiles with OCaml 5. You might have to install it manually from the GitHub repository mlgmpidl if you are using OCaml 5.
Compilation
To compile Clerical, run the following command in the Clerical directory:
dune build
Dune compiles the program and hides the executable in _build/default/src/clerical.exe, so try running it with
_build/default/src/clerical.exe --prelude prelude.real
Repository structure
The structure of the repository:
src– the OCaml implementation of Clericalexamples– examples of Clerical programsdoc– documentation
Clerical syntax
Please consult:
doc/syntax.mdfor a brief explanation of the syntaxexamplesfor examples of Clerical programs- [
prelude.real)(./prelude.real) for the built-in functions and operators