Tried Rust. I'm a believer now.
So, I'm a PHP/TypeScript/JavaScript/Python programmer (basically, I learn and use many high-level languages on a need basis). For quite some time I was keen to learn some low-level language, just so I don't have to build an Electron app just to make a desktop program. I picked Rust because of its famed strong typing, as I love writing dense TypeScript code, and looked for something as close as possible. Here are some of my experiences and observations:
- Coming from dense TypeScript with heavy generic use, Rust was surprisingly easy to pick up. I regret that I didn't do it earlier. I imagine that thinking in terms of generics may be the most difficult for new users, but if someone already dealt with generics in TypeScript, there is nothing more complex in Rust.
- Functions/methods that return multiple values and matching the output types to behaviors is GENIUS. It makes logic flows so much cleaner. Rust adds some boilerplate compared to high-level languages, but it also removes a lot of it where it matters the most: in the actual implementations, thanks to this. It's amazing how rarely I have to use "ifs".
- Initially I wasn't fully sold on `from/try_from` traits because I felt that they hide logic (it's difficult to find/know what has what conversion available, and where is the implementation), but then I realized that conversion logic is most often a "necessary evil". Writing mapping functions/classes in every language always felt ugly. By comparison `from/try_from` i Rust is actually not that bad. I grew to like its semantics as I realized that it's actually a good thing that this annoying mapping logic finally looks different from the rest of the code. The mind can more easily filter it out.
- Lifetimes are less annoying than I expected, although occasionally, I still have a hard time accepting situations, where I get `Cannot return value referencing local variable`. I just want this constructor to create an object that will be owned by my struct, but if this object has references, I'm in for a bad time. I'm still getting used to it.
- In the time of LMMs it's especially easy to pick up Rust, as they are amazing at teaching you at the speed you are the most comfortable with. I feel like I grasped, like, 80% of Rust in the first week. Applying this knowledge to real-life scenarios is a different thing, though.
- I miss the absurd expressiveness of TypeScript, but it's not bad here.
- I wish `mod.rs` files could be named `_.rs` so they would be easier to visually filter out, as they are a source of tremendous visual noise. That's the one thing that still bothers me.
- All in all, I cannot wait to contribute to your community, guys!