My friend is tired of me going on and on about Rust, so I thought I'd talk your ears off instead.
I've started coding in the language two weeks ago, although have dabbled in it by reading the first 10 or so chapters of the book a while before that. I usually take a rather pragmatic view to coding: a programming language is something that's meant to get the job done, basta! But not with Rust. Something about the language just makes coding fun and makes me want to perfect my code. I think that's a combination of many tiny things that Rust just got right that makes it more suited to writing structured code that expresses the coder's intent more than other languages.
So I tried to articulate what I find good in Rust, and some things I found lacking during my first two weeks of programming in it.
- sane defaults like privacy rules; lack of customization actually helps not agonize over choices
- in general the language design is very coherent and when I learn something it's not just yet another piece of syntax (C++, I'm looking at you)
- being able to split impl across multiple files; I'm sick of monstrous classes in Python and C++
- amazing ecosystem: formatter and cargo are god-sent, clippy as well
- a copy of Rust's many books and the whole documentation is included for offline access in rustup's installations
- Integrated Testing! Before using Rust, I never tested my code so thoroughly, and I could do this from day 1; not adding tests to my code is now unthinkable
- superb learning material
- everything is an expression; because of this, coding Rust feels like my thoughts just flow right out of my fingertips
- Error Handling!!!! I cannot stress enough just how much I abhor throw and catch in other languages, and that was way before I even knew about Rust
- rayon is amazing; the first thing that comes to my mind when improving performance is now if I can parallelize my code; before that wouldn't have even crossed my mind
- I don't know why, but all in all Rust just lends itself to writing beautiful code; when I'm done writing something in Rust, it's something I can show; compared to when I write something in C++, which in mild terms, is going to be a complete mess; and I'm only a beginner!
- Last but not least, the amazing community! With the two issues I've posted on this forum, I immediately got multiple expert answers with lots of patience despite my obvious struggling with basic concepts
And Rust's main promise, the memory safety, isn't even on this list. Not that it's not incredible. But in all honesty, I found all these small but very noticeable improvements a much more important selling point of the language.
- slow hashing, I think there should be a std::collections::HashMapInsecure; it's nice to have a safe default, but I don't want to jump through hoops when I just require a quick HashMap, and this use case is actually quite common, so it would be nice if it was an opt-in like unsafe
- no way to handle OOM failure; although I don't plan writing any applications like that in the near future, it's kind of a bummer that Rust just aborts on OOM
- in my opinion, unchecked indexing is too cumbersome; I get that Rust is focused on safety and that one should first profile their code before optimizing prematurely, but I wager to say that no one really knows how much performance is lost due to Rust's index checks, even if many checks can be optimized away
- Rust on GPUs, specifically CUDA
- it's hard to use packages offline; it would be nice if there was a version of rustup that shipped with some most used crates (rayon, criterion, indicator, rand, ...), like conda for Python
I hope this post is suited for this forum. I just felt like sharing my experiences.