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."

24 of 831 comments (clear)

  1. Sponsored by Inspector Gadget by Yvan256 · · Score: 5, Funny

    Go Go Google Language!

  2. I suppose this is Windows-only once again... by Yvan256 · · Score: 4, Funny

    Go compilers support two operating systems (Linux, Mac OS X) and three instruction sets.

    Can somebody call hell to see if they can host the next Winter Olympics?

    1. Re:I suppose this is Windows-only once again... by u38cg · · Score: 2, Funny

      Fan-boys, creating stuff just because it doesn't exist...

      --
      [FUCK BETA]
  3. Google search "Go" by sshore · · Score: 5, Funny

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

    1. Re:Google search "Go" by TejWC · · Score: 5, Funny

      Perhaps we should abbreviate the "Go Programming Language" to "GPL"? That way, we can google for "GPL" and find Go code all over the place.

    2. Re:Google search "Go" by thePowerOfGrayskull · · Score: 3, Funny

      No, no - "Go Open Source Programming e-Language" ... GOSPeL. That would not only make it easier to find in searches, but the occasional unrelated search result would most assuredly a topic loved by programmers everywhere!

    3. Re:Google search "Go" by Sponge+Bath · · Score: 2, Funny

      "Og", so easy a caveman can use it.

  4. compiled in under 10 sec? by martin-boundary · · Score: 2, Funny

    I don't think so. I have an old Thinkpad 701C laptop which ain't compilin' this in under 10 seconds, if at all.

  5. Named after the most difficult-to-master game ever by Culture20 · · Score: 4, Funny

    This bodes well.

  6. Intolerable by Anonymous Coward · · Score: 1, Funny

    I don't like how this language uses "func" instead of "function", therefore this language is terrible and everyone who uses it or thinks about it in any way except for about it sucking is also terrible.

  7. Instant Language Build-O-Matic by Tablizer · · Score: 4, Funny

    Joy, yet another programming language :-) Programming languages are personal. We all have our favorite way to do things and most of the choices are subjective preferences. At c2.com we played around with the idea of a Build-To-Order form to generate a compiler/interpreter for a language with the combination of features you ask for. Below is a rough re-creation of the form:

    -----INSTANT CUSTOM LANGUAGE FORM-----

    (Features in each group are mutually-exclusive if they have round brackets, but not if square brackets. )

    Compile Level

    * (__) Compiled: product of language targeted to direct run by a machine (possibly a virtual machine) or operating system.
    * (__) Interpreted: language is processed as data by a process called an interpreter, especially in some sort of ReadEvalPrintLoop. May support a hidden JustInTimeCompilation, but that should be considered an implementation detail rather than a language detail.
    * (__) Both but select on Program: language allows programs to be written for scripting or written for compilation, but programs written for compilation might not work for interpretation (e.g. due to late-binding dependencies) and programs written for interpretation might not work for compilation (e.g. due to top-level commands). This provides a lot of flexibility. However, it also partitions the user community because sharing will be difficult.
    * (__) Both for any Program: language ensures that every program is suitable for both compilation and interpretation. Supporting interpretation requires abandoning a model of external linking and requires ensuring the syntax is suitable for one-pass reading (i.e. preprocessors are a bad thing). Suitability for compilation implies abandoning (or at least distinguishing) imperative commands at the toplevel: those that are to be executed at compile-time vs. those that are to be executed at runtime.

    Model for Linking and Modularity

    * (__) No Linking: product is always fully declared from a single page or file. No linking occurs. There is no model for modularity. Many EsotericProgrammingLanguages have this model. Support for CompileTimeResolution may provide an interesting workaround.
    * (__) Includes: product may 'include' other pages, which are linked in place. There might be a system to selectively avoid duplicate includes. All pages are effectively parsed with each compile or execution.
    * (__) Single Page, Modular: language semantics allow 'importing' or 'loading' of other components. Allows useful optimizations such as compilation of components... or at least preprocessing and pre-parsing, of language components, because the semantics of the 'import' are held independent of the page into which it was imported.
    * (__) External Linking: a linker can combine a product by pulling multiple components together, but does so from outside the language. This model is incompatible with interpretation, and offers no real benefits over the 'Single Page, Modular' model except that it can be hacked into a language that doesn't have a concept of modularity (as was done for CeeLanguage).

    Modularity and Linkage Features

    * [__] Resolution of Circular Dependencies: the language or linker will correctly handle circular dependencies, ideally with minimal reliance on forward declarations.
    * [__] Provisionals and Overrides: the language allows you to override global objects, values, or procedure that are declared in other modules in a manner such that those other modules use the overrides, too. Ideal form would be as though they had always used the override, but this ideal form is somewhat difficult to reconcile this feature with interpretation.
    * [__] Inverted Constructs: one can automatically bui

  8. Re:Wonder? by Anonymous Coward · · Score: 1, Funny

    But disappointingly, they went with the well-worn keyword "goto" instead of following Common Lisp and calling the statement simply "go".

  9. Re:Wonder? by Anonymous Coward · · Score: 1, Funny

    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

    It doesn't have comefrom though. Words alone cannot express my disappointment.

  10. Re:"Systems" language? by ClosedSource · · Score: 3, Funny

    "Neither Ada nor the Modula family had it, and those languages have been run on bare machines with no other OS underneath"

    Or customers above either.

  11. Re:Build-in function library by larry+bagina · · Score: 2, Funny

    I guess you've never used PHP.

    --
    Do you even lift?

    These aren't the 'roids you're looking for.

  12. Re:Not actually safe by thePowerOfGrayskull · · Score: 4, Funny

    You're pretty bold giving MS any credit here. This is the home of the Google fanboi, for reasons I don't understand other than some people hope Google will take down Microsoft.

    I'm an AC because of companies like google.

    The most common five reasons for AC posting:

    • Too lazy to register
    • You have an account and overestimate how many people care about what you post;
    • You have an account and overestimate the importance of your slashdot karma score as pertains to real life.
    • You're a spy
    • You're cowboyneal
  13. gofmt by CharlyFoxtrot · · Score: 5, Funny

    From Golanf.org : "With Go we take an unusual approach and let the machine take care of most formatting issues. A program, gofmt, reads a Go program and emits the source in a standard style of indentation and vertical alignment, retaining and if necessary reformatting comments. [...] We use tabs for indentation and gofmt emits them by default. Use spaces only if you must."

    Of course you realize ... this means war.

    --
    If all else fails, immortality can always be assured by spectacular error.
    1. Re:gofmt by hattig · · Score: 1, Funny

      Okay, this language is dead in the water, and dead to me.

      Tabs are evil. Spaces are the one true way.

  14. Re:Named after the most difficult-to-master game e by mr_gorkajuice · · Score: 2, Funny

    I wonder if the chinese name for the programming language will be Weiqi, just to screw us over.

  15. Re:Who programs on Windows, anyway? by Anonymous Coward · · Score: 1, Funny

    Botnet authors?

  16. Re:Named after the most difficult-to-master game e by glwtta · · Score: 5, Funny

    I think they just chose the name so they can use their page numbering convention for future versions:

    version 2: Goo
    version 3: Gooo
    etc.

    I will probably mature around the time Goooooo comes out - can't wait to use it!

    --
    sic transit gloria mundi
  17. Re:Do *not* optimize for readability (do a tradeof by iris-n · · Score: 3, Funny

    Bad example. "len" was chosen to stop people typing "lenght", not to be shorter.

    --
    entropy happens
  18. Re:"Go" name already taken for programming languag by LaminatorX · · Score: 4, Funny

    Two "Go"s considered harmful.

  19. But the real question is... by SarekOfVulcan · · Score: 2, Funny

    Has anyone implemented Go in Go yet?