Google-code-as-a-service: Go on App Engine

Python, Java, and a custom tailored suit

  • alert
  • submit to reddit

Boost IT visibility and business value

In beginning, you could only use Python with Google App Engine, the online service that lets you run applications atop Google's famously distributed infrastructure. Then, after countless requests from developers, Google added a Java runtime to the service. And now the company is adding a runtime tailor-made for the service.

The rub is that this runtime is used by almost no one. But that may change.

This week, at its annual developer conference in San Francisco, Google announced that App Engine will soon offer an "experimental" runtime for its own Go programming language, a less-than-two-year-old creation that seeks to reinvent programming in the most practical of ways.

Go was first conceived in 2007 by three big Google names: Unix co-creator Ken Thompson; Rob Pike, who worked on Unix at Bell Labs with Thompson; and Robert Griesemer, who helped build the Java HotSpot compiler at Sun. The idea was to create a language suited to building the sort of distributed applications that Google builds. "We realized that the kind of software we build at Google is not always served well by the languages we had available," Rob Pike recently told us. "Robert Griesemer, Ken Thompson, and myself decided to make a language that would be very good for writing the kinds of programs we write at Google."

This means that, like Erlang, Go offers built-in tools for concurrency. "The world is concurrent and parallel. But the programming languages we use to interact with the outside world – through users on the web and mice and keyboards on a local machine – they don't tend to support that way of thinking about things very well. There was a lot of interesting theory work on this, but very few practical languages."

And so, like C, Go is a statically-typed, compiled language. But it's also meant to "feel" like a dynamically-typed language along the lines of Python. "For large programming - programming in the large, like we do at Google, using large systems with many programmers working on them - static [typing] is a huge safety net. It catches tons of stuff early that would not be caught with all-dynamic typing," Pike told us. "Go is a real systems language, a compiled language. You can write really efficient code that runs closer to the metal. But you can use these higher-level ideas to build servers out of the pieces you put together."

At this week's conference, reporters seemed mystified by the addition of Go to App Engine. But Peter Magnusson, the Google engineering manager who oversees App Engine, explained that Go is particularly suited for use on a "platform-as-as-service" like App Engine, which operates very differently from an "infrastructure cloud" like Amazon EC2. Whereas an infrastructure cloud exposes raw virtual machines, a "platform cloud" operates at a higher level, attempting to share resources with even greater efficiency.

"When you're looking at platform-as-a-service versus infrastructure-as-a-service, there is a fundamental challenge in running arbitrary binaries. You can do this on infrastructure-as-a-service, but you can't really do it in the high-level, multi-tenant, shared environment of a platform. So we have to control the languages that run there. We have hundreds and thousands of apps, and we have to have very strict guarantees that there's no leaks and no impact between them," he said. "But at the same time, there's a need for a low-level programming language for compute-intensive tasks."

That language is Go. One of its chief strengths when running on a platform-as-a-service, Magnusson said, is that it was designed for quick compilation. "Go was designed from the outset to be quick to compile. ... It compiles really fast even with a really large application. That allows you to deploy it on a platform-as-a-service like App Engine, where you upload the source code and compile and link and run it," he said

"The compilation linking is so fast, that it's just as fast as uploading the binary, or arguably faster. So it allows you to provide a low-level programming language on a platform-as-a-service. That's why Go is an interesting addition, as opposed to a lot of other languages that we might add in the future. Go provides a fundamental benefit that Python and Java don't."

But Go isn't just fast at compile time. It's fast at runtime as well. Google says the speed is comparable to C. Martin Odersky – the creator of Scala, another language that focuses on concurrency – tells us that a research paper is in the works showing that C, Scala, and Go provide comparable speeds at runtime. Google says that on App Engine, Go is particularly suited to CPU-intensive apps because it compiles to native code.

Google has released a Go SDK for App Engine, but you can't yet deploy Go apps on the service. This will "soon" be an option for a limited number of beta testers.

The Go runtime arrives with the new 1.5.0 version of App Engine. This also marks the debut of Backends, instances that have no size limits or request deadlines. They're designed for applications that require long-running and high-memory processes, using between 128MB and 1GB of memory and a "proportional" amount of CPU power.

Magnusson calls Backends a "potential game changer" for App Engine. "Previously, instances had limited resources at runtime. They were very good for running scalable applications. But they didn't provide long-running scalable back ends that were good for compute intensive or persistent state applications," he said.

"Whenever you need long-running code or computational intensity or persistent state and it doesn't match directly to a combination of data store or memcache or even HTTP requests, then it becomes very cumbersome to express it. With Backends, you can very easily – in fact, delightfully easily – code that up."

The new version also improves on App Engines "Task Queues" by introducing "Pull Queues", which let you pull tasks from a queue as applications are ready for them rather than waiting for a push. But the real news is the arrival of Go. Reporters may be perplexed, but the move only stands to reason. App Engine is a means of building and running applications on Google's back-end infrastructure. And Go is specifically designed for that very back end. Google is already using Go for "several" systems internally, though it won't specify which. ®

The essential guide to IT transformation

More from The Register

next story
The Return of BSOD: Does ANYONE trust Microsoft patches?
Sysadmins, you're either fighting fires or seen as incompetents now
Microsoft: Azure isn't ready for biz-critical apps … yet
Microsoft will move its own IT to the cloud to avoid $200m server bill
Oracle reveals 32-core, 10 BEEELLION-transistor SPARC M7
New chip scales to 1024 cores, 8192 threads 64 TB RAM, at speeds over 3.6GHz
Docker kicks KVM's butt in IBM tests
Big Blue finds containers are speedy, but may not have much room to improve
US regulators OK sale of IBM's x86 server biz to Lenovo
Now all that remains is for gov't offices to ban the boxes
Gartner's Special Report: Should you believe the hype?
Enough hot air to carry a balloon to the Moon
Flash could be CHEAPER than SAS DISK? Come off it, NetApp
Stats analysis reckons we'll hit that point in just three years
Dell The Man shrieks: 'We've got a Bitcoin order, we've got a Bitcoin order'
$50k of PowerEdge servers? That'll be 85 coins in digi-dosh
prev story


5 things you didn’t know about cloud backup
IT departments are embracing cloud backup, but there’s a lot you need to know before choosing a service provider. Learn all the critical things you need to know.
Implementing global e-invoicing with guaranteed legal certainty
Explaining the role local tax compliance plays in successful supply chain management and e-business and how leading global brands are addressing this.
Build a business case: developing custom apps
Learn how to maximize the value of custom applications by accelerating and simplifying their development.
Rethinking backup and recovery in the modern data center
Combining intelligence, operational analytics, and automation to enable efficient, data-driven IT organizations using the HP ABR approach.
Next gen security for virtualised datacentres
Legacy security solutions are inefficient due to the architectural differences between physical and virtual environments.