5
lorentz
15h

WASM threads have been supported in every browser since 2021, but Rust can't support them because production users and library authors enabled WASM support in thread-unsafe ways relying on WASM being single threaded, so enabling it would almost certainly introduce vulnerabilities.

Comments
  • 2
    That's sad. You can always upgrade to a different language! :) Yh, wasm. I also very stoked for the tech. But actually, what are good use cases? I'm very impressed by openttd in browser and Autocad. What do you think wasm will bring us?
  • 1
    Not all is lost though, there will probably be a different WASM target with native threading support. I look forward to the third WASM target that will use WASI threading.
  • 2
    @whimsical I look forward the most to the end of Javascript's hegemony and opening the floor to languages with better static analysis and opportunistic parallelization potential, although that may be a bit ambitious. Otherwise, I hope it can become a democratic distribution method for indie games. Since payment providers like Stripe aren't too difficult, the biggest argument in favour of Steam for many devs is actually player convenience.
  • 1
    That's not the end of the threading issues either. You need special cors rules on the server as well, that prevent you from having 3rd party links. It's something @whimsical and I bumped into
  • 1
    @BordedDev soon we have such a sick and amazing platform 😁
  • 1
    @BordedDev what has cors got to do with the parallelization of client-side programs?
  • 0
    @lorentz "security" it allowed a specter exploit because of an exploit in shared memory (I don't know why this required, instead of just allowing us the same postMessage interface - maybe don't call it a thread then but still a threading setup with the isolation burden would be appreciated) so now you have to have cross-origin isolation.

    This has bit more of a write up: https://web.dev/articles/...
  • 0
    @BordedDev That's odd, I could've sworn that Rust's wasm support uses a virtual stack to allow "blocking" the "invoking thread" which all looks like regular async work from the JS side. I mean, Rust at least actually has a type of async support that makes no assumptions about the executor so you can use that. But still, it surprises me that the general solution isn't to lift all work into promises while we're already on a compilation boundary where anything goes.
  • 0
    What the hell is going in with WASM in general. It has been in development for like 10 years and its still like 0.1 alpha. Reference types are still experimental, theres no garbage collector support, no dom access, etc. etc.

    Like do they actually want to finish it at some point...?
Add Comment