janestreet / zarith_stubs_js Goto Github PK
View Code? Open in Web Editor NEWJavascripts stubs for the Zarith library
License: MIT License
Javascripts stubs for the Zarith library
License: MIT License
The function caml_custom_ops
is used here, and in the master branch of js_of_ocaml. It is not in an official release of jsoo.
Maybe, you can add a specific version of js_of_ocaml in the opam dependencies to avoid these problems in the future.
Thank you !
Not to be rude, but is there a timeline for an updated OPAM release? The pre-v0.15 version has been sitting for several months.
The bugfix discussed here,
7c5a500
is important for our project. It's slightly clunky (but not impossible of course) to install it from source rather than OPAM.
Thanks!
ml_z_extract_small
was added as a fast path for ml_z_extract
in ZArith 1.13 (see ocaml/Zarith#90 )
It can be aliased to ml_z_extract
:
// Provides: ml_z_extract_small
// Requires: ml_z_extract
function ml_z_extract_small(z1, pos, len) {
return ml_z_extract(z1, pos, len);
}
Hi,
Thanks for this library, i'm trying to use it in the JS version of the SMT solver Alt-Ergo and i've found an error. I manage to make a minimal example of my problem:
let () =
let y = Q.of_string "21749119135811171023142898368512/7209762788798054855747370097333" in
print_int (Q.compare y y)
This lines issued the following error :
dune build; node _build/default/Main.bc.js
<my_path>/_build/default/Main.bc.js:83
function caml_raise_with_arg(tag,arg){throw [0,tag,arg]}
^
[
0,
[ 248, MlBytes { t: 9, c: 'Invalid_argument', l: 16 }, -3 ],
MlBytes { t: 9, c: 'compare: abstract value', l: 23 }
]
The compare: abstract value
error message seems to be issued by the compare function of the stdlib. But, in Zarith, Q use the comparison of Z which use an external ml_z_compare
. Your runtime seems to provide this primitive using the bigInt comparison. I don't understand why i get an error message from the stdlib since your library provides every things that i need. Do i correctly use your library ?
Just before the first release of zarith_stubs_js, I had written a stubs using the new BigInt built-in (only for my needs so not exhaustive). But of course some Safari users complained...
Since Safari has finally implemented BigInt (since october 2020), would you be inclined to review a PR switching to this native implementation ?
We've been stuck on how to actually use this in a project that uses Zarith. An example in the README would be awesome!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.