Google Go: New Programming language

In the Era where we are surrounded by millions of programming languages, Google gives us a new GO.

Go is a new Open Source programming language from Google that aims at performance. The performance we are talking about is the fastest you can get: comparable to C minus the troubles and plus the ease. So what we get is more self-explanatory syntax and faster compilation.

Who doesn’t want more syntactic glamor, better runtime performance, better features, easier to code and faster compilation? Thats’s why we see so many programming languages.

Despite the large amount of enthusiasm, modern programming languages dont compare to C in performance. The best that Microsoft, Sun, and Apple have to offer are just variations on that theme.

Although Google’s Go is yet another take on object-oriented C, it’s got some nice features.

Go offers:

  1. An Expressive type system,
  2. Fast compilation,
  3. Great performance, and
  4. Built-in language features that simplify threaded programming and concurrency.

So how much effort did undergo for it’s development?
The GO has been under development for roughly two years. Like other most innovative projects from Google, it started out as a 20 percent project and evolved into a serious full-time undertaking.If youa re not aware Gmail, Google Earth, Google News and several other projects came from 20 percent of Google employee’s time which were later moved to mainstream.

So it’s Open Souce Where is the Source code?
Google is releasing the source code under the BSD license (and not GPLv2) with the hope that a community will contribute to make it even better.
How mature is the Language?

Rob Pike, a google Engineer, says that the Go language itself and the current implementation are relatively mature, but it’s not quite ready for adoption in production environments. The ecosystem around the programming language is still a work in progress. It lacks on several fronts like there is no IDE integration, the standard libraries are thin, and there aren’t a whole lot of real-world code tutorials, examples, debugging info yet. But liek any other open source project, Opening up Go could help to accelerate its advancement and hence adoption.

Compilers: Go comes with two native compilers: 6g and 8g (for 64-bit and 32bit), are designed to be extremely fast. There is an alternative compiler called Gccgo that is based on the GCC. As one would expect, the GCC-based compiler isn’t as fast but, on the other hand, is said to generate more efficient code. On the inside, compiler has a lot of LLVM expertise and is using it extensively for their awesome Python optimization effort.

The compiler generates native binaries, directly executable, no VM, no bytecode, and that’s what makes it faster and comparable to C.

Syntax: The syntax is very generic, hence easy to grasp. There assignments, functions, “for” loops, standard condition expressions, and many other features look easy. But there are certain tricks e.g. it has anonymous function syntax that lets you use real closures. The following code snippet is an example from Google’s documentation:

func multiply(a []int) int { // returns an int

m := 0;

for i := 0; i < len(a); i++ {

m*= a[i]

}

return m

}

m := multiply(&[3]int{1,2,3}); // am array is passed to multiply

It has some unusual type system: It stays away from inheritance. Instead, one can define struct types and then create methods for operating on them. Like Java, one can also define interfaces.The interface mechanism gives developers some of the flexibility of duck-typing, but it goes further by providing the advantages of compile-time checking.

