Here is the problem:
I am building a web app with Rust/wasm32.
I have a small VM / scripting language implemented in Rust (compiled to wasm32).
I allow users to upload scripts that the VM runs.
Problem: Right now, when this happens, the VM runs the script to completion -- freezing up the UI while the VM is running.
Because I implemented the VM, I can force the VM to "yield" every 1000 steps or so.
I want the UI to remain responsive as the script is running.
Question: What are my options for solving this?
What is the best approach if I want true multi threading in Rust/wasm32 ?
What is the best solution if I am okay with co-op "threading" ?
What other potential solutions should I look into ?