tags:

views:

2665

answers:

6

Seems like Go is designed as a replacement for problems you previously would have solved with C++. Is this an accurate statement? What kind of solutions is Golang (Google Go) designed for?

+9  A: 

From Google's own FAQ on the topic: What is the purpose of the project?:

No major systems language has emerged in over a decade, but over that time the computing landscape has changed tremendously. There are several trends:

  • Computers are enormously quicker but software development is not faster.
  • 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.
  • There is a growing rebellion against cumbersome type systems like those of Java and C++, pushing people towards dynamically typed languages such as Python and JavaScript.
  • Some fundamental concepts such as garbage collection and parallel computation are not well supported by popular systems languages.
  • The emergence of multicore computers has generated worry and confusion.

We believe it's worth trying again with a new language, a concurrent, garbage-collected language with fast compilation. Regarding the points above:

  • It is possible to compile a large Go program in a few seconds on a single computer.
  • Go provides a model for software construction that makes dependency analysis easy and avoids much of the overhead of C-style include files and libraries.
  • Go's type system has no hierarchy, so no time is spent defining the relationships between types. Also, although Go has static types the language attempts to make types feel lighter weight than in typical OO languages.
  • Go is fully garbage-collected and provides fundamental support for concurrent execution and communication.
  • By its design, Go proposes an approach for the construction of system software on multicore machines.
Ben S
They mention C, C++, Java, Python, and JavaScript; that seems a bit broad. The last line implies "system software", but that seems a very odd place in a FAQ to put your goal.
Dean J
+8  A: 

They are targeting projects that can and need a high level of concurrency. Despite their FAQ saying that Google does NOT use this internally you can definitely see that it was influenced by their own needs and desires.

Jason Whitehorn
And probably their own experience copping with such requirements :)
Matthieu M.
+3  A: 

In addition to Ben's answer from Google's FAQ, I believe Go is intended to be a language integrated with Native Client to allow easier development for the upcoming Chrome OS.

Will Eddins
+1  A: 

The Go project was conceived to make it easier to write the kind of servers and other software Google uses internally, but the implementation isn't quite mature enough yet for large-scale production use. While we continue development we are also doing experiments with the language as a candidate server environment. It's getting there. For instance, the server behind http://golang.org is a Go program; in fact it's just the godoc document server running in a production configuration.

Source: The Go FAQ - Is Google using Go internally?

Pascal Thivent
+2  A: 

I think your statement is partially accurate, but one might argue that you would have previously used Erlang for highly concurrent applications such as telephony routers etc. This is what Erlang was developed for by Ericsson. I don't use Erlang and don't know its shortcomings, but there probably are some and this might explain why Google decided to create their own concurrent language.

The fact that Erlang is not mentioned on the Faq page is interesting, and so is the proposition that faster computers should lead to faster software development. It is not my computer that's holding me up :-).

cdonner
I think you hit it on the head there; it's interesting Erlang isn't mentioned in the FAQ.
Dean J
I guess the reason is that Erlang is a very slow language (not statically typed) and was never designed to use concurrency to improve performance. It was designed to structure processes that use complex data flow algorithms. Until not very recently the Erlang programs were running all single threaded with coroutines.
Lothar
Erlang isn't a slow language, of course "slow" is very relative. Also besides the concurrency implementation, Go has nothing to do with Erlang, they are meant to handle totally different tasks. Go is not specialized in building distributed systems, it doesn't even provide node-to-node communication (event the concept of a node isn't present anywhere) so there's a very long road ahead if Go wants to challenge Erlang, which I seriously doubt.
Robert Smith
+9  A: 

I think MarkCC sums it up nicely:

Goroutines and channels provide the best support I've seen outside of Erlang for making use of concurrency. And frankly, I think Go is a lot less ugly than Erlang. (Sorry Erlang fans, but I really don't like Erlong.) Compared to Java, which I think is the main competitor to Go in this area, Go's goroutines and channels are just so much easier to work with than Java threads and locks, there's just absolutely no comparison at all. Go pretty much destroys the competition in this area.

Nemanja Trifunovic