Remix.run Logo
LAC-Tech 3 hours ago

I wonder to what extent the complexity of the rust language hurts performance. We all only have so much mental capacity, if much of it is spent on the various different intersections of rust's features, that reduces how much we can spend on making things fast.

(I like Rust btw)

nicoburns 2 hours ago | parent [-]

The alternatives with the potential to be as fast (C, C++, D, zig) are more complex in this regard because they make memory safety and lifetime tracking something that you have to keep track of in your head. Rust's biggest win is removing that mental overhead while allowing you to achieve the same performance as those other languages.

LAC-Tech 44 minutes ago | parent [-]

Rust also hides allocation, and both the standard library and community best practices encourage many smaller allocations, which makes it much harder to reason about performance characteristics of your code.

So what you say is definitely true if you do an allocation heavy, heap fragmenting, RAII style of programming. Which is the context Rust was born in, right? A kind of C++ app dev context where that was (is?) the prevailing meta.

You're also completely glossing over the incredible complexity you get in all thee weird intersection of rust features. And there are a LOT of features. Reasoning about those are not free from a mental overhead stand point.