Update page while wasm is running

Viewed 75

I've made a compiler in Rust and compiled it into wasm. I have an output field that shows the compiler output to inform the user of the current progress, which I do by running a js function that I import like this:

#[wasm_bindgen(module = "/functions.js")]
extern "C" {
    fn out(s: &str);
}

My problem is that when I run the compiler with a lot of input my whole Page freezes until the compilation is finished and I get all the output at once at the end, which defeats the purpose of outputting the progress, plus is very annoying. I think this happens because wasm occupies the browser threat. Is there some way I could run my compiler on a different threat or give live updates?

0 Answers
Related