A proof of concept of GMP (and TTMath) being compiled to WASM, as well as a benchmark comparing two implementations with native BigInt.
Both WASM implementations have a separate function for getting the result. It's implemented this way because in order to pass information from WASM to JS you have to convert the result to a string, that's not a zero-cost operation.
./compile.sh
python3 -m http.server --directory ./dist
or
cd ./dist && python -m SimpleHTTPServer
Then open http://localhost:8000 in your browser.
TravisCI is configured to push compilation artifacts to gh-pages
.