4 ms·
If you want to do the basic things that rust wants you to do it doesn't take that long. However if you want to create any graph like data structures you need t
by jackyinger 10y ago
If you want to do the basic things that rust wants you to do it doesn't take that long.
However if you want to create any graph like data structures you need to go into unsafe rust.
For example, the std doubly linked list uses unsafe with error handling to do inserts because the compiler cannot be sure that an insert is safe.
In my opinion Rust's safety is overhyped and entirely dependent on good implementation of unsafe code. And judging from the liked list example there is no way for all rust code to be intrinsically safe.
- coldtea 10y ago>In my opinion Rust's safety is overhyped and entirely dependent on good implementation of unsafe code. That's short-sighted. Of course it's "entirely dependent on good implementation of unsafe code". But that's inconsequential, as unsafe code in a library, especially one used by everybody, is much easier to make safe than unsafe code all around. And after you trust an unsafe lib you use to be sound, your own safe-only code can never breach that safety. You'll be guaranteed that any issue will be on the unsafe part. It's all about compartmentalization.
- Rusky 10y ago> In my opinion Rust's safety is overhyped and entirely dependent on good implementation of unsafe code. ...as is true of any safe language, which is dependent on a good implementation of its compiler or interpreter. Rust just happens to move some of that into the language where it can be extended.
- caconym_ 10y agoShow me a programming language that lets you manipulate raw pointers while providing the same safety guarantees as safe Rust code (i.e. have your cake and eat it too) and I'll accept this as a valid criticism of Rust. Until then, I"m going to keep thinking that Rust provides a reasonable, practical compromise. For about a year, I've been regularly using Rust to write real software that I actually use, and I've never had to write unsafe code. I'm trusting other people to do it, which is never not the case, no matter what programming language I'm using.
- jackyinger 10y agoBy definition manipulation of raw pointers is unsafe. So no language can do that. Sure Rust's typed pointers can be safe as long as libraries fulfill their garuntees. My main point is that safety rests upon the library correctness. And I can see the value of the interlocks this provides. However it is not infallible as the word safe suggests. I'll admit that I have not grokked rust, but I did give it a reasonable try. Perhaps all my C hacking has ruined me. :)
- caconym_ 10y ago> My main point is that safety rests upon the library correctness. And I can see the value of the interlocks this provides. However it is not infallible as the word safe suggests. I don't disagree with that. Sometimes I don't totally love how the Rust people market the language, and I can see how the statements they make about safety could rub their target audience the wrong way, but I don't know how I'd do it better. I really do think the language does a great job helping programmers write fast, safe, bug-free code... once they get over the learning curve. If you ever feel like taking another crack at it, this is the reference that made the memory model stuff (which is the trickiest bit IMO) click for me: http://cglab.ca/~abeinges/blah/too-many-lists/book/ http://cglab.ca/~abeinges/blah/too-many-lists/book/
- jackyinger 10y agoI don't see why a dissenting opinion gets beaten up here... wouldn't it be better for the community to address the perceived deficiencies with solutions? My main issue is that I found creating graphs is unwieldy. Where in C or Python I can just whip one up. Is there a reasonably easy way to do it without depending on a library (like petgraph)?