Movatterモバイル変換


[0]ホーム

URL:


Sign in / up
The Register

Devops

This article is more than1 year old

Google's Grumpy code makes Python Go

With a transcompiling tool, YouTube aims to overcome Python's limitations

iconThomas Claburn
Thu 5 Jan 2017 //00:20 UTC

Google on Wednesday introduced an open-source project calledGrumpy to translate Python code into Go programs.

The company's front-end server for YouTube and its YouTube API are mainly written in Python, and run on CPython 2.7, as opposed to other implementations (Jython, PyPy, or IronPython).

The issue for Google is performance. Python in its various forms doesn't excel at concurrency – running multiple, independent threads at the same time – explains YouTube engineer Dylan Trotter in ablog post.

Grumpy is a source code transcompiler and runtime. It compiles Python source code into Go source code that gets compiled into native code rather than bytecode that requires a VM.

The compiled Go code makes calls to the Grumpy runtime, which is a Go library that functions similarly to the Python C API.

Trotter characterizes Grumpy as experimental, but that doesn't mean support for Python 3 is forthcoming as the project matures. In response to a request for Python 3 support, Trotter on GitHub said, "We have a large Python 2.7 codebase so that's what we've been focused on. I definitely would like to support Python 3. It's just a bunch of work." He suggested those interested in Python 3 support should fork the project.

One possible rationale for creating Grumpy may be the planned end-of-life date for Python 2.7in 2020. Rather than trying to update all its Python code from version 2.7 to 3 – which has been slow to catch on – Google appears to be planning to convert at least some of its Python code to Go over the next few years.

Google didn't immediately respond to a request for comment.

In apost to Hacker News, Trotter offered his thoughts on the matter. "The idea is to continue to write code in Python," he said. "The transcompiled code is not suitable for working with directly. That said, there is the possibility of rewriting bits and pieces in Go (eg, performance-critical stuff) and then call into it from Python. Sort of a hybrid approach."

Three years hence and beyond, that hybrid approach can be expected to include a lot more Go code, provided Google's developers become as proficient with Go as they are with Python.

Go, as Trotter suggests, has performance advantages over Python (though benchmarks can vary significantly, depending upon optimizations and alternative implementations). It also has brand advantages: Go was developed at Google and the company's willingness to eat its own dogfood, so to speak, could convince other organizations that Go is the way to go.

Google doesn't benefit directly from Go adoption, but broader usage will deepen the talent pool of Go developers, who could in time end up working at Google or improving Go libraries that Google uses. There's also the opportunity cost imposed on competitors – the more time developers spend with Go, the less they have to spend with languages backed by Apple, Microsoft, Mozilla, Oracle, or others. ®


More like these

More about


COMMENTS

More about

More like these

TIP US OFF

Send us news


Other stories you might like

Mistral launches Voxtral speech recognition model

Apache-licensed plan takes aim at costlier options
AI + ML15 Jul 2025 |5

Former Google DeepMind engineer behind Simular says other AI agents are doing it wrong

Simular is starting with industries like insurance and healthcare with tons of forms to fill
AI + ML15 Jul 2025 |21

AWS previews Kiro IDE for developers who are over vibe coding

Delivers specs in the form of user stories
AI + ML14 Jul 2025 |12

Why rapid proliferation of cloud native apps requires faster, more efficient toolsets

Kubernetes enables easy, rapid AI app development, making it the industry standard for AI workloads
Sponsored feature

Tech to protect images against AI scrapers can be beaten, researchers show

ai-pocalypse Data poisoning, meet data detox
AI + ML11 Jul 2025 |18

AI models just don't understand what they're talking about

Researchers find models' success at tests hides illusion of understanding
AI + ML3 Jul 2025 |65

Norwegian lotto mistakenly told thousands they were filthy rich after math error

Oh, you have todivide by 100?
Offbeat30 Jun 2025 |39

MiniMax M1 model claims Chinese LLM crown from DeepSeek – plus it's true open source

China's 'little dragons' pose big challenge to US AI firms
AI + ML17 Jun 2025 |24

AI can spew code, but kids should still suffer like we did, says Raspberry Pi

Mini computer house comes out against 'vibe coding' fad
Software5 Jun 2025 |60

Meta offered one AI researcher at least $10,000,000 to join up

Exclusive Mark Zuckerberg reached out to our source directly
AI + ML13 Jun 2025 |56

AI coding tools are like that helpful but untrustworthy friend, devs say

Exclusive A survey from AI biz Qodo finds robo-coding productivity gains are unevenly distributed
AI + ML12 Jun 2025 |39

Cisco president says dredging coding syntax from wetware memory wastes engineers' expensive synapses

Cisco Live Wants to let AI do the boring bits so his team can invent more cool stuff
AI + ML10 Jun 2025 |60

[8]ページ先頭

©2009-2025 Movatter.jp