Hacker News new | ask | show | jobs
by IshKebab 2750 days ago
Sure, however you do pay the significant cost of having to satisfy the borrow checker. There are other nice expressive languages where you don't have to do that so if you actually don't need the speed Rust is maybe not the best choice.
2 comments

> you do pay the significant cost of having to satisfy the borrow checker

Right, but this is presumably a one-time investment while learning Rust, much less of an ongoing hurdle.

I disagree. It's something you always have to think about. It might get easier but it doesn't magically go away.
You often should think about it in other languages too, ie to avoid concurrency bugs. If you don't, there's a good chance your program isn't correct, even if accepted by a less strict compiler.
Yes. But the point is that you don't have to "dumb down" your program to prove to a static analyser that it is correct.

Look at the kind of programs that NLL now allows. You wouldn't have to jump through those hoops in another language.

Satisfying the borrow-checker usually ends up implying that either:

a) you used .clone() everywhere and therefore are probably modifying something and failing to propagate the modifications to where they need to go; or

b) your design is inherently better, saner, easier-to-optimize, etc., than one which doesn't have to satisfy the borrow checker.