Hacker News new | ask | show | jobs
by ZenoArrow 3457 days ago
>"Until we start seeing some more balanced (frankly, I'd settle for nuanced) discussion about the compromises made to get Rust's strengths, I'm staying the hell away from it."

Look into the issues surrounding the borrow checker, that's one of Rust's main pain points. Long compilation times are another common issue.

To Rust fans, I realise both of those issues will be addressed to some degree as MIR matures, but I'm looking for flaws as things stand now.

2 comments

Another couple of flaws that could have a big impact on Rust.

- It will be super hard to hire for Rust for a long time. It would be a very bold move to write your app in Rust if you plan to grow your tech team anytime soon.

- I havn't tried learning Rust myself, but I have read that little that it can be a little tricky to start thinking the rust way (borrowing?) Plus the language "looks" hardcore. I wonder if that will put off new devs.

There have comments on HN to the effect that, paradoxically, it's easy to find Haskell developers to hire, because there are so many jobs that require working with more mainstream languages. I would hope the same principle applies to Rust.
You might even hire some of us Haskell programmers.
> super hard to hire for Rust for a long time

Good programmers aren't strongly bound to language. Hire any systems programmer and have that person learn Rust.

Very true, also it's not really a weakness for Rust, but any new language / tools.
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 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.

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<S: AsRef<OsStr> + ?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)

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.
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.
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.

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

It is if it drives potential community members away.

No one's being driven away. Only people who had no intention on trying Rust are complaining about it.
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.