Live data from Hacker News

Rust is Software's Salvation

redox-os.org

91–100 of 182 posts

Re: Rust is Software's Salvation

#91

Earlier quoted context omitted.

I get what you are saying. "Software's Salvation" might require more than compile time type checking. I'm a huge strong typing fan! I'm just saying, type systems can get you a long way toward correct construction. (Or correctness by construction...) The issues with the software/computing world are bigger than array bounds checking and type correctness.

> The issues with the software/computing world are bigger than array bounds checking and type correctness. Annoyingly, these bugs still bring down our systems in an age when we're on the verge of self-driving cars. Can you imagine that? Your car can crash because somewhere a programmer messed up a simple bounds check. By removing the possibility of these small annoying bugs, you leave the programmer free to focus on…

Again, I get where you are going with this.

Rust isn't the only solution. There are mechanisms that can be used in C++ to make a program memory safe by construction. I'm not even saying that Rust isn't a good solution. (I am saying I don't like the syntax...I'm sure I could get used to it at some point.)

I just get very wary when something has this kind of "evangelism" behind it. That's all. I'm really looking forward to seeing what Mozilla does in Firefox with it.

Re: Rust is Software's Salvation

#93
post #38

Earlier quoted context omitted.

Could you please tell more about borrow checker issues?

I assume they're talking about the fact that basically everyone that learns Rust goes through a period of "fighting the borrow checker". Part of the way that rust ensures memory safety is by preventing you from doing things that it can't prove are safe to do. For people coming from languages like C or C++ they've been able to get away with doing things that are probably unsafe but that work either through luck or ver…

Honestly, I found dealing with generics worse than the borrow checker. Since the compiler wants everything to be sized, code that I think should work (i.e. using generics and traits) will sometimes just not compile. In fact - I'm dead in the water facing an issue like that right now. That is, by far, the most frustrating thing in using Rust.

Re: Rust is Software's Salvation

#94
post #38

Earlier quoted context omitted.

I assume they're talking about the fact that basically everyone that learns Rust goes through a period of "fighting the borrow checker". Part of the way that rust ensures memory safety is by preventing you from doing things that it can't prove are safe to do. For people coming from languages like C or C++ they've been able to get away with doing things that are probably unsafe but that work either through luck or ver…

Honestly, I found dealing with generics worse than the borrow checker. Since the compiler wants everything to be sized, code that I think should work (i.e. using generics and traits) will sometimes just not compile. In fact - I'm dead in the water facing an issue like that right now. That is, by far, the most frustrating thing in using Rust.

Have you asked for help on one of the various forums? If something is leaving you dead in the water, I'd like to help you fix that.

Re: Rust is Software's Salvation

#95
post #38

Earlier quoted context omitted.

I assume they're talking about the fact that basically everyone that learns Rust goes through a period of "fighting the borrow checker". Part of the way that rust ensures memory safety is by preventing you from doing things that it can't prove are safe to do. For people coming from languages like C or C++ they've been able to get away with doing things that are probably unsafe but that work either through luck or ver…

Honestly, I found dealing with generics worse than the borrow checker. Since the compiler wants everything to be sized, code that I think should work (i.e. using generics and traits) will sometimes just not compile. In fact - I'm dead in the water facing an issue like that right now. That is, by far, the most frustrating thing in using Rust.

Just ask for help in IRC or your local Rust community and you'll get help. If you want - post here link to gist.github and I'll try to help.

Re: Rust is Software's Salvation

#96
post #38

Earlier quoted context omitted.

I assume they're talking about the fact that basically everyone that learns Rust goes through a period of "fighting the borrow checker". Part of the way that rust ensures memory safety is by preventing you from doing things that it can't prove are safe to do. For people coming from languages like C or C++ they've been able to get away with doing things that are probably unsafe but that work either through luck or ver…

Honestly, I found dealing with generics worse than the borrow checker. Since the compiler wants everything to be sized, code that I think should work (i.e. using generics and traits) will sometimes just not compile. In fact - I'm dead in the water facing an issue like that right now. That is, by far, the most frustrating thing in using Rust.

Can you describe the issue? Perhaps someone can help.

I don't know if it helps you or not, but you can specify that a type parameter need not be sized with the ?Sized bound. e.g., The `Path::new` constructor is defined as `fn new + ?Sized>(s: &S) -> &Path`. This means `S` can, for example, be `str`, which is an unsized type.

Re: Rust is Software's Salvation

#97
post #56

The reality is Rust will never be mainstream because 95% of the dev use php / ruby / python / java / c# and Rust is far too complicated to switch from those. That's where imo Go will prevail, it's a simpler language that is easy to use / learn.

yea, one of the reasons python gained traction was it being used in alot of cs101 classes. I wouldnt use rust, but I have used go just to learn

Re: Rust is Software's Salvation

#98

Earlier quoted context omitted.

I think you'll find a lot of Rust's supporters actually come from a Systems Programmers background who've felt the pain before. I've been doing C/C++ for close to 15 years now, I find that the borrow-checker not only helps with safety but also with guiding a good architectural foundation. Nothing keeps you from dropping into an unsafe block and cranking out very c-like code if you want as well. All my green-field cod…

I have too but I don't see any magic in Rust's borrowing beyond what you would get with using shared_ptr, weak_ptr and move semantics in C++11. Yeah there is a certain class of errors that the Rust compiler will check that will still give you a segfault in C++. But it doesn't get around the programmer still needing to have a firm understanding of RAII and the difference between the stack and heap in order to be effec…

Rust is actually much closer to unique_ptr than shared_ptr or weak_ptr. The use of Rc is pretty small in practice.

The thing is that even with unique_ptr I can easily reach in via get() and I've broken the shared mutable state contract. It's trivial for me to trace what modifies things in Rust, I just follow the 'mut' annotations and since only one thing can hold it at a time it's very straightforward.

Rust also has one the best package managers I've seen. Union types which are the best way to represent states and state machines bar none. An iterator class that's the best I've seen(seriously has anyone actually used ? How man begin/end pairs do I need?).

Plus the community is super-welcoming, there's more reasons but those are my top ones right now.

Re: Rust is Software's Salvation

#99
post #56

The reality is Rust will never be mainstream because 95% of the dev use php / ruby / python / java / c# and Rust is far too complicated to switch from those. That's where imo Go will prevail, it's a simpler language that is easy to use / learn.

yea, one of the reasons python gained traction was it being used in alot of cs101 classes. I wouldnt use rust, but I have used go just to learn

What about Pascal, isn't it still more widely used in cs101 than anything else? And yet, no traction.

Re: Rust is Software's Salvation

#100

Earlier quoted context omitted.

Honestly, I found dealing with generics worse than the borrow checker. Since the compiler wants everything to be sized, code that I think should work (i.e. using generics and traits) will sometimes just not compile. In fact - I'm dead in the water facing an issue like that right now. That is, by far, the most frustrating thing in using Rust.

Can you describe the issue? Perhaps someone can help. I don't know if it helps you or not, but you can specify that a type parameter need not be sized with the ?Sized bound. e.g., The `Path::new` constructor is defined as `fn new + ?Sized>(s: &S) -> &Path`. This means `S` can, for example, be `str`, which is an unsized type.

Thanks guys - much appreciated. I'm on my mobile in another country, so, can't post a link right now - but I will later tonight when I've WiFi.

BTW - this reaction is why I continue to work with Rust; the community is awesome!

(Dealing with trait objects and generics...less so)

Post reply on HN