-
Notifications
You must be signed in to change notification settings - Fork 418
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
integrating wasm-bindgen #13
Comments
also curious for @linclark, @yoshuawuyts, @sendilkumarn's thoughts on the ergonomics of this all. i am leaning toward integrating steps 1 and 5-7 into the tool. leaving 3 and 4 to the user. check out @alexcrichton's issue on how the ergonomics of this should work here: https://github.com/alexcrichton/wasm-bindgen/issues/46 |
FWIW the code for this example in wasm-bindgen will one day be: use wasm_bindgen::prelude::*;
#[wasm_bindgen]
#[no_mangle]
pub extern fn foo() {
webabi_sys::alert("hello!");
} in that |
@ashleygwilliams I haven't played enough with |
@sendilkumarn done! totally agree :) see #17 |
there are several steps to using
wasm-bindgen
that i'd like to discuss here:rustup target add wasm32-unknown-unknown
add
wasm-bindgen
as a dep toCargo.toml
:add the following code to your
src/lib.rs
:add this annotation to each publicly exported function:
cargo build --release --target wasm32-unknown-unknown
cargo install --git https://github.com/alexcrichton/wasm-bindgen
(this seems redundant with 2??? https://github.com/alexcrichton/wasm-bindgen/issues/44)wasm-bindgen target/wasm32-unknown-unknown/release/<name of lib>.wasm \ --out-dir .
(ergonomics ask: https://github.com/alexcrichton/wasm-bindgen/issues/45)i can see clear ways to integrate 1, 2, 5, 6, 7. 3 and 4 will need to be done manually by the user. @alexcrichton do you have any thoughts on this?
The text was updated successfully, but these errors were encountered: