Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

How often has one of your Rust programs segfaulted for you, when it wasn't a bug in your own unsafe code (as opposed to that in the standard library)? For me, the count still stands at zero.

I've been writing Rust for well over a year. I like to abuse new features and I've found many compiler bugs, but my code doesn't crash at runtime.

I'm not saying it doesn't happen, and the plural of anecdote is not data, but I think you're grossly misrepresenting Rust's practical safety benefits. That you only have to trust code in unsafe blocks, rather than all the code everywhere, is a huge benefit.



Have you used any of the graphical bindings?

maybe once a fortnight for me?

I'm certainly not trying to bash rust, and I do apologise if it comes across that way.

I just think a bit of realism makes everything look much more sincere and plausible.

As you say 'Rust cannot crash' is false. 'Rust has never crashed for me' could well be a completely true thing to say. Also, 'Its so much easier to write rust code (than say c) that doesnt crash!'

I completely ok with all of those.

..but 'you can do anything in rust and its always perfectly safe!' or 'rust programs dont have to worry about security issues' or 'It is effectively impossible to have an unsafe memory access error in Rust'?

Those are people being enthusiastic (good) but unfortunately spreading misinformation (bad) and making the rust community look bad (very bad).

I just wish people could be excited about the the things that are actually exciting about rust. I feel like this whole safety thing is a massive distraction.

fast, low level, concurrent and managed memory with no cost is both accurate and exciting about rust.

'helps avoid bugs and race conditions' isn't very exciting to me, but I acknowledge its important.

I guess 'completely provably safe!' is exciting to some people; but since its not true, Id prefer not to get people excited about rust that way.


The safety thing isn't a massive distraction. It's a major part of the point of Rust, whether it's exciting to you or not.

The graphical bindings you're using are not part of the standard library, which is why I specifically asked about that. I know there are bugs in third-party dependencies in Rust, because there are many C bindings that aren't exposed safely by those libraries. I've segfaulted using a TrueType binding library, for example, because it was not actually exposed in a way that prevented double frees. But writing a bad binding is something you can do just as easily in Ruby, or Java. The standard library is what we were originally talking about. I wouldn't disbelieve you if you said you crashed every fortnight using only standard library code, but I would probably press for details.

I am not saying Rust is "completely provably safe", but nothing is. You always have some trusted software or hardware that, if it screws up, will compromise your program. Rust's advantage is that it allows you to be explicit about what parts are trusted and what parts aren't. It vastly reduces the potential attack surface.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: