5 ms·
In order to port other languages (Haskell, Go, Python) to target WASM, we definitely need the possibility of writing a GC in WASM. But to build an efficient GC
by amelius 9y ago
In order to port other languages (Haskell, Go, Python) to target WASM, we definitely need the possibility of writing a GC in WASM. But to build an efficient GC, we need multithreading and synchronization/memory barrier primitives.
- bartwe 9y agoMulti threading brings in all kinds of security issues
- singularity2001 9y agoeven in the very sandboxed context of WebAssembly?
- exDM69 9y agoBut without multithreading, you can use 1/4th or 1/8th of the computation power available on your average consumer device. What kind of issues are you thinking about? Multithreading is not easy but your typical race conditions and multi threaded problems aren't really opening doors to any new security exploits. Browsers and WASM have quite decent sandboxing to mitigate security issues. There's WebWorkers already which brings a limited form of threads to the browser. I'm not seeing a problem with multiple threads in a browser.
- marcosdumay 9y agoWhat kinds of security issues? I really can't think of any besides some issues with too many threads spawned (that can be trivially blocked).
- oconnor663 9y agoCould be a new source of undefined behavior and memory exploits, if threaded code is allowed to access collections that allocate memory without taking all the locks they should?
- marcosdumay 9y agoInside the VM, yes. But not a security threat for the host. The VM should be sandboxing the pages from each other, so those are potential security threats against targets on the same pages only. Not something to be too concerned about.
- oconnor663 9y agoHelp me understand: What's the difference between that and process separation?
- clouddrover 9y agoSeems to be on the roadmap: http://webassembly.org/docs/future-features/ http://webassembly.org/docs/future-features/
- steveklabnik 9y agoYou can already compile your language's runtime to wasm; this includes the GC. The downsides is that now you're adding all that to your binary size. "GC support" means being able to integrate with JS's GC, basically, so that your language's wasm runtime could use it instead of your own, saving bytes.
- wtetzner 9y agoSaving bytes and improving interop, I imagine.
- marcosdumay 9y ago> The downsides is that now you're adding all that to your binary size. The GHC runtime (that is huge) isn't much larger than a web font. It is not much out the range of the JS libraries out there.