Google’s New Programming Language: Go

go programming language googleJust few months back (November 09) Google officially released its own programming  language named  ”GO“. Ken Thompson (of UNIX fame) is one of its designers, and it has the support of Google,  so the language got much attention on the Internet.

It is much like C and a system programming language with C like syntax and execution of program is fast like in C. It safe to use  as it has type safety, garbage collection, etc. GO is concurrent language and more interestingly it is an open source’s language with some cool features. Have a look at these features, i am sure GOwill be the language to watch out for.

Features.-

The first question comes up in everyone’s mind is – How does it look like?

As mentioned above, it is much like the C so the coding very much resembles the coding in C. Every code is preceded by some key words like  - type , func , var or const which tells you what is being declared. Every type declaration is quite cleaned up a lot and doesn’t give you the type-declaration garbage like C. In every declaration name comes first and then it is followed by its type.

For example  if i want declare an integer ‘n’, it will be declared like this way:

n int ;

Did you notice the semicolon in the end? Yes, just like C statements end with semicolons. Now lets have a look on function declaration :

func Factorial(n int) (result int) {

if n == 0 {

result = 1;

} else {

result = n * Factorial(n - 1);

}

return;

}

We are not going into much details but i think the above code might give you a rough idea about a function declaration and definition. Having a closer look at it again, here is something different from C’s flavour, “you can declare the  return value as a variable which will be returned by the function in the header part of function”. Here result is the variable to be returned. Quite interesting for the coders!

Another interesting thing is that you can also have your functions with  many or multiple return values.This is just a part of it. Guess how interesting the it would be to code in GO!

For more information follow these links -

The official site is http://golang.org

Installation issues can be found here.

You can read tutorials from official site here.

Enjoy GO !

  • Share/Bookmark

Also Read:


Article by Mani

Mani is a coder passionate about working in open-source projects. You can follow him on Twitter . If You have any questions feel free to write and add him to Gtalk - it will be nice to get comments and direct contact from you!

Mani has written 24 articles for us at TechTickle.

Leave a Comment