Javascripts stubs for the Zarith library
23
stars
52
commits
OCaml
primary language
Jul 10, 2026
updated
Zarith is an OCaml library that implements common operations over arbitrary-precision integers and rationals. It is implemented via a C api that primarily calls out to Gnu Multiple Precision Arithmetic Library. Because of that C API, Zarith could not be compiled via Js_of_ocaml until now.
Zarith Stubs JS is a reimplementation of the native C functions in JavaScript. It makes extensive use of peterolson/BigInteger.js as a shim for browser BigInt functionality and also for the implementations of many numerical algorithms.
In order to use zarith with js_of_ocaml, just provide the
javascript runtime files to the js_of_ocaml compiler and use zarith
as you would normally do.
In practice,
zarith_stubs_js as a library dependency.OCaml
39.4%
WebAssembly
27.8%
JavaScript
18.8%
Standard ML
13.9%
Javascripts stubs for the Zarith library
23
stars
52
commits
OCaml
primary language
Jul 10, 2026
updated
Zarith is an OCaml library that implements common operations over arbitrary-precision integers and rationals. It is implemented via a C api that primarily calls out to Gnu Multiple Precision Arithmetic Library. Because of that C API, Zarith could not be compiled via Js_of_ocaml until now.
Zarith Stubs JS is a reimplementation of the native C functions in JavaScript. It makes extensive use of peterolson/BigInteger.js as a shim for browser BigInt functionality and also for the implementations of many numerical algorithms.
In order to use zarith with js_of_ocaml, just provide the
javascript runtime files to the js_of_ocaml compiler and use zarith
as you would normally do.
In practice,
zarith_stubs_js as a library dependency.OCaml
39.4%
WebAssembly
27.8%
JavaScript
18.8%
Standard ML
13.9%