Google develops Grumpy to translate Python code into Go program

Go programming

Go programming

With a view to overcoming some major limitations of Python, Google has brought its transcompiling tool called Grumpy. The new open source project is designed to translate Python code into Go programs to address the concurrency issue and run the transpiled programs seamlessly within the Go runtime.

Google’s YouTube and various YouTube’s APIs are the finest example of Python-based solutions by the company. The front-end of YouTube runs on CPython 2.7. Though the high-level programming language brought fruitful results to the video streaming website, it was restricting the achievements on concurrent workloads. This pushed the demand for an alternative runtime, which is optimised for real-time serving, and ultimately took the shape of Grumpy.

“We are excited about the prospects for Grumpy. Although it is still alpha software, most of the language constructs and many core built-in types work like you would expect,” YouTube engineer Dylan Trotter writes in a blog post.

The alpha presence of Grumpy limits its usage. The tool does not have support for C extension modules and is not operable as an interpreter. However, it uses Go’s garbage collection for object lifetime management and has the potential to scale more smoothly over CPython.

Not a development to abandon Python completely

Google is not seemingly set to leave Python at this moment. Instead, Grumpy is backed to bring a model of ‘Python in Go’ and enable interoperability in its major Python developments.

In the coming future, Google is expected to improve Grumpy and would soon convert one of its major Python code into a Go program using the latest model. But the present release has some improvement areas around built-in types and functions. Also, the hybrid approach is yet to be supported by a large number of Python developers.


Please enter your comment!
Please enter your name here