HomeNewsIndia NewsGoogle open sources Grumpy code to transpile and run Python on G

    Google open sources Grumpy code to transpile and run Python on G

    Google announced an open source project dubbed Grumpy, which is a Python to Go source code transcompiler and runtime that is intended to be a near drop in replacement for CPython 2.7. It’s as creative an application for Go, as it is a transformation of Python’s use cases.

    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 project began out of a need to improve Python execution on YouTube, which runs its front end on CPython 2.7, to handle concurrent workloads well.

    “Grumpy cannot leverage the wealth of existing Python C extensions, but it gave us a lot of flexibility to design an API and object representation that scales for parallel workloads,” said Dylan Trotter, a staff software engineer within YouTube Engineering at Google in a blog post. “We think Grumpy has the potential to scale more gracefully than CPython for many real-world workloads.”

    According to Trotter, other Python runtimes weren’t able to solve the concurrency issue without introducing unsatisfactory trade-offs.

    “So we asked ourselves a crazy question: ‘What if we were to implement an alternative runtime optimized for real-time serving?’” Trotter said. “Once we started going down the rabbit hole, Go seemed like an obvious choice of platform since its operational characteristics align well with our use case (e.g. lightweight threads). We wanted first class language interoperability and Go’s powerful runtime type reflection system made this straightforward. Python in Go felt very natural, and so Grumpy was born.

    “Grumpy is an experimental Python runtime for Go. It translates Python code into Go programs, and those ‘transpiled’ programs run seamlessly within the Go runtime. We needed to support a large existing Python codebase, so it was important to have a high degree of compatibility with CPython (quirks and all). The goal is for Grumpy to be a drop-in replacement runtime for any pure-Python project,” wrote Trotter.

    However, Trotter warns that even though Grumpy has been freshly released to open source, it remains alpha-grade software.

    “Most of the language constructs and many core built-in types work like you’d expect [but]there are still holes to fill — many built-in types are missing methods and attributes, built-in functions are absent and the standard library is virtually empty,” he said.

    ELE Times Bureau
    ELE Times Bureauhttps://www.eletimes.ai/
    ELE Times provides a comprehensive global coverage of Electronics, Technology and the Market. In addition to providing in depth articles, ELE Times attracts the industry’s largest, qualified and highly engaged audiences, who appreciate our timely, relevant content and popular formats. ELE Times helps you build awareness, drive traffic, communicate your offerings to right audience, generate leads and sell your products better.

    LEAVE A REPLY

    Please enter your comment!
    Please enter your name here

    Related News

    Must Read

    Rohde & Schwarz presents multi-purpose R&S NGT3600 high-precision dual-channel power supply

    Rohde & Schwarz showcases at productronica 2025 the R&S...

    IEEE Wintechon 2025 Powering India’s Semiconductor Future through Data, Diversity and Collaboration

    The sixth edition of IEEE WINTECHCON 2025 convened over 800...

    Rohde & Schwarz collaborates with Broadcom to enable testing and validation of next-gen Wi-Fi 8 chipsets

    Rohde & Schwarz, deepened its collaboration with Broadcom Inc....

    Nuvoton Introduces High-Quality 24-bit Stereo DAC Solution NAU8421YG

    Nuvoton announced NAU8421YG, a new high quality DAC audio...

    STMicroelectronics introduces the industry’s largest MCU model zoo to accelerate Physical AI time to market

    STMicroelectronics has unveiled new models and enhanced project support...

    STMicroelectronics introduces the industry’s first 18nm microcontroller for high-performance applications

    STMicroelectronics has unveiled the STM32V8, a new generation of...

    Navigating urban roads with safety-focused, human-like automated driving experiences

    Courtesy: Qulacomm What you should know: ●        Dense urban traffic and...

    7 Challenges Facing Fab Operations and How Providers Can Solve Them

    Courtesy: Monikantan Ayyasamy, General Manager, Equipment Engineering & Supply...