An implementation of an imperative langauge for exact real number computation.
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
,sedlex
andmlgmpidl
Follow these instructions for installing OCaml and the OCaml package manager OPAM.
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
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.
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
The structure of the repository:
src
– the OCaml implementation of Clericalexamples
– examples of Clerical programsdoc
– documentation
Please consult:
doc/syntax.md
for a brief explanation of the syntaxexamples
for examples of Clerical programs- [
prelude.real
)(./prelude.real) for the built-in functions and operators