Rust for CPython: Making Python Safer and More Robust

LinkEmma SmithTalk

A PyCon US 2026 presentation covers the Rust for CPython initiative, which explores integrating Rust into CPython to replace legacy C code, targeting memory and thread unsafety.

Key points

  1. Substantial parts of CPython rely on C, which exposes runtimes to crashes, segmentation faults, and exploitable memory vulnerabilities.
  2. The Rust for CPython project aims to introduce Rust into CPython and migrate selected parts of the codebase.
  3. Rust mitigates memory and thread safety issues before runtime.
  4. Large-scale ecosystems like Android and Chromium serve as reference points for using Rust to cut security defects and boost developer velocity.
  5. The session addresses technical and social migration challenges, including backwards compatibility, community onboarding, and roadmap plans.

Why it matters

As the reference implementation of Python, CPython underpins vast software infrastructure. Bringing memory-safe languages like Rust to its core can systematically reduce severe vulnerabilities across the entire ecosystem.

Analysis

Following the adoption trends seen in Android and Chromium, evaluating Rust inside CPython represents a significant shift. The main hurdles will center on maintaining full C-extension compatibility, managing dual toolchains, and aligning the existing contributor base.

Found in

Summary generated by AI (Gemini 3.8 Flash, 27 September 2026). It may contain errors – the original source is authoritative.

Similar in content, found by the AI search.

  • Link:Emma Smith

    Pre-PEP: Rust for CPython Proposed

    A proposal on the Python discussion forum suggests introducing the Rust programming language into CPython. Initially planned for optional extension modules, Rust is envisioned to eventually become a required dependency across the CPython codebase.

    Web development· Discussion

  • Article:Daroc Alden

    Rust in CPython: Debate Sparked Over Gradual Integration

    Python core developers Emma Smith and Kirill Podoprigora have proposed introducing Rust into CPython. Following community concerns regarding platform support and maintenance overhead, the timeline to make Rust a mandatory dependency has been postponed indefinitely.

    Web development· Discussion

  • Repository:emmett-framework/granian

    Granian: A Rust HTTP Server for Python Applications

    Granian is a high-performance HTTP server for Python applications built in Rust using Hyper and Tokio. It supports ASGI, WSGI, and RSGI interfaces, aiming to replace complex dependency stacks like Gunicorn plus Uvicorn with a single, fast binary package.

    5.6kstarsRust

    Web development· Tool

  • Repository:cloudflare/pingora

    Cloudflare Pingora: Async Rust Framework for Network Services and Proxies

    Pingora is an open-source Rust framework developed by Cloudflare to build programmable, reliable, and high-performance networked systems and HTTP proxies. Serving as a memory-safe alternative to traditional C/C++ solutions, it has handled over 40 million requests per second in Cloudflare's production environment for years.

    27.3kstarsRust

    Security· Tool

  • Link:Michael Kennedy

    Running Python on Rust: Granian as a Production App Server

    In Chapter 6 of his book 'Python in Production', Michael Kennedy explains the deployment of Granian as an HTTP server for Python applications. Built with Rust, Granian replaces legacy tools like uWSGI, excelling in benchmarks through consistent low tail latency and dual support for WSGI and ASGI.

    Web development· Resource

  • Repository:microsoft/mxc

    Microsoft eXecution Container (MXC): Sandboxed Execution for Untrusted Code

    Microsoft eXecution Container (MXC) is a cross-platform sandboxed code execution framework designed for running untrusted workloads such as AI model output, plugins, and tools across Windows, Linux, and macOS. It wraps native OS containment mechanisms and VMs into a unified policy engine and typed SDKs.

    1.8kstarsRust

    AI & LLMs· Tool

Let's talk about your project

Locations

  • Mattersburg
    Johann Nepomuk Bergerstraße 7/2/14
    7210 Mattersburg, Austria
  • Vienna
    Ungargasse 64-66/3/404
    1030 Wien, Austria

Parts of this content were created with the assistance of AI.