4 ms·
To make the comparison a little more valid, we can strip symbols with a compiler flag and pass the result through `upx` for to build a stripped, compressed bina
by weberc2 10y ago
To make the comparison a little more valid, we can strip symbols with a compiler flag and pass the result through `upx` for to build a stripped, compressed binary at only 300Kb:
`go build -o /tmp/hello -ldflags='-s -w' /tmp/hello.go && upx --brute /tmp/hello`.
Also worth noting that the author is incorrect about the Avian example being self-contained--it dynamically links against 4 libraries (on OS X, anyway) while the Go version links against zero.
Further, the Avian example is broken on OS X (the GUI loads, but immediately freezes).
Of course, the applications aren't doing the same work, so comparing the binary sizes is silly. I just wanted to point out that avian's tricks are readily accessible for Go programs as well.
- pvg 10y agoIt's not using Swing.
- weberc2 10y agoMy mistake; what's it using? Native UI?
- dom0 10y ago> it dynamically links against 4 libraries (on OS X, anyway) while the Go version links against zero. And how exactly does that work out on platforms that don't have stable syscalls?
- pcwalton 10y agoOn Mac, Go breaks the rules and hardcodes syscall numbers anyway. On Windows, Go dynamically links to kernel32.dll and friends.
- penpapersw 10y agoSo in theory Go programs can't be considered reliable across multiple versions of macOS without recompilation then?
- coldtea 10y agoIt only matters if it also happens in practice.
- favorited 10y agoIt does happen in practice: https://github.com/golang/go/issues/16272 https://github.com/golang/go/issues/16272
- pcwalton 10y agoAll forwards-compatibility issues were only "theoretical" issues that didn't "matter in practice" until a new release of the platform came out and suddenly they did.