I finally get it (or "Rust from the perspective of a C# developer")

325 points secretarybird97

I'm in no ways an expert in Rust, but recently I developed a Tauri application (WPF was not fitted to this specific task, for those wondering) and oh my god, what a joy was to write the backend.

Initially I thought that the borrow checker would be a nightmare since it's long since I worked with languages like C/C++ in which I need to think about pointers that deeply, but it really wasn't an issue. Once you understand the syntax and the logic behind it, it just makes sense. The only difference is that in C# I would use something like ConcurrentQueue<T> or SynchronizedCollection<T> to manage synchronization between threads, while in Rust I would need to think about ownership and borrowing, but at the end of the day, the problem it's the same: If two threads need to acess some state, you need to think carefully about why and how to access that state.

Also, async/await and multithreading was relatively simple as I think the languages, at least at a high level, were similar enough. I had to read about Arc, RwLock vs Mutex, mutable references, how to impl a struct, channels, and a little bit of lifetimes, but apart from that, there was really nothing that stopped me from implementing what I needed to do. The best part is (as most people say), once it compiles, it mostly just works! I guess it just comes down to knowing the fundamentals of the language to the degree you need to to make it work.

My only gripe with Rust is the compilation/build time, but, it is what it is...

Would happily recommend Rust if the project lends itself to it.