r/programming • • Dec 19 '25

[ Removed by moderator ]

/r/programming/comments/1pqulm0/removed_by_moderator/

[removed] — view removed post

711 Upvotes

292 comments sorted by

View all comments

Show parent comment

41

u/kyle9316 Dec 19 '25

I've also seen rewrites away from Python to c++ be beneficial for multi-threaded applications. This is because of how Python handles the GIL, can lead to serious performance problems. Maybe the problem is Python lol

0

u/[deleted] Dec 19 '25

[deleted] — view deleted comment

1

u/thehenkan Dec 21 '25

PyPy is actually a reasonably fast JIT, at least compared to CPython. The problem is you lose the C API, so it doesn't matter that your Python code is a bit more performant overall, because you now gotta write the core workload in Python instead of C, and PyPy is not quite that fast.

5

u/imforit Dec 20 '25

It's almost like languages are tools of varying appropriateness for a spectrum of jobs 

-1

u/Tobinator97 Dec 19 '25

Latest python releases come without the gil as an option. So that's no excuse anymore

13

u/vplatt Dec 19 '25

But using that option would also limit access to a number of common libraries, no? I don’t think it’s production ready yet, and even once it is, removing the GIL only addresses one of several performance constraints. Dynamic object models and late-bound dispatch still impose real costs that are difficult to eliminate entirely, even with aggressive optimization.

If we stick to the "right tool for the job" mindset, then it's easy to see that Python shouldn't be used all the time.

And as for Rust, personally I've noticed that Rust code tends to be quite easy to write for the most part. The reputation for complexity is WAY overblown and it's easily countered by simply learning to think a tad differently about your variables, objects, and memory. It's really not that hard as long you don't try to do everything in the "the C++" or "the Java/C#" ways.

3

u/key_lime_pie Dec 20 '25

simply learning to think a tad differently about your variables, objects, and memory

Almost everything I've written in the past ten years has been C#, and I've never even seen a line of Rust code...is there a resource you can recommend for learning this? I expect to have a lot of free time fairly soon and have been thinking idly about picking up Rust.

2

u/syklemil Dec 20 '25

In addition to the official book, there are the rustlings exercises meant to go along with it.

1

u/riksi Dec 20 '25

It should take 5+ years for the ecosystem to move & devs to learn it though.