Concurrency: One of the strongest reason to migrate to this language after all it`s taken care from the bottom up in the design. To simplify threading, it introduces concept of “goroutines” which are concurrently executed threads. Just like you would “run” in java, the function call with be “go” in Go language. The inter-thread communications, message handling is done through “channel” which Google calls  “safe” way of doing it while Going in or out of goroutines.

Watch the GO details in Google Tech Talk: (long one)

Do we Really need it?

This is the final and the most important question. Is Google re-inventing the wheel? Yes, google is doing it, but with a purpose. Go will take care of the major issues of today’s programming languages: Concurreny, multicore processing and efficient threading . But we need practical benchmark figures before we can go with that. On the other side,  it’s unusual type system is claimed to be very powerful.

Google developers, to convince us, have build the Web server software that powers the project’s official website. Possibly, that is the only PROD environment it will be seen on, atleast for some time. We really need some good experiences and stats before this language can catch the mainstream. And whenever it does, it might replace (atleast for few  people) C++.

Subscribe to Twitter updates, or RSS, join Facebook fanpage for more Tech updates.
VN:F [1.9.22_1171]
Rating: 0.0/10 (0 votes cast)
VN:F [1.9.22_1171]
Rating: 0 (from 0 votes)

Related Posts

Bookmark and Promote!

  • David

    isn't multicore processing and efficient threading already handle in c#? It a hell of a lot easier than GO

    VA:F [1.9.22_1171]
    Rating: 0.0/5 (0 votes cast)
    VA:F [1.9.22_1171]
    Rating: 0 (from 0 votes)
    • Did you compare c# multithreading with c/c++? was it faster? Of course it's not faster or comparable. GO matches c performance.

      VA:F [1.9.22_1171]
      Rating: 0.0/5 (0 votes cast)
      VA:F [1.9.22_1171]
      Rating: 0 (from 0 votes)
  • Looking at syntax, the Go looks easy.

    VA:F [1.9.22_1171]
    Rating: 0.0/5 (0 votes cast)
    VA:F [1.9.22_1171]
    Rating: 0 (from 0 votes)
  • devdanke

    Well, I'm always for a new language that has promise as a main stream language. A few comments:

    A) It looks a lot like Pascal, but with curly braces. Lot's of people learned Computer Science in college with Pascal, i.e. a lot of people can pick it up quickly.

    B) The one thing I love most about Pascal syntax is the differentiation between the assignment operator “:=” and the equality test “=”. In C-like languages, assignment is “=” and equality is “==”, which is sooooo easy to mix up.

    C) No VM. I like it. VM languages are still too slow for GUI apps and command line apps. The start up time is just to sluggish, even with dual cores and boat loads of memory. For instance, this makes Groovy suck as a shell scripting language. Maybe Microsoft's VM is faster and maybe their PowerScript is snappy at the command line, but who really wants to trust their future to MS? The majority of programmers don't.

    Last but not least, I like Google. I still trust them more than any other major player. I don't trust Sun, Oracle, or Microsoft. And although I trust IBM, I think they're incompetent at anything does not involve their server-side strengths. In other words, they lack the competence to create a new language for the masses.

    Overall, I'm optimistic about GO. Java has become quite complex. It's no longer suitable for many programmers who don't want to put up with it's complexity. This is why Ruby, JRuby, Python, and Perl are making gains. GO and the Fan languages are my picks for The Next Big Language.

    VA:F [1.9.22_1171]
    Rating: 0.0/5 (0 votes cast)
    VA:F [1.9.22_1171]
    Rating: 0 (from 0 votes)
  • Guest01

    I wonder whether the compiler would auto-detect that above function would always return zero, and thus apply a static value on compilation 😉

    VA:F [1.9.22_1171]
    Rating: 0.0/5 (0 votes cast)
    VA:F [1.9.22_1171]
    Rating: 0 (from 0 votes)
  • Pingback: Google SPDY: Protocol to Speed Up the Internet()

  • matt

    Correct me if I'm wrong (this is the first snippet of Go code I've ever seen) but will that example not return 0? Isn't it just repeatedly doing:
    m *= a[i] or equivalently
    m = m * a[i] which is
    m = 0 * a[i] = 0?

    VA:F [1.9.22_1171]
    Rating: 0.0/5 (0 votes cast)
    VA:F [1.9.22_1171]
    Rating: 0 (from 0 votes)
  • I have heard something about that goggle is processing one programming language on its own code. It is the mixer of C programming language and python programming language. Dependency management is a big part of software development today but the “header files” of languages in the C tradition are antithetical to clean dependency analysis—and fast compilation. It is easy and highly affordable.

    VA:F [1.9.22_1171]
    Rating: 0.0/5 (0 votes cast)
    VA:F [1.9.22_1171]
    Rating: 0 (from 0 votes)
  • r4i

    wonder whether the compiler would auto-detect that above function would always return zero, and thus apply a static value on compilation

    VA:F [1.9.22_1171]
    Rating: 0.0/5 (0 votes cast)
    VA:F [1.9.22_1171]
    Rating: 0 (from 0 votes)
    • Handsome Billy T.

      This example is not multiplying anything by i, itself (which if it were, then I'd agree with you that the provided example would alway return 0 – no matter what – because we all know that anything multiplied by nothing is nothing.) This example is iterating through all of the members of the passed in array and multiplying those numbers together. The result will be the product of all of the numbers stored in the array, multiplied together.

      VA:F [1.9.22_1171]
      Rating: 0.0/5 (0 votes cast)
      VA:F [1.9.22_1171]
      Rating: 0 (from 0 votes)
  • Old enough to know better

    How original? Yet another curly-brace language from the over-the-hill gang from Bell.

    VA:F [1.9.22_1171]
    Rating: 0.0/5 (0 votes cast)
    VA:F [1.9.22_1171]
    Rating: 0 (from 0 votes)
  • Pingback: Interview with Google GO Tech Lead()

  • Pingback: [Configure] Google Public DNS()

  • sandeepbvnr

    its nice
    develope it soon that suits for any environment

    VA:F [1.9.22_1171]
    Rating: 0.0/5 (0 votes cast)
    VA:F [1.9.22_1171]
    Rating: 0 (from 0 votes)
  • sandeepbvnr

    its nice
    develope it soon that suits for any environment

    VA:F [1.9.22_1171]
    Rating: 0.0/5 (0 votes cast)
    VA:F [1.9.22_1171]
    Rating: 0 (from 0 votes)
© 2016 Geeknizer. All rights reserved. XHTML / CSS Valid.
Designed by taranfx.