How Python Will Test Adding Rust Into CPython (python.org) 14
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 how the Rust for CPython project might proceed and become a permanent fixture within the CPython project. David is acting as an "ambassador" for the Rust for CPython project team, which is currently led by core developers Kirill Podoprigora and Emma Smith as authors of the Rust for CPython PEP draft. Emma also spoke at PyCon US 2026 about the Rust for CPython project. The team itself is around 60 developers in a Discord channel, among them a "few [Python] core developers" and a "delegation from the Rust project".
The team has experience with previous projects integrating Rust into existing codebases, such as Android and the Linux kernel, and is "excited by the work and keen to support [the project] if we proceed". Showing how adopting Rust may specifically help CPython, David noted how the number of issues labeled with " type-crash" has been steadily rising over time... David explained that Jeff Vander Stoep described Rust in Android as "move fast and fix things", and that "fewer revisions for patches of the same size" was the experience Android has had since adopting Rust....
One of the biggest concerns from a year ago was Rust's lack of platform support compared to CPython, which at the time of writing officially supports 20 different architectures and platforms at either Tier 1, 2, or 3. David shared that Rust's support of different platforms has "widened since last year" and was becoming "less and less of a concern". The proposal would be to ask Python distributors to attempt using the optional Rust support in Python 3.16 (October 2027) and report platform-specific issues upstream in time to be resolved around the Python 3.17 timeline (October 2028)...
[T]he first Rust code to ship in Python would be in Python 3.16 [October 2027], where it would be completely optional, with the existing C code kept as a fallback. The earliest that Rust would become required to build CPython is Python 3.18 in 2029, at least three years away... The Rust for CPython team has selected the zlib module as the first module to be given an optional Rust implementation because they "wanted to achieve a significant improvement" with a "small scope". The proposed Rust implementation will use zlib-rs, which is "heavily tested and used by the Firefox, uv, and Cargo" projects and "faster than zlib and zlib-ng on many platforms".... This small change would have an impact: the zlib compression algorithm is "widely used by Python packaging", meaning that (almost) "every pip install in Python 3.16 will be sped up" if the proposal is accepted.
Thanks to long-time Slashdot reader RoccamOccam for sharing the article.
The team has experience with previous projects integrating Rust into existing codebases, such as Android and the Linux kernel, and is "excited by the work and keen to support [the project] if we proceed". Showing how adopting Rust may specifically help CPython, David noted how the number of issues labeled with " type-crash" has been steadily rising over time... David explained that Jeff Vander Stoep described Rust in Android as "move fast and fix things", and that "fewer revisions for patches of the same size" was the experience Android has had since adopting Rust....
One of the biggest concerns from a year ago was Rust's lack of platform support compared to CPython, which at the time of writing officially supports 20 different architectures and platforms at either Tier 1, 2, or 3. David shared that Rust's support of different platforms has "widened since last year" and was becoming "less and less of a concern". The proposal would be to ask Python distributors to attempt using the optional Rust support in Python 3.16 (October 2027) and report platform-specific issues upstream in time to be resolved around the Python 3.17 timeline (October 2028)...
[T]he first Rust code to ship in Python would be in Python 3.16 [October 2027], where it would be completely optional, with the existing C code kept as a fallback. The earliest that Rust would become required to build CPython is Python 3.18 in 2029, at least three years away... The Rust for CPython team has selected the zlib module as the first module to be given an optional Rust implementation because they "wanted to achieve a significant improvement" with a "small scope". The proposed Rust implementation will use zlib-rs, which is "heavily tested and used by the Firefox, uv, and Cargo" projects and "faster than zlib and zlib-ng on many platforms".... This small change would have an impact: the zlib compression algorithm is "widely used by Python packaging", meaning that (almost) "every pip install in Python 3.16 will be sped up" if the proposal is accepted.
Thanks to long-time Slashdot reader RoccamOccam for sharing the article.
So... (Score:1)
Mix one programming language into another whole language.
Awesome!
Re:So... (Score:4, Informative)
Well, python is currently implemented with C. so we've already gone down this road.
I just hope that the jump from 3.17 to 3.18 (python with Rust) doesn't introduce another incompatibility branch. I've already got two versions on my system and I don't want any more snakes on my plane.
Re: (Score:2)
Just what we need... a way to make python even slower.
everything has to rust (Score:3)
python isn't meant to do compute intensive work directly anyway, it's a high level glue language meant to leave that to low level libraries, and c and rust are in the same category.
python users will see marginal or no difference except maybe problems with the transition itself. this is a thing for maintainers, and it might piss off a few of them. the project will likely be a hassle and a lot of work (llms and all) and i don't see an enticing cost-benefit relation, but that's up to them.
Re: (Score:2)
Python isn't a glue language. It's the lingua franca of most programmers in the workforce at this point in history.
Try hiring some expert C++ programmers, or even competent Java programmers. They're in the minority. What you get instead is barely competent grads who only know Python. What do you do with those grads after you've hired them?
1) teach the grads a strongly typed industrial strength language so they can contribute.... eventually
2) develop your new projects in Python because the grads can be pr
Re: (Score:3)
There's no reason why Python (compiled from Rust) would be any slower than Python (compiled from C). Both languages compile to native executable code, and both have good optimizers available.
Re: (Score:2)
Yeah. I get the impression there are a hell of a lot of people who just make up reasons to hate Rust because of some perceived (rightly or wrongly) annoying habits of those who advocate it.
Which is ironic because Python zealots literally had the same reputation as Rust advocates today 20-25 years ago.
Rust is theoretically a massive step forward if we use it properly. People spend far too much time getting tribal because of whether they want to be associated with advocates or critics rather than the tech und
Re: (Score:2)
Re: (Score:2)
Is this going to bring about some performance optimization, or is it just someone saying, "hey, my teacher/boss/whatever told me that Rust is cool, and I drank the koolaid!"
Because Rust will bring World Peace (c)(tm) (Score:2, Funny)
Everything must be Rustified.
It is speading like SystemD without anyone understanding the real need for it.
Re: (Score:3)
UNSAFE { One word to undo it all.
};
yes but also no (Score:1)
Instead of trying to change someone's fundamental beliefs, which is hard, we just use the existing beliefs as a method of control. Like the cordyceps fungus that takes over an ant. We've evolved to just telling people of one religion that they should support another religion for "reasons" -- see all the evangelical useful idiots supporting the zionist state for reasons I cannot fathom.
You're totally right about the rust fanatics but I don't even think the rust people are trying to gain converts but just to
Re: (Score:1)
... and even that will be mostly outsourced to an agent.