Sunday, August 15, 2010

GO :: GOOGLE'S NEW SYSTEMS PROGRAMMING LANGUAGE

GO is the new experimental , garbage collected, concurrent systems programming language introduced by Google . This project was started by Robert Griesemer, Ken Thompson and Rob Pike in late 2007.
By mid 2008 the language was mostly designed and the implementation starting to work. Ian Lance Taylor and Ross Cox joined the project in 2008. This language went open source on November 10 2009.

Some of the important features of this language are:

1 ::  FAST :   
       GO compilers produce code a lot faster. The build just takes fraction of seconds .

2 ::  SAFE :                
      GO is type safe and memory safe. Go has pointers but no pointer arithmetic.




3 ::  CONCURRENT :  
      GO supports goroutines which are used to write servers and systems as light weight communicating processes. Basically they are used to write programs for servers and systems with concurrency and flexibility.

4 ::  FUN
      GO language is fun to write because of its clean syntax, fast builds, garbage collector etc .It is a dynamic programming language but gives the speed,safety and flexibility of static type languages.

and finally........

5 :: OPEN SOURCE :
     GO language being open source is a effort of lots of people all over the globe. Its source code is thus available to public free of cost .


HELLO WORLD PROGRAM IN GO LANGUAGE :

package main
import "fmt"
func main()
{
fmt.Printf("Hello world")
}

PROGRAM REVIEW : 

Every source file of GO language begins with package statement which determines as to which package it belongs .Any number of external packages can be imported and implemented.
As you can figure out from the above program that we have to import the package fmt to gain access to fmt.Printf() which prints the statement to the output screen.
Functions are introduced with func keyword. The program starts execution from main() function.
Comment convention is same as in C++.
You might have figured out by now that we have not used the semicolons at the end of any statement in the above program. GO language does allow you to write programs without semicolons . The GO language automatically inserts semicolon at the end of  statements contrary to C ,C++ and  JAVA where semicolon is a must.
The main() function should start and end with flower brackets as in C and other languages.

---------------------------------------------------------------------------------------------------------

GO programming language provides the efficiency of statically typed languages with the ease of dynamically programmed languages.

DESIGN PRINCIPLES :

KEEP CONCEPTS ORTHOGONAL.
KEEP GRAMMAR SIMPLE AND REGULAR.
REDUCE TYPING.
AVOID BOOKKEEPING.
NO TYPE HIERARCHY.


COMPILERS :

6g/8g/5g are the compilers designed by Ken Thompson which are experimental and generates OK code very quickly. Is not GCC linkable but has FFI support.

gccgo is another variant of GO compiler developed by Ian Taylor. This compiler generates good code but not as quickly as Ken's compiler .

GO doesn't have generic types.

CONCLUSION :
        GO is a systems programming language which is definitely here to stay .
 It provides performance in between C and C++. Definitely a worth systems language which might revolutionize the server and system programming sectors. 

Any suggestions, questions, comments and criticisms are welcomed.

No comments: