Rust for CPython (Python Language Summit 2026)
The Python Language Summit 2026 featured a discussion on the Rust for CPython project, which aims to integrate the Rust programming language into the CPython interpreter. David Hewitt, the project's "ambassador," outlined the team's plans and goals during the summit. The Rust for CPython project, led by core developers Kirill Podoprigora and Emma Smith, consists of around 60 developers and has experience integrating Rust into large codebases like Android and the Linux kernel.
One of the primary motivations for adopting Rust is to address the increasing number of "type-crash" issues in CPython. Rust's memory safety guarantees could help mitigate these issues. The team has already explored the potential benefits of Rust in various parts of CPython, such as the new parser, JIT compiler, and free-threading implementation. They also noted that Rust is already being used in Python's ecosystem of packages through PyO3 and Maturin.
However, the team acknowledged several challenges in adopting Rust. The biggest concern is Rust's current lack of platform support compared to CPython, which officially supports 20 different architectures and platforms. The team plans to address this by encouraging Python distributors to test the optional Rust support in Python 3.16 and resolving platform-specific issues by the time of Python 3.17.
David emphasized the need for a gradual approach to Rust integration, targeting small portions of CPython at a time. He also highlighted the importance of property-based testing, fuzzing, and prudent engineering practices to ensure the correctness of ported code. The team proposes a timeline for Rust for CPython, with the first Rust code expected to ship in Python 3.16 as an optional feature, with full integration planned for Python 3.18 or later.
The project began with the zlib module, as it was chosen for its significant impact with a small scope and the use of the zlib-rs library, which is heavily tested and used by other popular projects. The Rust API for Python would use specific attributes and follow best practices for error handling. The team's success criteria for Rust as a required part of CPython would be defined in a proposed PEP (Python Enhancement Proposal) by late 2026.
Written by urgent.news from Lobsters's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.