What it feels like when Rust saves your bacon
11–20 of 192 posts
Re: What it feels like when Rust saves your bacon
#12Re: What it feels like when Rust saves your bacon
#13This article is super overcomplicated. All it had to say was that rust tells you when you keep reference to on stack variable after it goes out of scope. Context provided adds nothing. I must say - as someone who doesn't use rust - I haven't had this type of issue in years, and when I did it wasn't hard to debug. You get corrupted data, set data breakpoint and in the provided example you will see it being modified by…
Re: What it feels like when Rust saves your bacon
#14I was looking for some kind of story related to cooking bacon with Rust -> disappointed. Bacon is only used once - in the heading...
Re: What it feels like when Rust saves your bacon
#15I was looking for some kind of story related to cooking bacon with Rust -> disappointed. Bacon is only used once - in the heading...
Re: What it feels like when Rust saves your bacon
#16Yes... but before you start feeling too sure about Rust protecting you from creating bugs, also consider this more cautionary (and very entertaining) tale posted on HN today: https://hacks.mozilla.org/2022/06/fuzzing-rust-minidump-for-...
> I needed a bit of palette cleanser This is a fun mistake. It’s “Palate cleanser”.
Re: What it feels like when Rust saves your bacon
#17Part of the confusion is the very confusing (for a noob) difference between String and &str and as someone who has written C and C++, I don't have a problem with understanding references and addresses but I didn't find a very good explanation. This led me to writing code using the only way I could get it to compile that didn't crash at runtime (which was nice!) but it also didn't work.
The second issue was that being something plugging into an external daemon, at the interface level, we were getting a raw pointer and had to convert it into a string to use it. I tried so many combinations but couldn't get it to work but thanks to the maintainer of the Rust crate (who obviously knew what he was doing) he told me where my code was wrong and I fixed it.
So I guess good in that there were probably no horrific bugs, although this is much like C# or possibly Java. But yes, the strong checking doesn't stop things from not working.
Re: What it feels like when Rust saves your bacon
#18Yes... but before you start feeling too sure about Rust protecting you from creating bugs, also consider this more cautionary (and very entertaining) tale posted on HN today: https://hacks.mozilla.org/2022/06/fuzzing-rust-minidump-for-...
You mean the tale of someone rewriting a very complex and fiddly software from scratch, having it work great in production, and then using the ecosystem's great tooling to easily find and eliminate even more bugs than what the language already protected them from?
And fuzzing originated in C / C++ tools and is available for them as well, probably more diverse and mature than what is available in Rust.
The point you did ignore was: Rust is being sold as magically making software safe and people selling that completely ignore the fact that logical bugs are also a thing.
Which Rust evangelists find difficult to acknowledge because security is that one thing that Rust has going for it.
So difficult that you would rather try to misdirect than to acknowledge that software written in Rust will crash. And when processing arbitrary user output, it'll crash badly when not written with care and fuzzed a lot. Kind of like C++.
Re: What it feels like when Rust saves your bacon
#19Earlier quoted context omitted.
You mean the tale of someone rewriting a very complex and fiddly software from scratch, having it work great in production, and then using the ecosystem's great tooling to easily find and eliminate even more bugs than what the language already protected them from?
The thing they rewrote also worked great in production. And fuzzing originated in C / C++ tools and is available for them as well, probably more diverse and mature than what is available in Rust. The point you did ignore was: Rust is being sold as magically making software safe and people selling that completely ignore the fact that logical bugs are also a thing. Which Rust evangelists find difficult to acknowledge b…
It didn't for them, that's why they rewrote it.
> Rust is being sold as magically making software safe and people selling that completely ignore the fact that logical bugs are also a thing.
By whom? I don't think memory safety bugs are the only class of bugs, and neither do you, so who are you arguing against?
> Which Rust evangelists find difficult to acknowledge because security is that one thing that Rust has going for it.
Hard disagree. Rust also offers a solid type system, pain-free dependency management and all-around good tooling, just to name a few. It's much more than a "memory-safe C++" or whatever.
> And when processing arbitrary user output, it'll crash badly
If your definition of "badly" is "at a well-defined point, without any memory corruption", sure. But even here memory safety prevents what could be a much more painful debugging experience.
Re: What it feels like when Rust saves your bacon
#20This article is super overcomplicated. All it had to say was that rust tells you when you keep reference to on stack variable after it goes out of scope. Context provided adds nothing. I must say - as someone who doesn't use rust - I haven't had this type of issue in years, and when I did it wasn't hard to debug. You get corrupted data, set data breakpoint and in the provided example you will see it being modified by…
You can get a long way towards safety without learning Rust. It's those rare cases that will get you.
It's a trade-off; take the time to learn the language and deliver later, or just use what you already have to deliver a product now.[1]
[1] During a Rust discussion some years back, when I was at a different company, on a specialised and large-ish product written in C++03.
I went through about 3 years of tickets (limited to only the bugs reported). No open ticket was older than a few weeks. Out of maybe 1000 bugs, only a single one was something Rust would have prevented. I would think that most mature products will have similar stats, so the trade-off is not as obvious as it looks to be on the surface.
Deliverables matter.