|
|
|
|
|
by apatheticonion
710 days ago
|
|
Fair, you're right that typically you'd have a dedicated UI thread with workers handling business logic. The difference with Rust and Go is they have better synchronization capabilities - where JavaScript largely forces you to clone data between threads. So while you may still be messaging worker threads in Rust/Go - threads share memory which is fast and you have access to things like atomics and mutexes. We can use Rust in the browser today with WASM and it's super cool - but without something like WASI, extensive thunking through JavaScript is required, plus there are issues with threading. I hope that one day we can initialize a wasm module via a script tag with the browser offering a wasi interface `<script src="module.wasm" type="application/wasi">` And that browsers allow for threading without the restrictive security headers we have today |
|
https://github.com/WebAssembly/threads/blob/main/proposals/t...
But that’s not going to help when accessing the DOM.