News for hackers. Stuff that matters.
Re:Rust is Software's Salvation by EugeneOZ on Thursday December 29, 2016 @06:15PM (#13281068)
Could you please tell more about borrow checker issues?
Re:Rust is Software's Salvation by azdle on Thursday December 29, 2016 @06:28PM (#13281154)
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 very careful planning. But since the borrow checker can't prove that some of these tricks are safe it will just say "no" and fail to compile.

Within a couple weeks you will get the hang of what the borrow checker can actually handle and you'll mostly not have problems except when you are actually making a genuine mistake.

Re:Rust is Software's Salvation by allengeorge on Thursday December 29, 2016 @07:26PM (#13281488)
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 by burntsushi on Thursday December 29, 2016 @07:29PM (#13281508)
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<S: AsRef<OsStr> + ?Sized>(s: &S) -> &Path`. This means `S` can, for example, be `str`, which is an unsized type.

Re:Rust is Software's Salvation by allengeorge on Thursday December 29, 2016 @07:40PM (#13281570)
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)

Re:Rust is Software's Salvation by steveklabnik on Thursday December 29, 2016 @07:28PM (#13281499)
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 by EugeneOZ on Thursday December 29, 2016 @07:28PM (#13281502)
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 by ZenoArrow on Thursday December 29, 2016 @06:28PM (#13281147)
Re:Rust is Software's Salvation by EugeneOZ on Thursday December 29, 2016 @06:40PM (#13281221)
Quote: "Rust's borrow checker is a wonderful thing that forces you into designing code to be more robust. But as it is so unlike anything you're used to, it takes time to develop a certain knack to work with it efficiently."

I don't think it's description of an issue.

Re:Rust is Software's Salvation by ZenoArrow on Thursday December 29, 2016 @07:50PM (#13281630)
>"I don't think it's description of an issue."

It is if it drives potential community members away.

Re:Rust is Software's Salvation by mmstick on Thursday December 29, 2016 @10:09PM (#13282213)
No one's being driven away. Only people who had no intention on trying Rust are complaining about it.
Re:Rust is Software's Salvation by ZenoArrow on Friday December 30, 2016 @07:39AM (#13284073)
There's plenty of comments about it in the Rust subreddit, coming from people who have tried it.

Look, it's not an issue for all time, there are plans to improve it, I'm just suggesting it as a point of friction right now. If you seriously don't think it's an issue, what would you say are the issues? You won't do yourself any favours if you try to pretend Rust is perfect.

Re:Rust is Software's Salvation by mmstick on Friday December 30, 2016 @12:16PM (#13285539)
I've been writing software exclusively in Rust since the 1.0 release. I have no issues with the borrow checker, personally. I haven't seen the borrow checker mentioned as an issue on the Rust subreddit, which I frequent.

The only people who have issues are people who've used Rust for less than a week and still do not understand the basic rules of the borrow checker. I've explained it many times to people already. Once you know the rules, it's easy peasy, and you'll never have another complaint from the borrow checker ever again.

The only improvements that I could see for Rust is landing non-lexical borrows, macros 2.0, and faster compile times, albeit compile times are largely fixed now. A 100K combined LoC project can easily compile a release build using 1 core in 3 minutes or less.

Re:Rust is Software's Salvation by burntsushi on Friday December 30, 2016 @02:26PM (#13286641)
It took me quite a bit longer than a week to completely internalize the borrow checker. Probably closer to a small number of months. I still sometimes run into problems, but I have enough experience now to know what the space of solutions looks like.

Let's be careful not to overstate Rust's benefits and understate Rust's costs. Of course, I do happen to think the benefits are overwhelming compared to the costs. :-)

Re:Rust is Software's Salvation by EugeneOZ on Friday December 30, 2016 @08:07AM (#13284172)
Borrow checker learning curve is an issue, of course. But not checker itself.
Re:Rust is Software's Salvation by ZenoArrow on Friday December 30, 2016 @10:59AM (#13284950)
You do realise you've wasted both my time and your own. If you thought about it from the start, it's obvious that I was referring to the learning curve. All facets of all Turing-complete languages are useful once you've overcome the learning curve. What varies is the length of time needed before you become proficient in using it. For another example...

The learning curve for manual memory management in C is a major issue, but not the principal of manual memory management itself.

Re:Rust is Software's Salvation by EugeneOZ on Friday December 30, 2016 @11:30AM (#13285179)
No, I think I made important distinction. There can be issue with technology and there can be issue with learning curve.
Re:Rust is Software's Salvation by ZenoArrow on Friday December 30, 2016 @01:24PM (#13286073)
The article I shared with you previously was about the learning curve.