-
Notifications
You must be signed in to change notification settings - Fork 79
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
supporting new non-emscripten target #15
Comments
(These are comments from someone without a full understanding of the Rust toolchain, so if I'm utterly on the wrong path here, please just let me know and further ignore this entry). I toyed around with this idea a bit by adding a The two next issues I see there are that
|
The first issue seems to be an actual Rust bug (see rust-lang/rust#46367 -- workaround: run with |
I'll probably get to this in a few days myself, but it's nice someone else is taking a stab!
@chrysn: Yes, well, that's the million dollar question. (: Right now this is definitely an open question; AFAIK for the That said, I'd quite welcome any work you've already done on |
We got you covered, at least we want to provide the necessary wrapper implementations. A |
@badboy Yeah, at first a simple |
Transporting JS derived from Rust to populate the importObject is indeed tricky. So far, I've inspected all files that rustc can Asking the question of how often we'll actually need custom callbacks (which IMO would be superior to just going through exec every time), I discovered that wasm32-unknown-unknown already uses some callbacks and defines them in a dedicated .js file. I'm looking into how this can be shipped via |
@chrysn I've figured out how to relatively easily extract JS snippets from wasm bytecode and automatically generate an |
I'm happy to announce @chrysn For now I've had to delete the math function imports which you've contributed; I'd love to add those again, but I have no idea what actually requires them - perhaps you know how I could make the compiler generate code that requires them? |
@koute, my example program: pub extern "C" fn divide(modulus: f32) -> () {
demo::eval("console.log('Hello, World!');");
let x = 10.2_f64 % (modulus as f64);
demo::eval(&format!("console.log({});", x));
} currently gives: The classical floating point functions are often statically optimized, so testing needs to ensure that they are not; the trig functions (eg. atan) aren't even optimized away, so you can test them w/o enforcing run-time evaluation. |
@chrysn Thanks! |
I'd love to see support for https://www.hellorust.com/news/native-wasm-target.html in cargo-web; I think it's going to be an even bigger target than the emscripten one.
The text was updated successfully, but these errors were encountered: