The Rust Invasion
New Possibilities in the Python Ecosystem
Terence Liu @terencezliu
2
https://fineartamerica.com/featured/british-invasion-encore-ron-magnes.html
3
4
cryptography Changelog
5
Alternatives to alpine
6
Ruff (2022 - 2023)
7
Ruff (2022 - 2023)
8
uv (2024)
9
uv (2024)
10
The Buzz
11
https://x.com/gjbernat/status/1836843228030505053
12
- from Hynek Schlawack (Sep 30, 2024), also
How Do You Develop With Python?
13
Deploy Python Apps to the Cloud
14
uv Showcase (uv venv & uv pip install)
15
Big project - 250s -> 30s (no cache)
uv Showcase (uv pip list & uv pip tree)
16
uv Showcase (uv python)
17
uv Showcase (uv init & uv add & uv sync)
18
19
uv Showcase (Installation and Upgrades)
20
Other Static Binary Package Managers
21
Other Static Binary Package Managers
22
Pattern Spotted!
23
Influence: Cargo - the Rust Package Manager
24
25
Welcome. Fellow Rustaceans…
26
Let’s Talk about Python…
27
Why is Python Slow?
28
This might change! #nogil
But Python is the language for Scientific Computing, Data, and AI
29
Awesome Rust Projects with Python Bindings
30
What to Use for Faster Code?
31
Faster Python calculations with Numba: 2 lines of code, 13× speed-up
Cython, Rust, and more: choosing a language for Python extensions
Let’s build and optimize a Rust extension for Python
The easiest way to speed up Python with Rust
PyO3: From Python to Rust and Back Again (with David Hewitt)
Converting a Python library to Rust
Rust as the “Glue” for C/C++
32
Side Note: Memory Safety Pressuring the C/C++ Community
33
https://twitter.com/seanbax/status/1839030830968012989
Rust/Python Interop Game Plan
34
Accelerating Msgpack Data Pipeline - Setup
35
Accelerating Msgpack Data Pipeline - Python Impl
36
Accelerating Msgpack Data Pipeline - Rust Impl
37
. . .
38
. . .
Accelerating Msgpack Data Pipeline - Rust Impl
39
Speed-Up
40
1 thread
4 threads
If Reading from File and Deserialize in Rust…
41
1 thread
4 threads
Awesome-Rust - Rich and Thriving Ecosystem
42
Thank you!
43