Sunday, April 3, 2011

Wrestling Belt Cake Sheets

GO



... I will not change, I will not change my
they tell me "baby, baby
you what you got everything."
Oh, go black ... Rare The small paragraph of the song lice "black go go" sums up my feeling a bit on this language, it is like he has all but done as he likes to google. I am not saying that this wrong, but so many laps around thread are not very good at times. Go The programming language is an open source project with the objective of the productivity of programmers. Go


is expressive, concise, clean and efficient. Concurrency mechanisms makes it easy to write programs that take full advantage of multiple cores and networked machines, while typing the new system allows the construction of flexible and modular programs. Quickly compiled into machine code, but has the comfort of garbage collection and the power of runtime reflection.

For example: package main



/ / fib returns That function returns a
/ / Successive Fibonacci numbers.
func fib () func () {int
a, b: = 0, 1 return func () {int
a, b = b, a + b

return b}}


func main () {
f: = fib ()
/ / Function Are Evaluated calls left-to-right.
println (f (), f (), f (), f (), f ())}


The output of this program is to: 1 2 3 5 8

can easily see the influence of python c + +

Here is a hello world:



main package import fmt "fmt" / / Package Implementing formatted I / O.

func main () {
fmt.Printf ("Hello, world, or Καλημέρα κόσμε; or こんにちは 世界 \\ n")}





Go is a compiled language. To compile this program we can use Gccgo using GCC. There are also a number of compilers for different architectures, for example: 6g for 64-bit x86, 8g for 32-bit x86, etc. These compilers run faster than Gccgo but generate less efficient code. Let's see how to compile and run go:
helloworld.go
$ 6g # compile; object goes Into helloworld.6 helloworld.6
$ 6l # link; output goes Into $ 6.out
6.out
Hello, world, or Καλημέρα κόσμε; or こんにちは 世界
or
$ gccgo helloworld.go
$ a.out Hello, world, or Καλημέρα κόσμε; or こんにちは 世界

leave links as always
http://golang.org/



http://wh3rd.net/practical-go/








0 comments:

Post a Comment