- Back to Home »
- GOOGLE »
- GOOGLE's new Language: GO
Posted by : Unknown
Saturday, September 3, 2011
Big news for developers out there: Google has just announced the release of a new, open sourced programming language called Go. The company says that Go is experimental, and that it combines the performance and security benefits associated with using a compiled language like C++ with the speed of a dynamic language like Python. Go’s official mascot is Gordon the gopher, seen here.
The Go programming language is an open source
project to make programmers more productive. Go is expressive, concise, clean,
and efficient. Its concurrency mechanisms make it easy to write programs that
get the most out of multicore and networked machines, while its novel type
system enables flexible and modular program construction. Go compiles quickly
to machine code yet has the convenience of garbage collection and the power of
run-time reflection. It's a fast, statically typed, compiled language that feels
like a dynamically typed, interpreted language.
Main Goals of 'GO':
Go aims to provide the efficiency of a statically-typed compiled language with the ease of programming of a dynamic language.Other goals include:
Go aims to provide the efficiency of a statically-typed compiled language with the ease of programming of a dynamic language.Other goals include:
- Safety: type-safe and memory-safe.
- Good support for concurrency and communication.
- Efficient, latency-free garbage collection.
- High-speed compilation
The syntax of Go is broadly similar to that of C: blocks of code are surrounded with curly braces; common control flow structures include
for
, switch
, and if
. Unlike C, line-ending semicolons are optional; variable declarations are written differently and are usually optional; type conversions must be made explicit; and new go
and select control keywords have been introduced to deal with concurrent programming. New built-in types include maps, Unicode strings, array slices, and channels for inter-thread communication.
Go is designed for exceptionally fast compiling times, even on modest hardware. The language requires garbage collection. Certain concurrency-related structural conventions of Go (channels and alternative channel inputs) are borrowed from Tony Hoare's CSP. Unlike previous concurrent programming languages such as occam or Limbo, Go does not provide any built-in notion of safe or verifiable concurrency.
Of features found in C++ or Java, Go does not include type inheritance, generic programming, assertions, method overloading, or pointer arithmetic.Of these, the Go authors express an openness to generic programming, explicitly argue against assertions and pointer arithmetic, while defending the choice to omit type inheritance as giving a more useful language.Initially, the language did not include exception handling, but in March 2010 a mechanism known as
panic
/recover
was implemented to handle exceptional errors while avoiding some of the problems the Go authors find with exceptions.
Visibility of structures, structure fields, variables, constants, methods, top-level types and functions outside of their defining package is defined implicitly according to the capitalization of their identifier.
Let's see a basic "HELLO WORLD " example in GO Language:
package main
import "fmt"
func main() {
fmt.Println("Hello,World")
}