Manual
gopy is a behavioural twin of CPython 3.14 written in Go. The interpreter parses, compiles, and runs Python source the same way CPython does. The result is the same bytecode, the same objects, the same error messages.
This manual is the user-facing slice of the site. It does not cover implementation. For that, see the CPython and gopy pillars.
What is in this manual
| Page | What it covers |
|---|---|
| Install | go install and prebuilt binaries. |
| Run a file | gopy hello.py, exit codes, stdin scripts. |
| Hello, gopy | The smallest runnable program. |
| CLI | Every flag the binary accepts. |
| REPL | The interactive prompt. |
| Embedding | Calling the gopy VM from Go. |
| Status | Which Python features are wired today. |
| Parity | How gopy is held to CPython behaviour. |
A 30 second tour
hello.py
def fizzbuzz(n):
for i in range(1, n + 1):
if i % 15 == 0:
print("FizzBuzz")
elif i % 3 == 0:
print("Fizz")
elif i % 5 == 0:
print("Buzz")
else:
print(i)
fizzbuzz(15)
$ gopy hello.py
1
2
Fizz
4
Buzz
Fizz
7
8
Fizz
Buzz
11
Fizz
13
14
FizzBuzz
Pipe gopy -d hello.py to print the bytecode listing, or
GOPY_TRACE_SPECIALIZER=1 gopy hello.py to watch the adaptive
specializer in action.