wargo icon indicating copy to clipboard operation
wargo copied to clipboard

Add support for `cargo run`

Open kryptan opened this issue 8 years ago • 3 comments

This is probably similar to cargo test but running different executable

kryptan avatar Nov 14 '17 00:11 kryptan

What would it do? Open the executable in Node? I feel like most applications of WebAssembly embed it within some other JavaScript, so I'm curious what you think the correct functionality in this case is.

lord avatar Nov 14 '17 02:11 lord

I think it should just start a webserver which would serve simple HTML which loads js file generated by cargo. Very similar to how wargo test works.

I feel like most applications of WebAssembly embed it within some other JavaScript

You are probably right but that't not what I'm doing. I'm working on auto-generating Rust bindings to web APIs and would like to test it with simple apps, like this one. Wargo cannot run it, I can launch it in Firefox directly from filesystem but Chrome requires a web-server because it refuses to load wasm to due to some security requirements or something.

kryptan avatar Nov 14 '17 18:11 kryptan

Open the executable in Node?

While Wasm should or will work in Node, I think Emscriptem is only targeting browser environments.

kryptan avatar Nov 14 '17 18:11 kryptan