Hacker News new | ask | show | jobs
by MereInterest 1938 days ago
> And sadly rust is fairly user-hostile language

Could you elaborate on that? I started using Rust at the end of last year, and have found it to be one of the most user-friendly languages I've learned. There is clear documentation that is easy to generate with the standard toolchain, along with a very good language guide.

The compiler error messages are an absolute joy as somebody coming from C++. Pointing out exactly where the borrow checker found errors, or exactly what the type signature should be for a trait, is really useful.

1 comments

Well, yes, coming from C++, Rust must seem like a breath of fresh air. Coming from almost any other language however, I can understand that it feels a little bit intimidating (and getting more so with every exotic feature added - "const generics" anyone?), no matter how friendly they try to make the documentation and the error messages...
I can see that a bit. I suppose for me, the biggest questions are (1) is there a way to unambiguously express my intent and (2) is there exactly one way to do so? I'm fine with more features so long as they match some specific problem that people have that isn't already solved in another way.

For example, in the case of const generics, I've used the equivalent in C++ to make a class for a geometric vector in N dimensions. The size varies depending on the number of elements, but is known and can be checked at compile time. The existence of const generics is very closely matched to this particular use case.

I don't think "there is exactly one way to do it" is actually a good guiding principle.

Forcing it down to an overly simplistic setting, if I need to add 5 to a number I can increment 5 times, or add 2 and then 3, or just add 5. Which of those options should we remove?

Perhaps we mean, instead, that there should be one best way, but (sliding into metaphor, I hope) what about when we have a language without 5 and we are considering adding it? Is the use case already handled by 2+3? How are we to decide?

This is just false, Rust is much easier to use than Python (just the package management situation is so much better)
Really? Then there is no point in starting new projects in Python. You can write everything in Rust. You’ll get performance as a bonus.
No python has way more packages like the op said. You can't start projects in rust where you need a significant amount of dependencies because rust is not there yet.

Language wise rust is better the python in every way except for compile times.

I imagine that in addition to having more packages, it is easier to hire developers who know Python than who know Rust. Current tiobe index puts Python at #3 (rating=10.86%) and Rust at #30 (rating=0.49%). If you already have a team experienced in Rust, then it may be a good choice, but if you are expecting to grow your team, you may want to pick a language based on popularity.

Language-wise, it feels like they are intended to solve different problems, so Python vs Rust is a weird comparison. Granted, that may because I started learning Rust as a replacement for C++, so that has been my point of comparison.

Generally I wouldn't advise hiring based on the language the candidate knows anyway. Almost all mainstream languages are so similar in concepts that it doesn't really matter anyway.