News for hackers. Stuff that matters.
Re:Performance of Rust Language [pdf] by edevrk on Tuesday May 26, 2026 @06:06AM (#48277516)
> Panics in Rust do not currently time-travel like that (including panics from failed bounds checks), and that's a good thing.

Is it a "good thing" in all ways? Does it make Rust slower than C++ in some cases? And if Rust wants to catch up to C++ in regards to performance, do you believe that Rust people like yourself will have to convince C++ language people to remove time travel optimizations? Not very nice or honorable of you. Why not focus on making Rust faster instead?

Edit:

Why does kibwen sound like a cheap whore putting on airs? As if, kibwen couldn't be honest or competent even if its (pronoun: thing) life depended on it.

Re:Performance of Rust Language [pdf] by zozbot234 on Tuesday May 26, 2026 @08:07AM (#48278597)
If you can detect a case where a panic "time traveling" would meaningfully improve performance, you could simply let the compiler issue an optional warning that would allow for auto-fixing the code to have those different semantics.
Re:Performance of Rust Language [pdf] by nicoburns on Tuesday May 26, 2026 @07:01AM (#48278006)
A little slower but safe is a pretty good default I think. Most of the time you're not in a hot loop and even a 5% slowdown would be negligable.

And in the cases where you are in a hot loop you just have to put in a little extra effort to optimise it and gain the performance back, either by writing the code in a way that allows the compiler to prove correctness (e.g. using an iterator or assert), or by using the unsage keyword to "pinky-promise" to the compiler that your usage is correct.

IME that extra effort in performance-critical places almost always ends up being a lot less than the effort needed to avoid correctness/safety issues in mundane boilerplate/glue/plumbing code in C++.

Especially as Rust's package management system means that often you don't even have to do that optimisation work yourself: you can just pull in a crate that's done it for you (and Rust's safety guarantees make that a much less scary thing to do than it is in C++)

Re:Performance of Rust Language [pdf] by edevrk on Tuesday May 26, 2026 @07:19AM (#48278160)
Your comment is at odds with the submission and lots of comments here.

Did you generate your comment using LLM?

> negligable

Negligible.

Re:Performance of Rust Language [pdf] by nicoburns on Tuesday May 26, 2026 @07:50AM (#48278431)
> Did you generate your comment using LLM?

(It was hand written. Typos and all.)

Re:Performance of Rust Language [pdf] by kibwen on Tuesday May 26, 2026 @06:26AM (#48277675)
C++'s experience has caused Rust to rightfully learn the lesson that you don't allow optimizations to change the semantics of the program like that. Rust's goal is to be fast enough that any performance difference between C or C++ is too negligible to bother considering, and it's achieved that. It's not going to sacrifice reliability on the altar just to make up a measly 3% gap. There are plenty of ways that Rust's stricter semantics allow it to produce faster code than C++ (no move constructors or implicit copy constructors, thorough reference aliasing information, automatic generic struct layout optimizations, safe non-atomic refcounting, safe concurrent stack references, less defensive copying, etc.), it does not need to "convince C++ language people" of anything.
Re:Performance of Rust Language [pdf] by edevrk on Tuesday May 26, 2026 @06:53AM (#48277934)
Why do you sound like a cheap whore putting on airs? As if, you couldn't be honest or competent even if your life depended on it.