Urgent.News

What's breaking now, across thousands of outlets.

Tech

CPython eases Rust requirements as assimilation continues

By making Rust opt-in, the Python builders hope to enjoy Rust bennies without the backlash that roiled the Linux kernel keepers

CPython eases Rust requirements as assimilation continues

The maintainers of CPython, the reference implementation of the Python programming language, have softened their stance on requiring Rust as a dependency. Instead, they are focusing on creating an optional Rust API for internal Python development. This approach aims to address concerns raised by various parties, including the integration between CPython and Rust.

Rust Programming Manager Tomáš Šedovič explained that this decision "sidesteps a lot of the concerns that people brought up." Rust has been working closely with CPython core developers to facilitate the integration process. In November, Python programmer Emma Smith had initially proposed incorporating Rust support into Python, envisioning it for extension modules and eventually making it a required dependency in CPython.

However, due to issues like platform support and cyclic dependencies, Smith later revised the proposal, suggesting that Rust could be used for optional extension modules. Python creator Guido van Rossum endorsed this modified approach, stating that a full rewrite in Rust was not feasible, but a gradual introduction of Rust into less-essential components could be beneficial.

Currently, work is ongoing to incorporate Rust into CPython's build process and develop a Rust API for building Python with Rust crates. The API is targeted for the 3.16 Python release, scheduled for October 2027, which will also include the Rust zlib compression library as a test case. Both languages will need to make adjustments to work together, including Rust supporting GCC for CPython's diverse platforms and Python requiring a cross-language sanitizer to prevent memory issues.

The main challenge lies in enhancing Rust's Drop trait to provide runtime context for Python objects during deallocation. Meanwhile, Python may adopt some Rust innovations, such as Cargo, a unified build system that handles project initialization, building, testing, and publishing tasks.

Written by urgent.news from The Register's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

This story

This is one outlet's version. Read the fullest account.

Read the original at theregister.com →

More in Tech

More from Monday 14 September →