News for hackers. Stuff that matters.

Marzepansion

Re:in Rust, methods should be object safe on Saturday June 01, 2024 @05:23PM (#40549177)
This might be your experiences, but I've never worked with people who called member functions methods in C++. I've seen C# programmers who had never worked with C++ call them that, but in the C++ teams I can't recall an instance of that, even for multi lingual engineers

Though I do tend to work with teams where the average age is higher than the industry average, that might be warping my anecdotal experiences

I have had situations where the distinction matters, and they aren't academic either, but in API design, especially for libraries

Re:The Rust Calling Convention We Deserve on Friday April 19, 2024 @01:00PM (#40089229)
The poster is both correct and incorrect. It definitely is true that LLVM only has two instructions to deal with division, udiv and sdiv specifically, and it used to be the case that Rust as a consequence had UB when encountering division by zero as a result as those two instructions consider that operation UB.

But Rust has solved this problem by inserting a check before every division that reasonably could get a division by zero (might even be all operations, I don't know the specifics), which checks for zero and defines the consequences.

So as a result divisions aren't just divisions in Rust, they come with an additional check as overhead, but they aren't UB either.