once bitten

words and things from Edd Dumbill 
Filed under

go

 

Brief encounter with the Go language

I won't pretend my opinion on Go counts for much, but here are the results of my first encounters, following the installation guide.

$ cat >hello.go <<EOF
package main

import "fmt"

func main() {
	fmt.Printf("hello, world\n")
}
EOF
$ 6g hello.go
$ 6l hello.6
$ ./6.out
hello, world

Go is a compiled language. So how does the binary stack up against C compiled programs?

$ ls -sk 6.out
 624 6.out

Wow, 624KB (against 8.5KB for the same in C, on Mac OS X 10.6). But:

$ otool -L 6.out
6.out:

So, no shared libraries. The result's completely self-contained.

Loading mentions Retweet
Filed under  //   go   programming  

Comments [0]