Open thecaralice opened 1 month ago
The normal threading APIs are not available in WASM. The Uiua runtime is not async, and I won't make it.
Therefore, the only way to fix this is with web-workers. The Worker
api does not let you pass an arbitrary closure, and working with it from Rust is weird and complicated.
If you would like to prevent long hangs, reduce the execution limit in the pad settings, or use the native interpreter.
This was discovered while digging into #563 behavior on the website. Basically, if you run
&sl
,⍢()1
or virtually anything that takes some time to run you can notice that the editor itself, other editor widgets, search bar etc. are all inaccessible. Potential solutions include using the browser's async runtime to run other things while the code is running, or using WASM threads.