taybenlor / runno

Browser-based runtime for programming languages and WASI binaries.
https://runno.dev
MIT License
636 stars 27 forks source link

avoid SAB when possible #295

Open ghost opened 8 months ago

ghost commented 8 months ago

When stdin is constant (or potentially empty), SharedArrayBuffer doesn’t seem necessary.

Besides that, another option would be to run Binaryen with the asyncify pass on the WebAssembly file in order to be able to run some code asynchronously. I have used Binaryen.js (from the AssemblyScript community) in the past for that effect, modifying the Wasm binary within the browser itself!

taybenlor commented 8 months ago

Yeah those are both interesting ideas!

I've avoided doing asyncify to keep things simple, but it's worth exploring.

Being able yo dodge SAB would really help with improving the integration experience. Changing headers is annoying.