If history is anything to go by it seems inevitable1 that a new language will dominate the next decade. A new language will also need to solve problems that matter to this expanded world and that the existing languages will be slow to provide (or find impossible to provide). Could that new language be Go?
What is Go?
Go has been in development at Google since 2007 and as an open source project since 2009.
Compared to most languages in use today, Go was designed with many programmers, concurrent systems, and large-scale problems in mind. Some languages, like C, were simply not designed at a time where multi-core and multiprocessor systems were in broad deployment. Some languages, like Python, weren’t originally intended to scale well onto multiple cores and have been slow to adopt strategies for utilizing such resources. Many languages to this day don’t have networking libraries which work predictably and have a clean, understandable API. Programs written in many languages, especially those with operator overloading, require in-depth knowledge of both the architecture of the program itself and the libraries in use in order to be able to understand the code well. Go attempts to address all of these problems and more; in my opinion, it does so brilliantly.3
Google researchers4 designed the Go programming language that helped them solve the problems they had:
- software needs to be built quickly,
- the language should: run well on modern multi-core hardware, work well in a networked environment, and be a pleasure to use.
Go, is a language that has the feel of a dynamic language like Python or Ruby, but has the performance and safety of languages like C or Java.
Python and Ruby programmers come to Go because they don’t have to surrender much expressiveness, but gain performance and get to play with concurrency.5
Organizations using Go
Since May 2010, Go is used in production at Google for the back-end infrastructure, e.g. writing programs for administering complex environments. Google wants to invest in it and the language is production-worthy.
The First Ever Go Conference is being held in Denver CO, USA this April and their sponsors list has some interesting company names like Ubuntu, Paypal, Apcera, Stripe, Poptip, Canonical, Iron.io amongst many others.
I will be representing my company Josh Software at the conference.
Success Stories with Go
The Go success stories from around the web makes an interesting read too.
Why learn Go?
For me to invest the time to learn a new language, it must affirm at least one of these two questions:
- Is this a language I could realistically use in a production environment?
- Will this language grow my ability to solve complex problems in different ways?
After watching the Google IO videos, the answer to both of these questions appeared to be yes.
What’s been surprising about Go is how much complexity and cruft has been stripped away from C and C++, yet their fundamental structures still remain in Go. Ideas such as generics, polymorhpism and object orientation have been reduced to their most simple primitives in Go. Go is so minimal and feels so well thought out, that I marvel at how much I’m able to accomplish with such a small syntax and relatively few language features. Go is clearly a labor of love, with decades of well thought out language design baked right to its core.6
Some of Go Features
Here is a quick overview of some of the language capabilities:
- Concurrency7 baked right into the language with channels and goroutines.
- Open source, but with corporate backing (read “Google” and not going away anytime soon)
- Cross platform AND cross processor
- Native compiles with no runtime installation required (a huge win)
- Ultra-fast compilation speeds–even faster than JIT-based languages
- Speed of a compiled language, but feel of an interpreted language
- A built-in package management system
- C-based syntax (pros/cons here for different people)
- Strong typing and duck typing at the same time
- Synchronous, yet non-blocking IO using goroutines
We’ve found the community to be vibrant, active, and growing quickly. The number of libraries available to perform various tasks continues to grow at a rapid pace. Sure, it’s nowhere near the size of other mature languages, but it’s not a minefield of abandonware either.8
Go as a first language
This article makes the case for “Go as a first language” due to:
- Language simplicity: Go is not just free of cruft, it is also very well designed.
- Standard library: Go comes with well designed APIs for many of today’s requirements: HTTP server and client, JSON, Unicode, Cryptography, HTML and plain text template engine. If you are making a web application that does not need a database, the standard library has you covered.
- Formatting and coding style: In Go, this is a non-topic. The only acceptable formatting is the one generated by the
go fmtcommand. The compiler knows no warnings, there are either errors or no messages.
- Distributing binaries: Go generates stand alone binaries.
- Documentation: Everything about Go feels thought out and well made.
Uses of the language
- can be used for systems programming
- is a good fit for game server development
- can be used for Complex event processing
- is also a general programming language, useful for solving text-processing
problems, making frontends, or even scripting-like applications
However, Go is not suited for real-time software because of its garbage collection and automatic memory allocation.
Apple owns Objective-C. Microsoft owns C#. Google obviously does not own Java, which is a shame because they had their chance when Sun was heading toward bankruptcy and they missed it. If Google makes the switch from Java to Go for Android then Android developers will have to learn Go. In the long run it definitely sounds like something that would be ideal for Google since they’d have full control over what happens with the language. Since it’s such a friendly language they might even get developers to be interested in learning it, just like the vast majority of iOS developers had to learn Objective-C to make iOS apps.9
Go and Cloud Computing
Java is an amazing language but it predates the cloud. It is much easier to build and deploy high performance applications in virtual environments in Go.
Derek Collison (CEO, Apcera and former architect/technical director at Tibco, Google, and VMware) is also a big proponent and believer that Go will take over the core of the cloud computing infrastructure.
If Go could replace Java for cloud computing, what would that do to Oracle? It would remove a lot of connection to Oracle from companies in the cloud space and would ignite a whole new set of innovation based around Go libraries, frameworks, platforms and services. The lock-in that Java has within the enterprise would also dissipate as companies moved core areas of development to Go.10
The coming decade
So does the next decade belong to Go? Your guess is as good as mine!
- In the 1970s, Fortran and Cobol where champions. In the 1980s, we had Pascal and C. In the 1990s, Basic and C++. In the 2000s, Java and C#. In the 2010s we have Ruby and Pascal Python. Why would the years to come be any different? ↩
- Mark Summerfield in his book “Programming in Go: Creating Applications for the 21st Century” ↩
- Kyle Lemons blog post “Go: A New Language for a New Year” ↩
- Balbaert Ivo in his book “The Way to Go: A Thorough Introduction to the Go Programming Language” ↩
- Rob Pike in his article – “Less is exponentially more” ↩
- Blake Smith in his article – “Why You Should Learn to Program in Go” ↩
- Multicore is the future so I like that Go has concurrency built right into the core. ↩
- Jonathan Oliver in his article – “Why I Love Go” ↩
- Lucian Armasu in his article – “Will Android switch from Java to Go?” ↩
- Julie Bort in her article – “Google Has Created A Programming Language That Thumbs Its Nose At Oracle” ↩