Google’s Go: A New Programming Language That’s Python Meets C++
by Jason Kincaid on November 10, 2009

Big news for developers out there: Google has just announced the release of a new, open sourced programming language called Go. The company says that Go is experimental, and that it combines the performance and security benefits associated with using a compiled language like C++ with the speed of a dynamic language like Python. Go’s official mascot is Gordon the gopher, seen here.

Here’s how Google describes Go in its blog post:

Go attempts to combine the development speed of working in a dynamic language like Python with the performance and safety of a compiled language like C or C++. In our experiments with Go to date, typical builds feel instantaneous; even large binaries compile in just a few seconds. And the compiled code runs close to the speed of C. Go is designed to let you move fast.

We’re hoping Go turns out to be a great language for systems programming with support for multi-processing and a fresh and lightweight take on object-oriented design, with some cool features like true closures and reflection.

For more details check out Golang.org.

To get things started the right way, here’s Go’s rendition of Hello World!:

05 package main

07 import fmt “fmt” // Package implementing formatted I/O.

09 func main() {
10 fmt.Printf(”Hello, world; or Καλημέρα κόσμε; or こんにちは 世界n”);
11 }



Advertisement

Responses

Comments rss icon

  • i won’t use this. i’ll stick w/ c++, thank you.

    • This isn’t a C++ replacement.

      Google is targeting Javascript.

    • why is the compiler named ‘6g’?

      and why do we need another language?

      • To do more justice to the improved hardwares with much efficient concurrent processing abilities…

      • It’s a plan9 convention

      • From golang.org,

        Go compilers support two operating systems (Linux, Mac OS X) and three instruction sets. The versions for Linux and Mac are equally capable except that the ARM port does not run on OS X (yet).

        There are important differences in the quality of the compilers for the different architectures.

        amd64 (a.k.a. x86-64); 6g,6l,6c,6a
        The most mature implementation. The compiler has an effective optimizer (registerizer) and generates good code (although gccgo can do noticeably better sometimes).
        386 (a.k.a. x86 or x86-32); 8g,8l,8c,8a
        Comparable to the amd64 port. Not as well soaked but should be nearly as solid.
        arm (a.k.a. ARM); 5g,5l,5c,5a
        It’s got a couple of outstanding bugs but is improving. Tested against QEMU and an android phone.
        Except for things like low-level operating system interface code, the runtime support is the same in all ports and includes a mark-and-sweep garbage collector (a fancier one is in the works), efficient array and string slicing, support for segmented stacks, and a strong goroutine implementation.

        See the separate gccgo document for details about that compiler and environment.

  • A language that is supposed to look like Python but with C++ curly braces.

    An interesting combination, a failure result.

  • i won’t use this. i’ll stick w/ python, thank you.

  • i won’t use this. i’ll stick w/ Lisp, thank you.

  • It was meant to say:

    I won’t use this. I’ll stick w/ [crap language], thank you.

  • Very smart: “I won’t use this, I stick with XY”. Different programming languages are usually for different problems / tasks. Let’s wait and see what Go will be able to be good at.

    • If TechCrunch had Slashdot-style moderation, I wouldn’t have had to read a bunch of dumb comments about syntax before I got to this one. :)

      If Go makes concurrent programming easier and is close to as fast as C, then it will be a welcome addition to the world of computer languages, no matter what the syntax looks like.

  • That’s not Gordon the gopher?! This is Gordon the gopher! http://en.wikip...rdon_the_Gopher

  • I won’t use this, ill stick to BASIC.

  • How does this work as a first programming language?

    • The syntax looks more like Javascript / Python than C / C++.

      • In which case it could be a great beginning language. I don’t think there is anything better than Python for beginning. Simple syntax, minimal/no declarations or pointers, but the ability to learn object oriented design once the basics are down.

        If they offer an interpreter with it (one of the things that makes learning Python so easy – instant trial and error) I think it could be a good tool.

        I don’t see it replacing C/C++. C/C++ hauls ass because it doesn’t do much for you. By virtue of dumbing down syntax, they are implying that it does more of the work behind the scenes and therefore can’t really be fast.

        May serve well as another scripting language though – not that we necessarily need one, but Java and Python both have their faults.

        • And what faults does Python have? That’s what I thought.

          • Lack of TCO, forces a distinction between functions and data, crippled reflection/metaprogramming capabilities, etc.?

          • The fact that it’s slower than some languages is a well known fault. Doesn’t mean it doesn’t have it’s place or that there’s anything wrong with it for what it’s usually used for, but it’s not perfect.

            Don’t need to act so so defensive. If a language as easy to use as Python came along with the speed of C/C++, would you not want to use it?

            The biggest problem with Python is simply that often times it’s used to test concepts and then needs to be rewritten/ported to a faster language. In a perfect world, or with a perfect language, that wouldn’t be necessary.

            It remains my favorite to write in. Don’t be such a know-it-all ass.

  • And google will start pushing this to developers as it does with its other products, resulting in use of another programming language while there are already seas of programming languages out there.

    And IMO programming languages aren’t a part of IT where diversity is a positive thing. When you learn one and you want to switch platforms and write native executables, you can learn a new programming language, the same when you’re switching jobs.

    But then again, is there one IT-related thing that Google can keep its hands of?

  • Being able to continue using xcode is win! :D

    • That was the OS X Terminal, not Xcode.

      I saw a Makefile, so it seems they are choosing a more open format to distribute. Where the hell you managed to get Xcode from the video is beyond me. If you managed to read the line, “On OS X, they can be installed as part of Xcode”, that is referring to the requirement of GCC, the c stdlib, and Bison… which Xcode is not a part of, but is the only source of those tools and files.

  • I think this is more of a move to get google employees using their python skills on chrome os.

    If they could bring this to android then I would use it.

  • not that interesting. if i’m going to give up c/c++ with their huge communities and mature tools, it has to be for something like haskell that allows me to make a big conceptual leap

  • Cool. Would love to get my hands dirty with this baby :) .

  • i won’t use this. i’ll stick w/ Ruby, thank you.

  • Shoot — based on the headline, I was hoping this would be programming by moving small black and white stones

  • Ok Why a new language, and why its a good news for developers (at least who spent enough time mastering current languages they know).
    I don’t know what Googles is after , they want every thing to be labeled Google .
    So with their new language we are going to start again from level 0 (learning the language) ,just because Google says so, and yeah i feel this will be the official language for writing code that will run on Chrome OS.

    • Why is everyone so against learning new languages? I mean most of us only code in 1 or 2 languages (java/.net) and have a 3rd for quick stuff (ruby/python/name your dynamic language here).

      But outside of quirky syntax most languages are pretty much the same. Shouldn’t be hard to pick this one up.

      • Speak for yourself, i program in about 15 languages, maybe more, just need to see them again. I am just at the point in my tech life where learning a new language is about purpose and function and not code obsession.

        I don’t see a point here. 10 yeas ago, i would have learned it then asked myself why the hell i did.

        • I have two programming language types.

          1. Compiled Language: C#, Java
          2. Scripting Language: PHP , Javascript

          So, I use four. If I have a problem, I can easily work it out in javascript, because you don’t need a big library or some clustering IDE. All you need is a browser, and with today’s browsers, you can pretty much do anything with javascript.

      • “I mean most of us only code in 1 or 2 languages (java/.net) and have a 3rd for quick stuff (ruby/python/name your dynamic language here).”

        Most of us? Well I’m full time PHP, my best friend is full time RUBY. I got another friend with Python. We don’t really mess with java, .net.

        It would be better if you said, “… most of web developers only code in PHP/Ruby/Python …” because that GO will target most likely web dev.

        But hey, I’ll stick with my PHP

        • Well my list of examples of the 1 or 2 languages could have been longer, but my point still stands. Most developers only code in a couple of languages for their job. And then use a few more for experimental development on the side.

    • Heard of multi-core processors?

      There’s lots of new multi-core processors and not a great deal of research up to this point on how to make them run at peak efficiency.

    • Because programmers don’t care whether they “master” languages (which I, personally think, is a laughable concept). Programmers are programmers – they are passionate about programming and a new toy to play with, in this sense, Google Go is like an early Christmas present to us.

      So sick of the “Rockstar developers” these days with their hard-ons for one specific language. Ruby (or Python or C++ or Lua, et. al.) is not the answer to everyone’s problems.

      I would never hire a “programmer” that bitches about a new language being released, or has no passion or curiosity in regards to that new language.

      • That’s my opinion 100%!

      • Programming languages are just tools to be used where appropriate. To many programmers get stuck into one language and try to use it everywhere. C++ is a powerful language but also has a number of problems, especially in the field of safety critical programming. Go answers a number of these problems effectively.

        I would not think of using it for most applications, but if faced with having to write a safety critical application or server I would certainly look at it. Though I think it probably needs another two years development before it becomes really usable. I’m definately going to get down to studying it and making sure I know when it will be useful and when to avoid it.

    • picking up languages is easy, its all the same shit in the end.

  • They are positioning themselves to capture business from the enterprise market who are too afraid to move to languages like Ruby and Python because of existing infrastructure.

    They will promise enterprise cloud systems (App Engine) and then give them a language that makes development easy and fast (Go).

    I believe it will be a pretty smart move, just wondering what the web framework will be like.

  • Umm….Google’s cool and all…but I can’t see their language getting any more popular than say Ruby on Rails…if that. And if their goal is to replace JavaScript…um, good luck. O_o

  • You got C++ in my Python.. No, you got Python in my C++!

    Hate to say but, I was expecting something better from Google.

  • Is it just me, or does ‘Gordon the gopher’ remind you of ‘Glenda the bunny?’

    http://plan9.be...an9/glenda.html

  • i won’t use this. i’ll stick w/ Pascal, thank you.

  • How about a contextual lock free multi-thread language?
    Human language is contextual, yet we program our systems specially in search or information processing like a calculator.
    Lame.

  • I’m not sure I need this….

    On the other hand, I could use more accurate Google Voice transcription, please and thank you.

  • Just because Google does something it makes the world look. I read the docs, i get the feel. I come away only with this feeling of why/WTF?

    There is NOTHING exciting about this, nothing amazing, nothing. Its some back burner project form google that may end up getting a few geeks with way too much time on their hands to play with it.

    But all in all, WTF!?

    I am an old UNIX guy from early 90s and now play with all tools form UNIX to Microsoft .NET

    I have to say that .NET is perhaps the most amazing thing to come around in the programming world in a very very long time but its Microsoft so the heaters will not let it take off the way it should.

    I prefer to think of .NET as a product of Anders Hejlsberg so I can love it.

    This. is um, something i think my nephew may create in is second year in college and i would be mildly impressed with him.

    I’ll stick to programming.

    • “I have to say that .NET is perhaps the most amazing thing to come around in the programming world in a very very long time but its Microsoft so the heaters will not let it take off the way it should.”

      .NET has already taken off. What makes you think it hasn’t? However, unless Microsoft releases .NET for Linux, you definitely won’t see it spread any wider on the server-side, and thus most of what you see in general use will remain LAMP.

      • Microsoft is not responsible for Linux makers to implement .NET, they have shunned it.

        I guess the monoproject was not enough.

        it is an issue of developera demand. I am one of those developers who was hardcore Linux until I seen what Anders Hejlsberg did when he left Borland. If its good, its good. But Linux Developer have become more of a cult then a logical free thinking programming group.

        • Yea, and those of us who run large numbers of servers are not obligated to pay millions of dollars straight off our margins for Windows. I guess that would be cultish logic though.

        • You should give the mono project another look its come a long way and I completely agree with you about the Linux developer community.

        • C# is terrible language, when compared to C++ or Haskell or Ruby, and .Net is a nightmare (write once – expect problems everywhere)

      • I think you are mistaken.
        I am working for a consulting company and all the projects that we receive are .Net.
        I was very surprised that we didn’t get a single Java project !!!

        .Net/C# is just an amazing technology.

        I didn’t see anything compelling in Go.
        I think I will let it Go :) :)

    • C#/.Net are really popular and truely amazing language/platform.

  • It only seems right that Google introduce an extention on to programming languages.

    They seem to be very serious about providing an open source mirror to Microsoft.

  • Man, Google comes up with some really misleading product names/characters…. Come on, Go? Really? With a Gopher mascot? I dont know when to take them seriously. I mean….. I had to check the calendar on my mac to make sure it wasn’t april 1st. Being that I’m pretty high right now, I’d say Google, you should be using your younger marketing/pr geniuses to come up with product names and pitches and so all your products stop looking like a big joke.

  • It’s like crap meets crap

  • WTF? The Gopher cartoon looks like my 5 year old drew it. Billions of $ and this is the best Google can come up with?

    Oh, and I’ll stick with PHP.

  • If you need a better language go with F#, it is a functional language from he oCaml family, and already released, accesses the huge .net class library and type safe and has an interactive console.

  • Can I clarify with simple question: does Go really belong to Google? I checked the website and it doesn’t have ‘Google’. I googled ‘golang’ and found nothing indicating that the new programming language is from Google. I know it’s still in Beta version, but at least if it’s still in the early development, we can look at ‘Google’ logo.

  • “The company says that Go is experimental, and that it combines the performance and security benefits associated with using a compiled language like C++ with the speed of a dynamic language like Python”

    If think you got those benefits backward.

    Compiled languages are generally faster than dynamic ones and C++ is as insecure as languages come.

  • A solution looking for a problem to solve. Fail.

  • it is a very weird mix,
    Python + the worse of C (Pointers + Curly Braces)

    NO CHANCE

  • Good, Google, good.

    I definitely like the mascot, Gordon the gopher.

  • Typically informed TechCrunch comments. The very first page says “a systems programming language”. They’re not trying to replace JavaScript or PHP, or .NET. Those are not systems programming languages.

  • can anyone tell why is it
    var a int;
    instead of
    int a ?
    And
    for i = 0; i < 10; i++
    instead of
    for(i = 0; i < 10; i++)

    What is the use of doing something like this?
    Where is the novelty?

    • var a int; is easier to write a parser for.

      for without () is um… cleaner(?)

      • for without () is cleaner… except when they require curly braces for blocks. I think they got that one backwards.

        I can read python just fine with the lack of curly braces that visually segment a block, but a set of conditionals can get eerily confusing without the visual segmentation from the rest of the code.

      • var a int for the average typist to type 3 secs. For a C Parser maybe a millionth of a second

      • Come on! You can’t be serious right?
        It is the same rule for a parser, just swapping the terms…It does not have any extra advantage.

        It is just a fancy syntax to try to be distinct

        • Say you’re looking at some code that uses a variable called xyz. You want to know what xyz is, so you scan up to the section where variables are declared and see:

          SomeClass abc = new SomeClass();
          AnotherOne m;
          SomeOtherClass xyz = someRandomFunction();
          ClassX qwerty;

          vs

          var abc = SomeClass.new();
          var m AnotherOne;
          var xyz = someRandomFunction();
          var qwerty ClassX;

          Which syntax makes it easier to find xyz?

    • to distinguish it from functions which in javascript get all confused together because javascript functions are variables? idk

  • This is nothing but a sadly lacking implementation of D ( http://digitalmars.com/d ) mixed with continuations syntax as in JWACS ( http://chumsley.org/jwacs/ ). Next.

  • hey people, take a breath and actually look deeper. this language was partially created by Rob Pike and Ken Thompson, you know those guys who invented c??? could potentially be very exciting. have you checked out those build speeds? amazing. systems level programming – pointer arithmetic = awesome.

    http://www.yout...h?v=rKnDgT73v8s

  • I won’t use this, I’ll stick with a magnetic needle and a steady hand, thank you.

    http://xkcd.com/378/

  • Really, “fmt” stands for formated I/O.

    I don’t get why we need 3 letter acronyms in modern programming languages.

    • Check out long codes in Java. Personally I like acronyms that’s clearly better readability.

      Please add lang features that encompass everything as much as you can! :D

    • Because programmers can’t spell. “Formatted.” Dude.

    • You’re absolutely correct and this kind of naming scheme eventually leads to incomprehensible and therefore often incorrect code that even the original developer is unsure about after 6 months!!! Code should be written for humans first and machines second. The compiler could give a flip anyway its just going to translate it down to machine code so please look out for those who would care your fellow developers. This Public Service Announcement is brought to you by Developers Against WTF Code.

  • we don’t need a new language, we have much more than enough programming languages there. Why these people like to waste their time on creating useless language rather than do useful/meaningful things,.

  • Anything that kills off python is a win. Python has ruined more first year CS students than BASIC ever did. Dykstra said that “BASIC programmers were poisoned for life, doomed by the resulting brain rot.” That is nothing compared to the damage python has done.

    • Interesting. I’m a first-year CS student. I taught myself Python in the 7th grade, and I’ve been using it ever since — and my experience with that language has put me miles ahead of my peers in my coursework in java and even assembly. I don’t feel particularly ruined.

    • I am curious why you think that? I happen to disagree, but not fervently.

      Our campus teaches an ‘into to computer science’ class for non-majors that are interested in CS but know nothing about it at all. I think that it’s a great language for use like that. It allows the teaching of concepts rather than syntax.

      Admittedly, some students might find it a leap to go from there more intensive languages, but in a 3 unit one-quarter class it brings with it some decent basics on operators, booleans…etc.

      I guess that could be done with any language that offers automated memory management and relatively simplistic syntax, but the readability of python really lends itself to that use.

      Granted, that is about where our University ends its use. CS/CSE majors will start off in C/C++ for their first year, which I think is fitting. I am, however, open to hearing alternative opinions.

    • I think PHP has done far more damage than even Visual Basic to the programming community. No scoping rules, so a variable I declare deep within a nested loop is accessible outside the block, violates the fundamental principles of nearly every other language.

    • MIT is replacing Scheme with Python…

  • dorks. quit fighting and fix my laptop.

  • Safety is different from Security. What google means with safety is static typing. Actually, C++, as a lot of native languages, is prone to a lot of security exploit. The most popular are buffer overflows.
    Language like C# and Java are much more secure by their nature (compiled to msil/byte-code and managed by a virtual machine that can enforce a much more strict security policies).

  • Are you sure this is real and from Google? It doesnt show Google anywhere and the domain name golang.org doesn’t seem to be registered to Google.

  • The line I think is interesting is this one:
    “The versions for Linux and Mac are equally capable except that the ARM port does not run on OS X (yet).”

    Since when does OSX run on ARM?
    Anybody heard tablet? :P

  • ugly mascot

    prefer C#, Java, Ruby, PHP

Leave Comment

Commenting Options

Enter your personal information to the left, or sign in with your Facebook account by clicking the button below.

Alternatively, you can create an avatar that will appear whenever you leave a comment on a Gravatar-enabled blog.

Trackback URL
Short URL
bugbugbugbug
Techcrunch on Facebook