With its promise of speed, simplicity and scalability, Google-backed programming language Go is increasingly being talked about as a potential rival to more widely used languages.
It clearly has a long way to go to reach the ubiquity of the likes of Java, which is hugely popular in everything from enterprise applications to mobile apps. But, along with its use in a number of innovative projects such as enterprise tech startup Docker and cloud computing platform Cloud Foundry, more and more businesses are coding with Go.
One such firm is UK startup bank Mondo. It is is using the language across its operations, including to build its banking ledger system.
Mondo’s chief technology officer Matt Heath says Go could rival Java in future by combining both high performance and fast development speed.
“I see Go as the perfect middle ground between existing dynamic and compiled languages,” Heath says,
“It’s compiled, so has extremely good performance, but is memory managed and compiles in seconds. However, it retains the development speed that dynamic languages usually provide, which is essential in extremely competitive markets.”
Compared specifically to Java, he adds, Go “compiles to small statically linked binaries” which can run directly on a server with no dependencies – rather than having to be executed on the JVM “within a servlet container”.
It’s also simple to use. “Most tasks can be accomplished with just the standard library – and with language features such as goroutines and channels, concurrency is built into the language as a first-class citizen,” he says.
“Together I think these features make Go the perfect language for high volume distributed systems.”
What is Google's Go?
Go was created in 2007 at Google by Robert Griesemer, Rob Pike, and Ken Thompson as an experimental project, before being launched more widely two years later.
Its creators said that one of the drivers for Go was to create a language that is “fast, productive and, most importantly, fun”.
“Go combines the development speed of working in a dynamic language like Python with the performance and safety of a compiled language like C or C++,” Google said when it launched the language.
“Typical builds feel instantaneous; even large binaries compile in just a few seconds. And the compiled code runs close to the speed of C. Go lets you move fast.”
The language - which is one of a number of languages developed by large tech firms in recent years, including Facebook and Apple - is now on version 1.5, with its sixth significant stable release in August.
As it has begun to grow in prominence, the platform has matured and new features have been added.
For example, the golang community announced at the end of last year that it would be possible to develop Android apps using Go code only, which could attract further interest and open new possibilities - particularly as most Android software has been written in Java so far.
Adoption has not always been strong, however, at least after initial interest. But, despite some criticism of Go, usage is continuing to gather pace in recent years, says Stephen O’Grady, principal analyst and co-founder of RedMonk.
He says that Go’s inclusion in some high profile projects such as Docker and Cloud Foundry has helped spur more “mainstream” usage.
O’Grady said: “Go is benefitting from a virtuous cycle in which its usage amongst high profile projects is attracting more developers to the community, which results in more high profile project usage and so on.”
Google's Go: Wider adoption
A range of more typical organisations - as much as any can be described in such terms - are now using Go, alongside the web-firms such as Facebook, Twitter, SoundCloud, Dropbox and, of course, Google, which has remained fairly tight-lipped on its internally applications of Go.
Another business using Go in its operations is online travel firm Booking.com. Senior developer, Damian Gryski, says the company has been using Go since 2013 to help scale its real-time monitoring infrastructure.
The language is particularly suited to writing networked services, says Gryski, as well as other parts of its operations where Perl is not appropriate.
“I see Go continuing to grow, especially as companies move away from monolithic systems into services where the actual language is less important than the standard interfaces it can communicate with,” he says.
Adopting a new programming has its challenges though.
“That being said, introducing a new technology is always more work than just writing the initial code. There's a lot of inertia in companies, both technical and cultural, that needs to be overcome, and it's not always clear that such a change is worth the cost.”
Getting to grips with Go
Mondo’s Heath adds that there are some hurdles to overcome for those adopting a language that is still maturing. “While we love Go at Mondo there are of course some minor problems, mainly due to the language being comparatively young,” he says.
“While Go itself and its standard library are solid, the ecosystem around the language is still developing, so some third-party libraries are immature.
“This means we have had to fix bugs or write our own libraries, which is complicated if these are low level database drivers (for example), and a distraction from our core business.
“Also historically dependency management has been a problem, however tools like Godep and GB are turning this around.”
But as the open source community continues to address some of these issues, it is likely that Go will continue to win over more users.
Case study: How Mondo is building a 21st century bank using Go
Startup bank Mondo decided to build its entire banking platform in-house, from scratch, in just a few months.
In order to rival the incumbent UK lenders - and their multi-billion pound IT budgets - Mondo has invested in building a modern bank instructure from scratch. This has involved using a range of new technologies that the startup hopes will provide greater agility to meet customer needs, whether creating new mobile services or jumping on emerging trends such as wearables.
For instance it has meant adopting a microservice architecture and looking to open source tools such as Apache Mesos to run its compute clusters. And Go is another aspect of this, says CTO Heath.
“So far we’ve built almost all of our internal systems in Go – from our API right down to our transaction and ledger systems – as a collection of microservices, which together form the backbone of our product,” he says.
“We also use a number of other third-party infrastructure tools and components which are written in Go, such as NSQ (from bit.ly) which processes our internal task and event queues, InfluxDB for metrics, and we’re currently trialing CockroachDB for some distributed data storage.”
Heath says that a number of staff on the development team at Mondo already had experience with using Go - but which they chose after considering a number of other languages and frameworks.
"Go is a statically typed language which gives us the benefit of compile time type checking, and catches a whole class of potential bugs – for example floating point and integer numbers cannot accidentally be converted – which is very important when you’re dealing with people’s money," he says.
"Also being memory managed, with garbage collection, and being compiled to machine code with first class concurrency support, means we get very high performance and much lower costs (very important for startups) while still being as fast to develop in as dynamic scripting languages such as Ruby or Python.
"Finally we wanted to make a solid technical choice at the beginning of our project that we would be happy scaling in the years to come. I can’t think of anything more terrifying than re-architecting our platform underneath a running bank!"
Find your next job with techworld jobs