3 ms·
Users who write Rust code don’t necessarily know the underlying optimization (nor should anyone expect that they do). Do you think the title is still inaccurat
by Hackbraten 5y ago
Users who write Rust code don’t necessarily know the underlying optimization (nor should anyone expect that they do).
Do you think the title is still inaccurate even from that point of view?
- pdimitar 5y agoThe entire article could basically be boiled down to your first sentence + the two code examples. And IMO the title is still inaccurate because it attacks a general promised/desired property of Rust (and other languages) and I honestly don't see the connection. Looks like the observed behaviour is an unfortunate side effect of the `newtype` thing and is very prone to fixing and optimization in future versions. It's not a failure of the "zero-cost abstraction" ideal which is being chased after every day and is still in flux.
- YawningAngel 5y ago> nor should anyone expect that they do I'm not a systems programmer, so I might be wildly off base in what I'm about to say. However, isn't it in fact expected of systems programmers that they do understand in detail what the compiler will do with their code?
- markenqualitaet 5y agoAs a Rust beginner, I would never assume code I write to not be executed, or cut out by the compiler. I know this sometimes happens, but I wouldn't count on it for lack of understanding. I don't think that's anyone's expectation who doesn't know the inner workings well, really.