lord / wargo

Easy Rust to WebAssembly
MIT License
261 stars 9 forks source link

Add support for `cargo run` #21

Open kryptan opened 6 years ago

kryptan commented 6 years ago

This is probably similar to cargo test but running different executable

lord commented 6 years ago

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.

kryptan commented 6 years ago

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 commented 6 years ago

Open the executable in Node?

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