Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for wasm32-unknown-unknown #73

Open
tmpfs opened this issue Feb 2, 2024 · 4 comments
Open

Support for wasm32-unknown-unknown #73

tmpfs opened this issue Feb 2, 2024 · 4 comments
Labels
enhancement New feature or request

Comments

@tmpfs
Copy link

tmpfs commented Feb 2, 2024

Hi @survived,

I am looking into using this in a webassembly context, currently the build fails due to gmp-mpfr-sys:

error: failed to run custom build command for `gmp-mpfr-sys v1.6.1`

Caused by:
  process didn't exit successfully: `/Users/muji/git/forks/cggmp21/target/debug/build/gmp-mpfr-sys-18f237700e2fce47/build-script-build` (exit status: 101)
  --- stderr
  thread 'main' panicked at /Users/muji/.cargo/registry/src/index.crates.io-6f17d22bba15001f/gmp-mpfr-sys-1.6.1/build.rs:105:9:
  Cross compilation from aarch64-apple-darwin to wasm32-unknown-unknown not supported! Use the `force-cross` feature to cross compile anyway.
  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
warning: build failed, waiting for other jobs to finish...

Has anyone tried with the force-cross feature for wasm32-unknown-unknown? Is it known to work?

Or would it be better to use a different GMP implementation for WASM behind a feature flag? Are you interested in supporting the wasm32-unknown-unknown target?

@survived
Copy link
Contributor

survived commented Feb 2, 2024

We are interested in adding wasm32-unknown-unknown support, but rug library to my knowledge does not support it. I think it's the only blocker, so whenever rug becomes wasm-friendly, we'll do too. See gmp-mpfr-sys#18

@survived survived added the enhancement New feature or request label Feb 2, 2024
@survived
Copy link
Contributor

survived commented Feb 2, 2024

However, we do not consider changing big numbers library, or adding another one behind feature flag. It seems to be a big change.

@shekohex
Copy link

shekohex commented Mar 1, 2024

However, we do not consider changing big numbers library, or adding another one behind feature flag. It seems to be a big change.

One of the libs that could be the one here is https://crates.io/crates/malachite, https://github.com/mhogrefe/malachite, it is fully no_std by default.

@survived
Copy link
Contributor

survived commented Mar 5, 2024

It does look nice, but rug and this one expose different interfaces, so it'll be difficult to unify them (especially, unify them in the way so we can still benefit from optimizations in each backend).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants