Compile an existing Python 2.7 service into a native Go binary to get better CPU performance without rewriting the code from scratch.
Use grumprun to pipe a small Python snippet through the compiler and see the Go output to understand how the translation works.
Study the Grumpy runtime library to understand how Python object semantics are mapped onto Go types.
Use the project as a reference for how to build a language compiler in Go that targets another language's runtime model.
Python 2.7 only, no C extension support, and the project is no longer actively maintained, treat as a research reference rather than a production tool.
Grumpy is a tool from Google that takes Python code and converts it into Go code, which is then compiled into a native program. In most Python environments, your code runs inside a virtual machine that interprets it step by step. Grumpy skips that entirely: your Python gets translated into Go, and the result is a standalone native binary. The project targets Python 2.7 compatibility. The practical use case is performance-sensitive services that are already written in Python but need the speed and concurrency characteristics of Go. Rather than rewriting code from scratch, a team could run it through Grumpy and get a compiled Go program. Google used this internally for some infrastructure work. There are real limits to what Grumpy can handle. Dynamic features like eval and exec are not supported, because the translation step happens at build time and those features require a live interpreter to work. C extension modules (common add-ons in the Python ecosystem) are also not supported, since Grumpy uses a different internal structure than the standard Python runtime. Some parts of Python's standard library are missing or incomplete. The project has three main pieces: a compiler called grumpc that reads Python and writes Go, a runtime library written in Go that handles Python-style objects and operations during execution, and a set of standard library modules ported to work in this environment. A helper script called grumprun lets you pipe Python code directly in and get results out, which makes quick testing straightforward. The repository is written in Go and Python, and the source is available on GitHub. It has not been actively maintained in recent years, so it is best treated as a reference project rather than a production-ready tool.
← google on gitmyhub — every repo by this author, as a profile.
Verify against the repo before relying on details.