-
Notifications
You must be signed in to change notification settings - Fork 74
Replace rand
crate with fastrand
#32
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
base: master
Are you sure you want to change the base?
Conversation
There's no reason to swap to the I'm not sure what is the most correct thing for |
Nice! Sorry, I misread |
Yeah, that's more like what I was thinking, but now the question is... is this the correct thing to do, or should we just let the end user do it? Do we enable the "js" feature unconditionally when the target arch is wasm32? If so, that just kind of raises the question of why doesn't My guess is that the answer is because the target is wasm32-unknown-unknown, javascript isn't really strictly implied. So, if we accept that, we can EITHER have our own "js" feature which seems pretty heavyweight, or maybe just... leave the status quo and let the end user manually inject the "js" feature into I dunno, that's kind of why things were left like they are now actually, because I didn't know the correct answer. |
From
About
|
194308a
to
b0e9412
Compare
Just my 2¢: If the only But if Piccolo intends to support other platforms, e.g. running on Wasmtime (requires an API to supply a random function by the user), it should not be enabled and left to the user instead. Though I don't see anything particularly wrong with re-exposing a |
I definitely would want to run piccolo on wasmtime. I have a wasm based plugin system, so running Lua scripts via piccolo would be great. |
(Wasmtime does support |
I'm planning on addressing this in the near future when I add explicit support for no_std. There should definitely be a version that just accepts a random seed from the user. I think at that point just having a "getrandom" feature would be enough, and that can provide a math lib load function that doesn't require a random seed. We could also provide maybe both "getrandom" and "getrandom-js" features so the user doesn't have to manually inject the "js" feature, but this is quite a lot of ceremony for what amounts to a single function call. |
These changes allow
piccolo
to compile forwasm32-unknown-unknown
target.