Hacker News new | ask | show | jobs
by jug 1393 days ago
I think it's a combination of evangelism and excitement but also of a fallacy, thinking that a Rust application ought to be faster and more efficient with system resources, so people "helpfully" inform of this.

As any developer knows, a low level programming language may help you get there, but ultimately this is mostly dependent on code quality. Rust applications can be absolutely riddled with bugs and use O(n^2) algorithms where they don't need to, or have awesome code but rely on third party libraries that don't. There's just so much surrounding the core aspects of the language that we just can't judge applications based on their programming language.

Rust does protect against buffer overflows and pointer misuse etc but so does many other languages nowadays, for example by directing the developer away from (or not even supporting) the use of low level unchecked pointers in the first place.

2 comments

Low-level languages enable speed, they don't guarantee it, high-level languages enable safety, but don't guarantee it either. Rust enables both, and I would also argue that it makes safety and speed more likely. Not guaranteed, but no other language really guarantees that either.
Rust seems to need way more code optimisation than other languages to run faster/ at same level. For example Go is way simpler to write and is just fast without even optimising code. Rust is faster for sure but from what I see only if you really know what you do and optimise the code. Therefore I also wonder where exactly all this hype is coming from and for what exact reason to be honest because most developers won’t write optimised code in Rust (at least this is my assumption) and take advantage of it being faster.
I assume folks who write optimised Rust have some experiences writing optimised C/C++... which means the domain is a bit narrow, usually microcontroller stuff, computer vision, OS kernel, etc.

On the other side, I agree perhaps we don't have to (re)write anything in Rust.