30-12-2010, 04:07 PM
ANIL KUMAR REDDY
[attachment=7782]
Go is a
New
Experimental
Concurrent
Garbage-Collected Language.
Features
The most important features of Go are
the feel of a dynamic language with the safety of a static type system.
compile to machine language so it runs fast.
real run-time that supports GC, concurrency.
lightweight, flexible type system.
has methods but not a
conventional object-oriented
language.
Compiled
Go is a compiled language. At the moment there are two compilers.
Gccgo is a Go compiler that uses the GCC back end. There is also a suite of compilers with different (and odd) names for each architecture: 6g for the 64-bit x86, 8g for the 32-bit x86, and more.
These compilers run
significantly faster but
generate less efficient code
than gccgo.
Similarity
Go is having a similar language structure as of C.
Declarations are introduced by a keyword (var,
const, type, func) and look reversed compared to C. Examples are
var i int
const PI = 22/7
The “:=“short declaration
Within functions (only), declarations of the form var v = value can be shortened to v := value (Another reason for the name/type reversal.)
The type is that of the value (for ideal numbers, get int or float, accordingly.)
a, b, c, d := 1, 2.0, "three", FOUR
These are used a lot and are
available in places such as for
loop initializers.