Backend Jul 14, 2025

Building a new tail-calling interpreter for Python

🎤 Building a new tail-calling interpreter for Python by Ken Jin
🔗 https://ep2025.europython.eu/session/building-a-new-tail-calling-interpreter-for-python

📝 Abstract: CPython (the reference implementation of Python) comes with two types of interpreters. One interpreter is based on the traditional switch-case in C, while the other one uses a fancy feature called computed gotos. In this talk, I’ll cover how I am implementing a new type of interpreter for CPython — one based on tail calls. Preliminary benchmarks for this new interpreter suggest up to a 7% performance improvement on Python-heavy programs, with significantly better external debugging experience. This interpreter is already a part of Python 3.14.