Slashdot Mirror


Go, Google's New Open Source Programming Language

Many readers are sending in the news about Go, the new programming language Google has released as open source under a BSD license. The official Go site characterizes the language as simple, fast, safe, concurrent, and fun. A video illustrates just how fast compilation is: the entire language, 120K lines, compiles in under 10 sec. on a laptop. Ars Technica's writeup lays the stress on how C-like Go is in its roots, though it has plenty of modern ideas mixed in: "For example, there is a shorthand syntax for variable assignment that supports simple type inference. It also has anonymous function syntax that lets you use real closures. There are some Python-like features too, including array slices and a map type with constructor syntax that looks like Python's dictionary concept. ... One of the distinguishing characteristics of Go is its unusual type system. It eschews some typical object-oriented programming concepts such as inheritance. You can define struct types and then create methods for operating on them. You can also define interfaces, much like you can in Java. In Go, however, you don't manually specify which interface a class implements. ... Parallelism is emphasized in Go's design. The language introduces the concept of 'goroutines' which are executed concurrently. ... The language provides a 'channel' mechanism that can be used to safely pass data in and out of goroutines."

11 of 831 comments (clear)

  1. Attempting to install it... by cptnapalm · · Score: 4, Informative

    Not having much luck. It can't find /etc/passwd, /etc/group or /etc/hosts. All of which do exist. I'm inserting fmt.Fprintf statements to attempt to figure out why it is having problems.

    A novel idea: make people learn Go by requiring them to modify it in order to install it.

  2. Re:Wonder? by michaelmuffin · · Score: 3, Informative

    Does Go have goto statement ?

    why wonder when you can look it up? http://golang.org/doc/go_spec.html

    tl;dr yes, it has goto

  3. Re:Google search "Go" by Animats · · Score: 3, Informative

    It's a small complaint, I'm sure.. but couldn't they have given it a name that you could, you know, Google?

    One could do worse. There was a language called "C+@" developed at Bell Labs. It's derived from C, with classes, dynamism, and safety, much like Java. It predates Java by a few years. Try to find it.

  4. Re:I suppose this is Windows-only once again... by Temporal · · Score: 5, Informative

    Ken Thompson loves Unix

    Loves Unix? Ken Thompson invented Unix. Along with Dennis Ritchie. In 1969.

    So yeah. It would be kind of silly if he created something Windows-only...

  5. "Go" name already taken for programming languages by qw0ntum · · Score: 5, Informative

    This fellow has been working on his own programming language, also called "Go", for a decade. Even released a book about it. He filed an issue in the tracker for the Google language: http://code.google.com/p/go/issues/detail?id=9

    --
    'Every story, if continued long enough, ends in death.' --Ernest Hemingway
  6. Re:Maybe C really is "it" for now... by Toonol · · Score: 3, Informative

    why are we still defining code chunks via brackets instead of the indentation that's already there?

    Because enforcing strict rules about indenting and how it's interpreted is more oppressive and error-prone than using brackets? I agree with your FIRST paragraph...

  7. Re:Maybe C really is "it" for now... by Imagix · · Score: 3, Informative

    For that matter, why are we still defining code chunks via brackets instead of the indentation that's already there?

    Are you insane? Have you ever written a parser? And being dependent on particular whitespace is really asking for trouble. Now, are those tabs or spaces? How many spaces? One of the earlier languages had position dependent coding (code had to start on column 3 or something like that. The name eludes me at the moment).

  8. Re:"Go" name already taken for programming languag by Tim+C · · Score: 3, Informative

    Actually JavaScript being called JavaScript was a hideous decision - even now I read comments from people who think it's something to do with Java.

  9. Re:Holy Shitbags Binaries Are Static And *Huge* by Cthefuture · · Score: 4, Informative

    Uh, so they don't have a dynamic linker yet. Consider this:

    $ cat hello.c
    #include

    int main(int argc, char* argv[])
    {
          printf("Hello, world!");

          return 0;
    }

    $ gcc -O2 -static hello.c

    a.out is 688272 bytes (x64_64 Linux)

    Until they have a dynamic linking system, who knows.

    --
    The ratio of people to cake is too big
  10. Re:Found it... by moosesocks · · Score: 3, Informative

    So in other words, they left every single user of the language to do it, over and over again, because it seemed like a lot of work for the team to do well, once. Sorry, but that just doesn't cut it.

    Um. Did you read the text you just quoted? They didn't say anything of the sort!

    To paraphrse: Go is still a work in progress. It is our opinion that exceptions are computationally inefficient, and interfere with concurrent programming. If we implement something similar, we want to do it right the first time around. We are currently considering various methods of accomplishing this, as well as the impact of not implementing it at all.

    This, to me, sounds like an excellent way to design a programming language. Of course, there is going to be some backlash against any language that questions C's status as the "one true language," although most of the items in Go's feature list seem like they should have blindingly obvious in hindsight.

    Also, consider that C++ doesn't implement strings, and leaves the programmer to do it himself. STRINGS!

    (Go, by comparison acknowledges that a single, good string implementation will work for 99.99999% of programmers, while also doing nice things such as supporting UTF-8 out of the box)

    --
    -- If you try to fail and succeed, which have you done? - Uli's moose
  11. Re:No exceptions? Really? by SlashDotDotDot · · Score: 3, Informative

    Go seems to suffer from the problem of not being done. Case in point: exceptions.

    The authors at least partly agree with you. They describe the absence of exceptions here. They consider it to be an open issue.

    On the other hand, they already provide an alternative to the "finally" block of an exception handler: the defer keyword. I like the looks of this, as it means you can handle all of your closing and locking kinds of issues in a direct pairing with the corresponding open or lock, regardless of whether the function terminates early due to error conditions.

    --
    /...