-
Notifications
You must be signed in to change notification settings - Fork 27
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
This crate can run on wasm32 with a little modification. #16
Comments
I'm trying to run genevo in WASM, I've lowered my population to under 50 to avoid crashing, but there's still a crash related to the time crate:
How would I go about "stubbing the time crate return value with 0"? Update: I forked genevo and changed the
(as seen in chronotope/chrono#382 (comment)) Now it works! |
Thanks for the examples @warycat and @Bauxitedev. I was able to run the queens and the monkeys examples from v0.5.0 with the following modifications:
rand = { version = "0.7.3", features = ["wasm-bindgen"] }
chrono = { version = "0.4", features = ["wasmbind"] }
I used wasm-bindgen 0.2.63 and Rust 1.54 with the default wasm-pack 0.10.0 template. Later I might check if the examples work with a bigger population after adding wasm-bindgen-rayon. The caveats page sounds rather scary and I don't need my algorithm to perform well, yet. |
Thank you all for the feedback and input. I think I finally managed to add support for wasm32 targets to genevo. Starting with version 0.7.0 there is the crate feature I modified the great example from @warycat to test if it really works. You can check out the modified example using genevo 0.7.0 here: https://github.com/haraldmaida/ga_wasm |
That’s fantastic news! Thank you very much! I think I might try to see anyway if the previous version of genevo works with rayon if you use wasm-bindgen-rayon. |
Ok, I tried to make 0.5.0 run with wasm-bindgen-rayon, but I ran into problems straight away:
At this point I'll just upgrade to 0.7.0 instead. ;) |
I wrote a traveling salesman problem in rust and build it with wasm bindgen.
demo https://warycat.github.io/ga_wasm/
src https://github.com/warycat/ga_wasm
Thank you for making this awesome crate.
The text was updated successfully, but these errors were encountered: