#563: Getting Started with Rust as Python Devs

Summary of #563: Getting Started with Rust as Python Devs

by Michael Kennedy

1h 10m•September 16, 2026

Overview of Talk Python to Me #563: Getting Started with Rust as Python Devs

In this episode, Michael Kennedy and Christopher Trudeau introduce Rust from the perspective of Python developers. The discussion focuses on why Rust is becoming increasingly important in the Python ecosystem, where it shows up in tools, libraries, and servers, and what Python developers need to know to start using it effectively. They compare Rust’s ownership and memory model to Python’s dynamic, garbage-collected world, explain the main integration patterns between Rust and Python, and share practical advice for getting started with Rust and finding useful resources.

Why Rust Matters for Python Developers

Rust is showing up in Python in three major ways:

  1. Standalone developer tools written in Rust

    • Examples: ruff, uv, pydantic-adjacent tooling, and other fast CLI utilities.
    • These tools often feel “Python-adjacent” but are powered by Rust for speed.
  2. Python libraries with Rust cores

    • Libraries like Pydantic and Polars use Rust for performance-critical internals.
    • Python imports these modules normally, without needing to know the implementation language.
  3. Servers or systems that embed Python inside Rust

    • Example: Granian-style architectures, where Rust is the runtime foundation and Python runs inside it.

Key Rust Concepts Explained for Python Devs

Ownership and the Borrow Checker

  • Rust enforces that only one thing owns a value at a time.
  • Passing values around freely, as in Python, is normal in Python but can trigger compile-time errors in Rust.
  • The borrow checker is the mechanism that enforces these rules and prevents many memory bugs before the code ever runs.

Memory Management

  • Python largely hides memory management behind reference counting and garbage collection.
  • Rust makes memory ownership explicit, which can be frustrating at first but eliminates an entire class of bugs.
  • The tradeoff: more work upfront, but better correctness and often better performance.

Stack vs. Heap

  • Rust developers need to think more explicitly about whether data lives on the stack or the heap.
  • Python developers rarely need to care, because Python abstracts that away.
  • Understanding this distinction is important for performance and for making sense of Rust’s ownership model.

Types and Integer Sizes

  • Python integers are effectively unbounded; Rust integers are fixed-size and closer to CPU hardware.
  • In Rust, you must think about:
    • signed vs. unsigned integers
    • integer width
    • overflow behavior
  • This makes Rust more predictable and faster, but less flexible than Python.

Rust vs. Python: Main Differences

What Feels Familiar

  • if / else logic is straightforward.
  • Loops and collections are conceptually similar.
  • Typed Python readers will find some Rust syntax familiar.
  • fn for function definitions is clearer than def in some ways.
  • Rust types are often written in a readable “name: type” style.

What Feels Different

  • Rust is compiled, not interpreted like Python.
  • Rust outputs a platform-specific binary rather than bytecode.
  • There is no true REPL experience in the traditional Python sense.
  • Formatting and syntax are stricter, with braces instead of indentation-based blocks.
  • Rust tends to be more explicit about return values, types, and ownership.

Design Tradeoffs

  • Rust often requires more ceremony, but it rewards that with:
    • better compile-time guarantees
    • fewer runtime surprises
    • strong performance
  • Python favors speed of development and flexibility.
  • Rust favors correctness, predictability, and speed of execution.

Rust Tooling and Ecosystem

Cargo and Rustup

  • Rustup is the installer/version manager, similar in spirit to pyenv.
  • Cargo is the central tool for building, running, testing, and managing Rust projects.
  • cargo new creates a project scaffold similar to uv init or a modern Python project setup.
  • cargo run builds and executes the project.

Crates

  • Rust packages are called crates, and they are managed through the crates ecosystem.
  • Cargo handles dependencies and builds, much like modern Python packaging tools.
  • The ecosystem is smaller than PyPI, but the tooling is tightly integrated.

Editions and Compatibility

  • Rust has frequent releases but also uses editions to preserve compatibility across language changes.
  • This helps keep older code viable while the language evolves.

How Rust Integrates with Python

PyO3

  • PyO3 is the main Rust crate for building Python extensions.
  • It lets Rust code present itself as Python-compatible objects and modules.
  • Rust functions and classes can be exposed to Python with macros.

Maturin

  • Maturin helps package Rust-based Python extensions into installable wheels.
  • It bridges the Rust build world and Python packaging world.
  • The result is that Python code can import Rust-backed modules like any other package.

Practical Benefit

  • This approach is ideal when only part of the workload needs to be fast.
  • Examples:
    • parsing
    • serialization
    • validation
    • numeric crunching
  • But crossing the Python/Rust boundary has overhead, so it only helps when the expensive work is done in Rust in larger chunks.

Learning Path and Getting Started

Best First Step

  • Start at rust-lang.org
  • Install via rustup
  • Use Cargo to create your first project

Good Learning Targets

  • Learn:
    • ownership
    • borrowing
    • lifetimes
    • stack vs. heap
    • fixed-size numeric types
  • Don’t try to master everything at once.

Recommended Resources

  • The Rust Book is highlighted as one of the best starting points.
  • Christopher also points listeners to an awesome Python+Rust list for real-world examples and libraries.

Notable Takeaways

  • Rust is becoming a major force in Python tooling and performance-sensitive libraries.
  • Python developers don’t need to become Rust experts to benefit from Rust.
  • Understanding a few core Rust concepts makes it much easier to read and use Rust-backed Python packages.
  • Rust often replaces Python-only performance bottlenecks with fast compiled code, especially in data processing and validation.
  • Many improvements in modern Python developer tooling have been influenced by Rust’s packaging and build ecosystem.

Recommended Action Items

  • Try installing Rust with rustup.
  • Build a tiny project with cargo new and cargo run.
  • Read through the Rust Book.
  • Explore Rust-backed Python libraries you already use, such as:
    • ruff
    • uv
    • pydantic
    • polars
  • If you’re working on performance issues, profile first before rewriting anything in Rust.

Final Thought

This episode frames Rust not as a replacement for Python, but as a powerful complement to it. For Python developers, Rust is increasingly useful as a tool for faster infrastructure, stronger guarantees, and more performant libraries—especially when you need to optimize the few places where Python alone isn’t enough.