News for hackers. Stuff that matters.
Re:Go: Planning the 1.5 release by masklinn on Tuesday December 02, 2014 @09:29AM (#8687216)
> Are you sure it's because they are statically compiled? Not because each binary has DWARF debug symbols in it so that there are useful stack traces?

Removing DWARF information with -ldflags -w reduces the size of the binary by 20%. The binary is 1.8MB originally...

    $ go build hello.go            
    $ wc -c hello                  
     1806192 hello
    $ go build -ldflags -w hello.go
    $ wc -c hello                  
     1408880 hello
the rest is pretty much all runtime, the hello world itself should take about 10k, that's more or less the size of the C or dynamically linked Rust versions (Rust also uses static linking by default, and the hello world is 300k in that case)
Re:Go: Planning the 1.5 release by f2f on Tuesday December 02, 2014 @11:18AM (#8687821)
to see how much the runtime contributes to the size of the binary use an empty main. for hello world you bring in the fmt package which is a relative heavyweight:

    $ cat > t.go
    package main
    func main() {}
    $ go build t.go 
    $ wc -c t
      623280 t
    $ nm t | wc -l
        1029
    $ cat > t.go
    package main
    import "fmt"
    func main() { fmt.Println("hello world") }
    $ go build t.go 
    $ nm t | wc -l
        2541