I have written code in everything from assembly code for many machines, through Fortran, PL/1, Lisp, Scheme, TCL, Python, C, C++, Haskell, Go and Rust (and I’m sure there are some I’ve forgotten). This is over the course of 57 years of programming (I wrote my first line of code in 1960! And I’m still at it). Rust was by far the most difficult to learn. Haskell has been called a language “designed by geniuses for geniuses” and I found it less difficult to learn than Rust, in the sense of being able to write code fluently. The languages are similar in the sense that you need to make a very demanding compiler happy and it did take a while with my first attempts at Haskell to understand why the compiler was grumping at me. But Rust takes this to another level.
It’s hard to know exactly why this is. I’ve been critical of the documentation in the past, but that is getting fixed and while I have stopped actively developing code in Rust, I’ve looked at the documentation periodically and the new attempt is certainly an improvement. But I’m wondering whether the basic idea of Rust – memory safety without runtime overhead – is really worth it. I stopped developing in Rust awhile ago because of the kind of frustration you’ve encountered. If I don’t need ultimate performance, which is most of the time, I tend to do my development in Haskell. As with Rust, once you convince the compiler that you know what you are doing, you are usually very close to a correct program. But I find the Haskell compiler (ghc) much easier to convince.
When I do need ultimate performance, I use C. Yes, the language has its warts, but we know what they are and having written an awful lot of it, I know how to use the language and write memory-safe code with it (verified by lack of seg-faults and some time spent with valgrind). The documentation is beyond reproach, the supporting libraries and compilers are first rate. In other words, it’s mature software and it works very, very well.
What I’m saying is that, at least from my perspective, Rust’s cost-benefit proposition doesn’t work, at least not yet. Perhaps once the new documentation is finished and had some time to mature, I might find a reason to give it another try. But so far, I’ve found that it just wasn’t worth the effort, given the available alternatives.