Live data from Hacker News

Go gets preliminary WebAssembly support

go-review.googlesource.com

81–90 of 99 posts

Re: Go gets preliminary WebAssembly support

#81

Earlier quoted context omitted.

Please note that upx also compresses your binary contents and decompresses it at runtime. When downloading a WASM file over HTTP, the server can gzip it transparently. It'd be interesting to compare the effects on the size with what upx does (which is more specialized than gzip).

I see, thanks. I used vanilla `strip` on my binary and it did not produce any size gain (so the strip flag of go compiler is plenty enough). Indeed, given how browsers already handle gunziping resources, it's probably best to rely on it. My binary, stripped by the go compiler and gziped, is 525ko (against 480ko using upx).

Could it also be that Go encodes symbols in a way that strip can't read, or is is just standard ELF stuff?

Re: Go gets preliminary WebAssembly support

#82

Could this be used to get native gRPC support for the browser?

In case you didn't see recently, https://github.com/grpc/grpc-web came out of hidden-repo status recently. Of course there are caveats to its use, but I believe a server side gateway may always be needed due to how http/2 is used but I'm unsure.

Re: Go gets preliminary WebAssembly support

#83

Will the binaries be compiled for size optimization, or will they be the same size as usual golang bins? Go binaries, being static and embedding the whole go runtime, tend to be quite big. Now, I don't care about it because 5 or 10MO on my server filesystem is nothing. If I ask every visitor to download 10MO before running my webpage, that will be a problem, though. Is this something we will have to deal with? Or wil…

Half the size of Go binaries you encounter in the wild are debugging symbols. Compile without them and use `upx --ultra-brute` and the binary will be about ~15% of its original size. You still get goroutine stack traces from panics without the debugging symbols.

Upx also breaks memory mapping.

Re: Go gets preliminary WebAssembly support

#84

Hey so question - WebAssembly can't access the DOM right? What's the whole point then, avoid Javascript? If we can't just swap out all the gnarly JS garbage whole-hog, I don't see where the business value is, given that there's plenty of language-to-js libraries.

It can be a lot faster and less memory-hungry than javascript. That opens up a lot of things you can't feasibly do in JS. Game engines, image decoding, even video editing. http://webassembly.org/docs/use-cases/

Re: Go gets preliminary WebAssembly support

#85
post #76
post #6

What are the challenges to provide a standard GC interface that all managed languages can leverage.

I believe that the LLVM project is trying to accomplish this [1]. However, the concurrent, non-pausing GC of GoLang is not easy to match in efficiency. I'd be interested to hear about actual high-quality implementations of GCs in LLVM. And then there's the problem of making it all work efficiently in WASM (which doesn't yet support advanced concepts needed by GCs such as memory barriers). [1] https://llvm.org/docs/Ga…

I believe the only user of the LLVM GC infrastructure is Azul's JVM. Azul is of course famous for Azul C4, which is a superior GC to that of Go.

Re: Go gets preliminary WebAssembly support

#87

Will the binaries be compiled for size optimization, or will they be the same size as usual golang bins? Go binaries, being static and embedding the whole go runtime, tend to be quite big. Now, I don't care about it because 5 or 10MO on my server filesystem is nothing. If I ask every visitor to download 10MO before running my webpage, that will be a problem, though. Is this something we will have to deal with? Or wil…

Half the size of Go binaries you encounter in the wild are debugging symbols. Compile without them and use `upx --ultra-brute` and the binary will be about ~15% of its original size. You still get goroutine stack traces from panics without the debugging symbols.

I remember UPX packed binaries would trigger some antivirus software in the past because packing was so frequently used by virus authors. Does anyone know if this is still the case?

Also, can you use UPX on WebAssembly binaries? If so, will that trigger any widely used antivirus software?

Re: Go gets preliminary WebAssembly support

#89
post #58

Earlier quoted context omitted.

This would be cool: shared objects over internet. Interesting direction to explore.

Oberon, Java, Limbo, .NET, Flash, ActiveX already explored it.

if we were satisfied with that answer we wouldn't be talking about wasm at all.
Post reply on HN