|
http://golang.org/doc/faq#Why_is_my_trivial_program_such_a_l... The linkers in the gc tool chain (5l, 6l, and 8l) do static linking. All Go binaries therefore include the Go run-time, along with the run-time type information necessary to support dynamic type checks, reflection, and even panic-time stack traces. A simple C "hello, world" program compiled and linked statically using gcc on Linux is around 750 kB, including an implementation of printf. An equivalent Go program using fmt.Printf is around 1.9 MB, but that includes more powerful run-time support and type information. |
diet gcc -o hello hello.c; strip hello
2280 bytes on my system.
There are reasons why using glibc results in executables so big, and why it is tolerated (kind of). Those reasons hardly apply to a new language being actively developed. Yet said language produces executables almost twice the size.
"Run-time support and type information", why is it linked into a an executable that never allocates memory and does no introspection of any kind?