Hacker News new | ask | show | jobs
by carlmr 3072 days ago
I thought the same until I actually tried Rust. The compiler will complain in a some places which are ok if you know what's happening. It was probably easier to implement the borrow checker that way. At the same time a lot of the error messages are very cryptic if you haven't seen them before. It is in that sense hard to please. A lot of this might become better with coming iterations though.
1 comments

Now, this is true in many senses, as it's inherently how static analysis works, but I've also had many experiences where someone joins one of our IRC channels, shows some code and says "hey the borrow checker won't let me do this thing that's totally safe" and then I or someone else replies "well, what about this?" to which the answer is "...... oh. yeah." This is virtually almost always from C++ programmers.

It's hard to escape the mindset of languages we're used to!

> At the same time a lot of the error messages are very cryptic

You should file bugs! We care deeply about the legibility of error messages, and the whole --explain system is there to try and go above and beyond.

>You should file bugs! We care deeply about the legibility of error messages, and the whole --explain system is there to try and go above and beyond.

Next time I do some Rust I will. I also need to check out that --explain system. I didn't see that when learning Rust.

Take a program that doesn't work, like this one: https://play.rust-lang.org/?gist=2c7b672c6a211e3ab2f3995e37d...

> error[E0384]: cannot assign twice to immutable variable `x`

That E0384 is a link in the browser. Click it and you go to https://doc.rust-lang.org/error-index.html#E0384 which has a longer version of this error.

On the command line, you can run `rustc --explain E0384` and it'll print out the same text to the terminal.

Nice, thank you! I always Googled it until now.