Go, Google's New Open Source Programming Language 831
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."
Sponsored by Inspector Gadget (Score:5, Funny)
I suppose this is Windows-only once again... (Score:5, Funny)
Can somebody call hell to see if they can host the next Winter Olympics?
Google search "Go" (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?
Re:Google search "Go" (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.
compiled in under 10 sec? (Score:3, Funny)
Named after the most difficult-to-master game ever (Score:5, Funny)
Intolerable (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.
Instant Language Build-O-Matic (Score:5, 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
Re:Wonder? (Score:1, Funny)
But disappointingly, they went with the well-worn keyword "goto" instead of following Common Lisp and calling the statement simply "go".
Re:Wonder? (Score:1, Funny)
Does Go have goto statement ?
why wonder when you can look it up? http://golang.org/doc/go_spec.html [golang.org]
tl;dr yes, it has goto
It doesn't have comefrom though. Words alone cannot express my disappointment.
Re:"Systems" language? (Score:4, 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.
Re:Build-in function library (Score:2, Funny)
Re:Google search "Go" (Score:4, Funny)
Re:Not actually safe (Score:5, 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:
gofmt (Score:5, Funny)
From Golanf.org [golang.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.
Re:Named after the most difficult-to-master game e (Score:2, Funny)
Re:I suppose this is Windows-only once again... (Score:3, Funny)
Re:Who programs on Windows, anyway? (Score:1, Funny)
Botnet authors?
Re:Named after the most difficult-to-master game e (Score:5, Funny)
version 2: Goo
version 3: Gooo
etc.
I will probably mature around the time Goooooo comes out - can't wait to use it!
Re:Do *not* optimize for readability (do a tradeof (Score:4, Funny)
Bad example. "len" was chosen to stop people typing "lenght", not to be shorter.
Re:Google search "Go" (Score:3, Funny)
"Og", so easy a caveman can use it.
Re:"Go" name already taken for programming languag (Score:5, Funny)
Two "Go"s considered harmful.
Re:gofmt (Score:1, Funny)
Okay, this language is dead in the water, and dead to me.
Tabs are evil. Spaces are the one true way.
But the real question is... (Score:2, Funny)
Has anyone implemented Go [wikipedia.org] in Go yet?