Go! Language by Google  

Posted by Angad Singh

Last week I heard about a new Language "Go!" in the town. Not caring much about it, I thought of it just as "Yet another one to join the race". The very next day, while looking for something in Python, I again came across reference of "Go!". Now, would you call it destiny or what....hearing the reference of something again and again. So I fired up my Chrome (fastest) browser and types in "Go Language"....and to my biggest surprise, it was a Google Product (http://golang.org/). Being a complete fan of Google Apps, Search, Gmail, Chrome, Wave (lately)....it had now become my sole responsibility to go thru this new language and how does Google perceive a Language should be.

As I read thru their Specs, History, Language construct and all....I was shocked by some interesting faces:

  • The main creators of this language are Robert Griesemer, Ken Thompson(B language, UNIX, Plan 9 OS) , and Rob Pike (Plan 9, Inferno OS and Limbo language). Now with these kind of leaders pioneering something, u ought to expect nothing less than a Supernova.
  • This is a systems language....something more C like, concentrating more on the system.
  • The language is a amalgamtion of C++ and Python.
  • Go, has been designed by Google from the ground up as “a concurrent, garbage-collected language with fast compilation”.
  • Go routines are Google’s answer to threading in Go, and any function call which is preceded by the go statement runs in a different goroutine concurrently. A feature called channels allows for easy communication and synchronization between such routines.
  • Like Python, Go supports “slices”, which allow you to refer to parts of arrays using a simple syntax. Thus for an array “a” with 100 elements, a[23,42] will result in an array with elements 23 through 42 of a. Go also tracks the length of arrays internally, further simplifying array usage. Additionally, Maps in Go allow you to create “arrays” with custom index types, and are a native feature of the language.
  • Unlike other object oriented languages, Go has a much “simplified” type structure, which disallows sub-classing! Go offers a different flavour of object oriented programming using interfaces, which Google believes will simplify use. By using interfaces, explicit type hierarchies need not be defined, instead, a type will satisfy all interfaces which are subsets of its methods. The relationships between types and interfaces need not be defined explicity! This can have some interesting implications as people can add interfaces to connect unrelated types even later in the development of an application.
  • One consistent point in the features of Go is that it is better to have one excellent implementation of commonly used features such as garbage collection, strings, maps etc. rather than have them rethought and re-implemented in each program.
  • As nearly all Google products, Go is “beta” and not yet suitable for production use. By releasing it early Google hopes to garner a community around it and hopes that enough people will be interested in it to justify continued development.
So all you guys.....try it out.....and I am sure this language is here to stay just like pioneers like C, C++.
Cheers!