demonstrate 的 blog

daily blog

Archive for the ‘go’ Category

hello world in go

leave a comment »

今天终于编译好了 gcc 4.6,用来体会一下 google go:
package main import "fmt" func main() { fmt.Println("Hello, 世界") }

编译和 C/C++ 类似

gccgo hello.go -o hello

执行,

$ ./hello
Hello, 世界
$ ldd hello
        libgo.so.0 => /usr/lib64/libgo.so.0 (0x00002b5604023000)
        libm.so.6 => /lib64/libm.so.6 (0x0000003d9ee00000)
        libgcc_s.so.1 => /usr/lib64/libgcc_s.so.1 (0x00002b5604c5e000)
        libc.so.6 => /lib64/libc.so.6 (0x0000003d9ea00000)
        /lib64/ld-linux-x86-64.so.2 (0x0000003d9da00000)
        libpthread.so.0 => /lib64/libpthread.so.0 (0x0000003d9f600000)

很有意思的语言,编译非常快,也是产生 native code。

——————
And Enoch walked with God: and he was not; for God took him.

Written by zt

2011/04/02 at 4:45 PM

Posted in go

Tagged with

Follow

Get every new post delivered to your Inbox.