Author: Steve Dower
Created at: 2025-11-20 14:53
Number: 157
Clean content: H. Vetinari: By forcing the C APIs to define their semantics, the C APIs themselves often were improved. Yes, I think this is the best we can look forward to if the plan to progressively replace the core runtime implementation with Rust were still on the cards (which I assume it is, just unofficially for now - it doesn’t make any sense at all to “put Rust in CPython” without that ambition, since you can already write an extension module using Rust without our permission [1] ). And we are already working to improve the semantics of our C APIs as quickly as we can without destroying our existing user base - adding Rust won’t help here (it’ll let us get away with more breakage for some people “because Rust”, but it’ll upset other people who still want minimal breakage, and on average I expect it’ll make no real difference). What the current proposal comes down to is “can we make some stdlib extension modules optional for some people”, where the answer is obviously “yes” as we already make a number of them optional for users who don’t have/support/want certain third-party libraries. So the slightly higher-level question is “are we willing to make some modules optional based on compiler choice, rather than based on access to the core functionality required by the module”. (For example, if I don’t want/have OpenSSL, then the _ssl module is obviously useless and best omitted. But if I don’t want/have Rust, why should I miss out on _base64 ?) That question is the real, practical impact that we have to decide on. Everything else is hypothetical and achievable in this way or in other ways. But if we’re not willing to have a more inconsistent stdlib across our userbase, then the overall question seems to be moot, at least until Rust can be assumed to be as available as make+GCC. I’ll also note here that the SC has previously approved putting obviously core functionality on PyPI (subinterpreters), so until we rotate through to an entirely new SC, I don’t think there’s a case for “has to be in core” other than taking advantage of our popularity (which has been earned through stability, so we shouldn’t ruin it by actively destabilising it). ↩︎
