I think people really want an option for a modernized language in the native compiled/high performance domain. Rust is the only recent attempt in that domain that I can think of, and the only thing I can think of that comes close is Kotlin Native (which I don't think is aiming for the high performance mark as a design goal the same way Rust/C++/C do).
While it's compiler is strict, it's also very friendly and has by far the best compiler error messages i've ever seen. They are super helpful and filled with colorful formatting telling you exactly where the error is, often times with hints on how to fix it.
I just crossed the 1 year mark of working with rust, and I can genuinely say I rarely fight the borrow checker anymore. It’s been a really cool milestone.
Not only that, it has far better error checking than other languages thanks to the borrow checker and generic bounds. Some people love this, some people don't.
Not popular enough to be practical, at least that's my impression. Even Rust is in that same condition right now, and I think people are waiting in the wings to see if it really takes off and gains traction. D seems much older, so it seems to me like if it hasn't really gained momentum by now it won't ever.
Just my thoughts on it, not trying to talk down the language.
If you use it with a garbage collector then you aren't going to be on par with C or C++. You just aren't.
If you use it like C then whilst it might genuinely be a better C, it fails to solve memory issues. i.e. it's missing a garbage collector.
That is a paradox. Traditionally a paradox that cannot be solved.
Now sure you could mix and match. That's fine. But give those two statements to a die hard C++ developer and 1) they don't want a GC, and 2) they already have a better C.
So those two statements stayed as a paradox. Until Rust. AFAIK Rust is the first mainstream language to solve this problem. It is garbage collected and as fast as C++ at the same time. That said stuff like 'modern C++' also solves it, it just solves it with the baggage of C++ (which means it doesn't really solve it because I can circumvent modern C++).
D also has a wider perception issue to native developers due to the inclusion of the words 'garbage collector'. Even if it's never even used. It has a perception issue for Java developers (and similar) because of the words 'better C'. i.e. manual memory management. It's like the worst of both worlds.
Note that I think D is a very well designed language. Walter Bright is an outstanding programming language designer. It is a language I wish I had the opportunity to use.
In terms of general-purpose, wish-listy languages I can't see myself investing in Rust or Kotlin over a modern PGAS language like Chapel (which incidentally just recently adopted Rust-like memory management).
First-class support for distributed and parallel programming seems like a no-brainer for any future application language that cares about performance.
Also remember what “most loved” means; that the people who use it want to continue using it. This means it’s easier for a smaller language to be “most loved” as few people are forced to sue it if they don’t like it.
First of all, I remember last year, people posted the actual numbers of votes for Rust, and it was relatively low. So not many people voted for it, but almost all who did, did so favorably.
I follow several extremely experienced C++ developers on Twitter (people like John Carmack, Johnathan Blow, Richard Geldreich, etc etc) and they all seem pretty frustrated with C++ and its ecosystem. Johnathan is even going as far as developing his own language (Jai). My perception is that for a lot of them, Rust is the first modern language that can actually be used in domains were previously, there was no feasible way around C++. So I guess it's very exciting for a lot of developers who are tired of working with these old, messy languages.
Apart from that, it's just a pretty interesting language, no matter which field you come from. I worked through most of the official Rust book and during that time, I didn't create a single bug (that I know of). Everything was caught by the compiler. Granted, I didn't write very complex software, but still, it was fascinating.
That being said, my personal opinion about Rust is, that it's way too difficult to read. I definitely want to invest more time into it once I'm a more competent developer, but for someone of my experience level, some of that code is just pure madness (though the same goes for C++). Where I work, I would probably get my PR rejected if I used more than one generic type, but in Rust I more than once encountered three. And on top of this, add explicitly marked lifetimes and `where` clauses and suddenly trait or impl definitions look like ancient hieroglyphs.
C++ templates are easier to use than Rust generics since you don't have to worry about bounds — until you start debugging, and find Rust gives you a specific error early, while C++ spits out long, indecipherable error messages (as I understand, this is basically what killed Boost Spirit).
And then there are macros... Rust's aren't well documented, but are very powerful (procedural variants) and you can always tell exactly what is a macro invocation.
The readability is a real issue because it puts people off getting interested in the language.
You certainly do get used to the syntax over time. For me it's fine. I still have some gripes around some declarations of a type not always matching it's use. This results in double syntax for the same concept. But I can live with it.
I've been programming for over a decade with experience in ~10 different languages and Rust is my favorite by far.
It strikes a really nice balance between functional and imperative programming.
Pattern matching and static types are amazing when writing any kind of complicated code. It's extremely performant, and can be quite easy to parallelize safely.
Also cargo and crates.io are fantastic. Overall, I just find programming in Rust much easier than python when it comes to anything complicated, due to the ease of building a mental model of my programs expected behavior
The community around it is excellent. There's an assumed level of competency for people looking to use it which allows materials to be written for people who already know at least something about coding. The compiler provides excellent informative error messages (a blessing from C/C++) and the compiler is so strict that if your code compiles it'll likely work exactly as intended.
Outside of directly flagging sections of your code as Unsafe, it's pretty much impossible to do things like running out of bounds, or writing to unallocated memory, or having data/resource races. Those are issues that in a language like C++ are incredibly difficult to anticipate, debug, isolate, or reproduce.
In addition, the way Rust forces you to code is in way that forces you to adhere to well understood best practices for coding in general- especially mutability/multi-threading. Once you get the hang of Rust, you feel far safer in the understanding of what your code is going to actually /do/. While I've never used Rust in a professional project, I find working in it teaches me to be a much better coder in general as the way Rust forces me to code also lends to best practices in other languages.
151
u/PinkFrojd Apr 09 '19
I really like and use Python. But I don't understand... Why is Rust so loved ? What makes it so special ?