How Python Will Test Adding Rust Into CPython
Python's security developer-in-residence Seth Larson reports from this year's official core developer Python Language Summit: "No one said 'don't do this' last year". After testing the waters at PyCon US 2025, [software engineer] David Hewitt returned to the Python Language Summit asking what Python core developers want from Rust, along with proposed timelines, phases, and success criteria for…
This year's Python Language Summit saw Python's security developer-in-residence Seth Larson report on the progress of integrating Rust into CPython. After exploring the concept at PyCon US 2025, software engineer David Hewitt returned to the summit, seeking input from Python core developers on the project's goals, timeline, and success criteria. David serves as an ambassador for the Rust for CPython project, which is led by core developers Kirill Podoprigora and Emma Smith, along with a delegation from the Rust project.
The team, numbering around 60 developers in a Discord channel, boasts experience with integrating Rust into codebases like Android and the Linux kernel. They expressed enthusiasm for the project and willingness to support it if it moves forward.
David highlighted the increasing number of "type-crash" issues in CPython, suggesting that Rust could help address this problem. He explained that Rust's developer Jeff Vander Stoep described it as "move fast and fix things," noting that Android's adoption of Rust led to fewer revisions for patches of the same size.
One of the main concerns from the previous year was Rust's limited platform support compared to CPython, which officially supports 20 different architectures and platforms. However, David reported that Rust's platform support has expanded since then, making it a less significant concern.
The proposal involves asking Python distributors to test the optional Rust support in Python 3.16 (October 2027) and report any platform-specific issues in time for the Python 3.17 release (October 2028). If successful, the first Rust code to be shipped in Python would be in Python 3.16, where it would be optional, with the existing C code serving as a fallback. Rust would become required for building CPython no earlier than Python 3.18 (2029), which is still three years away.
The Rust for CPython team chose the zlib module as the first candidate for optional Rust implementation due to its significant impact and small scope. They selected zlib-rs, a well-tested and widely-used library in projects like Firefox, uv, and Cargo, which is faster than zlib and zlib-ng on many platforms. This change would benefit Python packaging, as zlib is used in almost every pip install in Python 3.16.
Written by urgent.news from Slashdot's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.