How To Make Your Python Packages Really Fast With RUST
Isaac Harris-Holt Isaac Harris-Holt
14.3K subscribers
41,109 views
1.7K

 Published On Apr 16, 2023

Everyone knows that program speed isn't Python's strong point. That's why so many number-crunching data science libraries are written in C.

BUT C can cause headaches. Segfaults are common and memory leaks are something to be feared. What if there was another option? Well, there is. It's Rust. Rust is a blazingly fast, memory-efficient and memory-safe language that's an absolute joy to work with. And I'm going to teach you how to use it to write your Python packages.

Check out the code:
https://github.com/isaacharrisholt/yo...

Resources:
Maturin: https://www.maturin.rs/
PyO3: https://pyo3.rs/
Rustup: https://rustup.rs/
The Rust Book: https://doc.rust-lang.org/stable/book/
uuidt: https://doc.rust-lang.org/stable/book/
Polars: https://pola.rs
pydantic-core: https://github.com/pydantic/pydantic-...

__________________________________________

Check out my other socials!
🐦 Twitter ▶   / isaacharrisholt  
🖥️ Portfolio ▶ https://ihh.dev
📝 Blog ▶ https://isaacharrisholt.com
__________________________________________

Timestamps:
00:00 - Introduction and explanation
00:46 - Prerequisites
00:58 - Script overview
01:19 - Maturin setup
02:09 - Writing the Rust
02:53 - Benchmarking our function
04:08 - Rust limitations
04:43 - Common gotchas

#python #softwareengineer #rust

show more

Share/Embed