4 ms·
> But it cant really present the million of other types of vulnerabilities, such as mis-configuration, wrong logic in the code, races, etc That's correct. The
by est31 8y ago
> But it cant really present the million of other types of vulnerabilities, such as mis-configuration, wrong logic in the code, races, etc
That's correct. The great achievement that Rust brings to the table is that it gives you the safety of a traditionally dynamic language like Java or JS with native performance.
Let's look at it from a security angle.
For some domains, the security that Rust provides is enough to create really safe solutions inside those domains. Think of PDF viewers, image viewers, browsers, etc. Here, it takes in untrusted input, parses it, and displays it to the user, and the codepaths where privileged stuff happens, e.g. reading arbitrary files, are only very sparse.
In some domains, Rust alone won't be enough. Think of TLS implementations or kernels. Here, almost any logic bug is also security relevant. Ideally you'd have computer proofs for their security. The language is largely irrelevant, all you need is support for your language in the proof tool.
Now, let's look at it from a development angle:
C requires you to manually malloc, free and check whether the malloc was successful. Rust does that for you, and although there are no "failible" allocators in the standard library, the language itself doesn't prevent you from writing your own containers etc. that do it, if you really need failible allocators.
The bugs that Rust prevents are precisely those kind of bugs that are most annoying to debug. I'm very glad that I don't have to deal with stuff like this [1] or this [2] any more. For the second bug, it wasn't even a crash, it just had weird behaviour. Classical nasal demons.
[1]: https://github.com/minetest/minetest/commit/57a461930ba13b0b499c334d77e4b6a0aa73606b https://github.com/minetest/minetest/commit/57a461930ba13b0b...
[2]: https://github.com/minetest/minetest/commit/1f76808e4fa5a198f1dbddba6fa18ea1ecb20cb6 https://github.com/minetest/minetest/commit/1f76808e4fa5a198...
- eeZah7Ux 8y ago> The great achievement that Rust brings to the table is that it gives you the safety of a traditionally dynamic language like Java or JS with native performance. Plenty of other modern and old languages are equally fast and memory safe. Calling it a "great achievement" is unfair to other languages.
- est31 8y agoWhich language do you have in mind?
- adwn 8y ago> Plenty of other modern and old languages are equally fast and memory safe. Name three. I don't know any language that is both memory safe and as fast as Rust. ATS might fit the bill, though from what I've read, it has rather exotic semantics and an even steeper learning curve than Rust.
- pjmlp 8y agoAda, D, Swift, .NET Native, OCaml, Haskell, Oberon-2, Modula-3, Active Oberon, Component Pascal, Sing#, System C#, Eiffel, Java (AOT compiled), Common Lisp, Swift.
- adwn 8y ago> Ada, D, Swift, .NET Native, OCaml, Haskell, Oberon-2, Modula-3, Active Oberon, Component Pascal, Sing#, System C#, Eiffel, Java (AOT compiled), Common Lisp, Swift. None of those are as fast as Rust, at least not in all cases [1]. Sure, they're within the same order of magnitude performance-wise, but software engineering is probably the only technical discipline which dismisses a factor of 2 as irrelevant – compare the automotive, aerospace, or energy generation industries, which fight for single-digit percent efficiency gains. [1] I'm talking about idiomatic code, not turning-Haskell-into-an-even-uglier-version-of-C or similar.