Google GO (The Programming Language) By-Ajay Singh Computer Science(8 th Sem)
Google GO (The Programming Language)By-Ajay SinghComputer Science(8th Sem)
HISTORY
Made by Rob Pike and Ken Thompson in 2008
Officially launched in 2012
GO 1.0 was the first version.
Recently GO 1.2 was launched on 1st Dec 2013.
Born out of a need for Ease of Programming combined with Type safety & Portability
BRIEF OVERVIEW
Open Source Language driven by a large Community
Suitable for Modern Systems and Large Scale programming
Go aims to combine the safety & performance of Statically typed compiled language with expressiveness & convenience of Dynamically typed interpreted language
Extension of file is .go (e.g- HelloWorld.go)
FEATURES Of GO
Easy to Learn
Compilation is Very Fast
Deployment is Easy
Easy Concurrency via Channels
Uses Garbage Collection
Uses Interfaces
Functions have multiple return statements
No Exception Handling
No classes(Go is a Procedural Language)
No overloading
No inheritance but embedding
No constructors only simple functions
SYNTAX OVERVIEW
Looks similar to C Language
End of line semicolon are Optional
Variable declaration is Optional
Variable name is followed by its type
Variables can also be declared by initialization
Visibility of functions is controlled using Capitalization
If First letter of Function name is CAPITAL then it is publically available outside the package
If First letter of function name is small then it will be private
HelloWorld.go
Set Of STANDARD TYPES
Modern Standard Library & Frameworks
Standard Library(Packages)
Json,xml
net./http
Text/template and html/template
Time
IO formatting
Images
And many more….
Frameworks
Revel
Gorilla
Web.go
GO TOOLS!(Commands)
Go run hello.go [execution of program]
Go test [runs unit testing]
Go install [install local packages]
Go get [install external packages]
Go fmt [format the sources]
Go doc [source documentation]
USERS of GO
Heroku
Mozilla
Cloudfare
Canonical
Bit.ly
CONCURRENCY
It talks about composition of independently executing processes
It is done with the help of Goroutines and Channels
Goroutine: is a light weighted function which behaves like a thread
Channel: helps in Synchronization and Communication between Goroutines
Upto thousands of Goroutines can execute simultaneously
Future Of GO
GO 1.2 was launched recently in Dec 2013
Currently Google is focusing on increasing the performance
Fixing of Bugs related to Garbage Collection and Bootstrapping is being done
GO 2.0 has not been started yet
Conclusion
Go has nothing cool/special
But it is a nice language
Easy to Learn
That will make you more Productive
And it is well suited to Real World Problems