Blogging

Python x Rust meetup October 2024

This was the inaugural (hopefully) Rust/Python meetup crossover and to be honest it was heavy on the Python developers incorporating Rust into their code.

The talks were mostly recycled from other contexts (but no worse for having a bit of polish): David Seddon Crabs in Snakes!, David Hewitt How Python harnesses Rust, Samuel Colvin Pydantic v2 with Rust.

If pushed for time I would probably recommend David Hewitt’s one if you want to learn about how PyO3 (and foreign calls in Python generally) works and David Seddon’s if you just want to try and get a working Python-Rust interop.

During the Q&A Samuel made probably the key point of the evening for me that virtually anything you do in Rust is going to be faster than Python (and for good reasons, this isn’t a diss on Python). The call overhead is negligible and you’ll be using a system language. His case in point was string validation, even relatively simple validation is faster in Rust. David Hewitt’s example was Array processing versus Python’s dynamic Lists.

The disadvantages that there were mentioned about Rust was its complexity, which is simplified when the context is a function call and it being hard to try out different ideas and reorganise code, the strict compiler means that you need to move from one complete implementation to another.

If interop becomes increasing seamless (and it sounds like the biggest problem currently is having to build binaries) then there will be no reason not to drop from Python into Rust. There also won’t be a strong reason for not starting your programming in a high-level abstraction and dropping down a level when you need to.

Standard

One thought on “Python x Rust meetup October 2024

  1. Pingback: Python x Rust 聚會 2024 年 10 月 - Jiayun

Leave a comment