News for hackers. Stuff that matters.
Re:Go gets preliminary WebAssembly support by oelmekki on Saturday April 14, 2018 @04:29AM (#16836487)
I didn't know go compiler allowed to build without those, thanks.

I've just tried on a go binary that was 2.4MO. After building it with `go build -ldflags=-s .`, it's 1.6MO. After stripping with upx, it's 480ko (and still works, and has panic stack traces).

Re:Go gets preliminary WebAssembly support by killercup on Saturday April 14, 2018 @06:27AM (#16836743)
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).

Re:Go gets preliminary WebAssembly support by oelmekki on Saturday April 14, 2018 @06:47AM (#16836778)
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).

Re:Go gets preliminary WebAssembly support by yjftsjthsd-h on Saturday April 14, 2018 @10:11AM (#16837374)
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 by brobinson on Saturday April 14, 2018 @06:44PM (#16839991)
Don't forget the "-w" linker flag, too.