4 ms·
> It's possible to make buggy, slow, crappy software in any language. True. > Rust is no exception. Also true. > Nobody should derive any confidence from th
by jolux 5y ago
> It's possible to make buggy, slow, crappy software in any language.
True.
> Rust is no exception.
Also true.
> Nobody should derive any confidence from the language a product is written in.
This, on the other hand, is a non-sequitur, or at least it's too strong, because Rust can do things that C can't do: safe deterministic memory management and safe concurrency without data races. These things are not just available, they are the defaults in Rust. You have to go out of your way to get these things wrong. So, I wouldn't derive absolute confidence from an application being written in Rust. But I'd be willing to bet a whole lot that it has fewer memory bugs than an equivalent application written in C.
- SkyMarshal 5y ago> they are the defaults in Rust. Exactly, this is what I should have explicitly said. Language defaults have a powerful effect on a project's norms and culture. > You have to go out of your way to get these things wrong. Yes, you actually have to try to write shitty Rust code, at least where there are defaults that prevent it. Thus the average Rust program will have that baseline level of quality. Like TQM/TPM/Six-Sigma for manufacturing software.
- pjmlp 5y agoLike ActixWeb?
- jolux 5y agoDo you think Actix Web would be safer if it were written in C++?
- pjmlp 5y agoProbably not, the point was that being in Rust wasn't either.
- mmstick76 5y agoBut the point is the exact opposite because any use of unsafe is clearly marked as such, and therefore a code audit will instantly find its use and question it. Hence the fallout surrounding it.
- pjmlp 5y agoHow do you find unsafe on a binary library? Also that is besides the point, unsafe only deals with a very specific cause of errors that plague C code bases (and those of languages copy-paste compatible with it). Rust's unsafe wouldn't have done anything to protect against an hypotetical log4r.
- jolux 5y agoMy point is that Actix Web was still safer than it would have been if it were written in C++ (which is Rust’s whole goal as far as safety), and moreover the norms of the Rust community are so strong that most of the unsafe usage has since been removed, since it was unnecessary. Unsafe deals with memory errors, which are consistently the largest class of security vulnerabilities in native codebases. This is uncontroversial at this point. Rust won’t protect you from log4j, but it never claimed to. Java still protects you from mishandling memory, despite all the stupid automatic classloading features we keep discovering in it.
- nicoburns 5y agoIMO the fact that the actix-web debacle was so well publicised speaks volumes in itself. The issues were actually discovered ahead of time by people reading the source code rather than people encountering bugs or vulnerabilities in the wild. That's a huge improvement over C software. Of course there are still bugs in Rust programs and libraries, but much fewer. And I think fewer to the point that eliminating them entirely might actually be feasible with enough effort.
- pjmlp 5y agoFor every vocal example there are tons that fly under the radar until they are on the news for the wrong reasons. It is no accident that Ada and Java also have security guidelines similar to MISRA, because even with memory corruption bugs out of the picture, as log4j newly remided us, security only happens when it is part of the daily process, regardless of the language.
- southerntofu 5y agoYes, pretty much like that. The author put "unsafe" blocks everywhere and the rest is history. Unsafe as a keyword is a kind of pledge: as a dev, you swear to the compiler that you've checked this part for correctness/safety. If you don't, you may get bitten, but the simple fact that "grep -R unsafe" will yield most (if not all) instances of potential memory fuckups is a huge win for auditability.
- pjmlp 5y agoRust's unsafe wouldn't have done anything to protect against an hypotetical log4r. As for the memory fuckups you are right, pity that they are using a C GUI library. Even if the binding has been deemed safe upon validation, if only remains a valid certification until the next Gtk version update, even minor ones might break the assumptions validated on the unsafe code block.
- southerntofu 5y ago> Rust's unsafe wouldn't have done anything to protect against an hypotetical log4r. You are correct. No programming language will protect you from writing flawed application logic. > pity that they are using a C GUI library. (...) Gtk version update, even minor ones might break the assumptions I don't know about that. GTK is more "battletested" than most frameworks, and has a lot of contributors to fix bugs. Also, and that's a very important point, GTK cares for accessibility! Using any other framework would have meant excluding a lot of people from the GUI. As for assumptions, i certainly hope GTK devs don't push breaking changes to the ABI on minor updates. But i guess that's yet another assumption that can be broken.
- hderms 5y agoIsn't the whole reason you're mentioning actix-web because the community mostly balked at the amount of unsafe code in it? Surely that should be some evidence that the norms in Rustland are qualitatively different in many ways to what you'd find elsewhere?
- LoveMortuus 5y agoNon-sequitur definition: noun a conclusion or statement that does not logically follow from the previous argument or statement. "his weird mixed metaphors and non sequiturs"