5 ms·
> Go’s garbage collection is fully supported. WebAssembly is planning to add its own garbage collection, but it is hard to imagine that it would yield a better
by kodablah 9y ago
> Go’s garbage collection is fully supported. WebAssembly is planning to add its own garbage collection, but it is hard to imagine that it would yield a better performance than Go’s own GC which is specifically tailored to Go’s needs
I don't think it's hard to imagine reading the GC proposal. The JS collector that might be reused could be off thread, something WASM can't (yet) do.
> Most file system operations are mapped to Node.js’ “fs” module. In the browser, file system operations are currently not available.
Please please abstract this. As a maintainer of a non-JS WASM backend, I'd love to use Go too.
> Especially a “goto” operation in WebAssembly would be very helpful.
I didn't look into the Go use case enough, but curious how much better this would be than the current labeled block and labeled break approach in WASM. WASM has fairly strict stack/frame rules/types, so arbitrary gotos wouldn't work.
- ramenmeal 9y ago> WASM has fairly strict stack/frame rules/types, so arbitrary gotos wouldn't work. kinda funny because golang follows the same idea.
- kodablah 9y agoSo I am curious how the presence of them in WASM would help
- dualogy 9y agoJump-to-arbitrary-address / labels-as-values isn't made available to Go devs by Go-the-language, but seems required by Go-the-runtime+compiler, such as for compiling Goroutines.
- skybrian 9y agoIt sort of does via channels, though. Sending a value to a bufferless channel causes the next goroutine to run (eventually). This looks a bit like a goto if you squint. Go needs multiple stacks and a way to switch to executing a different stack. Web assembly could provide this in a high-level way.
- mlevental 9y ago>non-JS WASM backend ...what's a non-js wasm backend?
- slimsag 9y agoWebAssembly can be used anywhere. It is not tied to JavaScript in nature. So think of it kind of like the JVM in a way (but it's not an implementation, just a spec).
- tudelo 9y agoSo people are using wasm in a non web context ?
- slimsag 9y agoYes. Not a ton of people (yet), but yes, some are.
- EugeneOZ 9y agobut why, if you have plenty of good languages to do this? Wasm is good for browsers because only choice we have is js.
- kodablah 9y agoWASM can be good for other things too. It is portable and fairly easy to target. It's like asking "why emscripten of you have plenty of other languages to choose from, LLVM is good for executables"
- rictic 9y agoI'm ignorant of the details, but WASM is an assembly language that's designed from the ground up for running untrusted code. It will also have multiple independent open source implementations, which has some nice properties.
- kodablah 9y ago