Go: A New Concurrent Systems Programming Language from Google
Google launched Go, a new systems programming language born with concurrency, simplicity and performance in mind. Do you have time to learn another programming language this year?It is really difficult being a developer. There are a lot of new programming languages trying to bring a silver bullet. They try to simplify concurrency whilst keeping the learning curve as smooth as possible by borrowing syntax from popular existing languages. However, is there a promising future for so many new languages?
Go is open source and its syntax is similar to C, C++ and Python. It uses an expressive language with pointer but no pointer arithmetic. It is type safe and memory safe. However, one of its main goals is to offer the speed and safety of a static language but with the advantages offered by modern dynamic languages. Go also offers methods for any type, closures and run-time reflection. The syntax is pretty clean and it is garbage collected. It is intended to compete with C and C++ as a systems programming language.
What about multicore programming with Go? It promotes lightweight concurrency allowing developers to create sets of lightweight communicating processes. Go calls them goroutines. This way, you can run many concurrent goroutines and you don't need to worry about stack overflows. Go promotes sharing memory by communicating. Goroutines aren't threads, they are functions running in parallel with other goroutines in the same address space. It is very easy to launch parallel functions using the goroutines. This is one of the most interesting features offered by the language. It really simplifies concurrency for systems programming.
Go's key features related to concurrency are:
* Channels of channels.
* Leaky buffers.
* Share by communicating approach.
These features deserve new posts explaining them with more detail. Stay tuned because I'll be adding new posts about Go soon.
The idea behind Go is to offer a fast compiler to produce fast code. So far, it offers two compilers:
* Gccgo (GCC is in the back).
* 8g (x86-32) and 6g (x86-64).
Today, Go went open source and it is a promising systems programming language. The support offered by modern IDEs will be crucial to its early adoption. Its concurrency features are really interesting for systems programming.
If you want to test this new programming language, your starting point is Go's main page
Besides, you can watch the video of a Google Tech Talk for The Go Programming Language, by Rob Pike. Nonetheless, I must warn you that it's a long video