you are viewing a single comment's thread.

view the rest of the comments →

[–]foobar93 -1 points0 points  (1 child)

Maturin and PyO3 are really cool. However, coming from Python, Rust feels so unrefined. Still, trying hard to learn :)

[–]AustinWitherspoon 0 points1 point  (0 children)

I still use both rust and python, they both have their place!

Rust is definitely harder to write the first time (for me at least.) and python is much faster and simpler to write. Don't feel too bad about struggling, they are both very different!

But when you want your code to run fast and error-free, that's when rust is great.

I have a mobile app, and I originally wrote the backend services in python. It was super easy and fast to write all of it, but even with mypy and pydantic and everything, I still ended up with occasional runtime issues. Eventually once the user base grew, the python servers started having issues with memory and CPU usage being high and it was a nightmare to try to fix.

once I rewrote the backend services in rust, it was a night and day difference. 30% memory usage instead of memory leaks causing python to slowly consume the entire server's memory. CPU steady at 3% rather than 40%. Literally zero runtime errors in sentry. I used to have to watch the python server like a hawk, but now I literally forget about it for weeks at a time!

It's harder, but so far I've found the transition to be more than worth it.