100 days with Rust: a series of brick walls
I am currently learning Rust and I feel this intensely[1].<p>I really want to like Rust, but I feel like the way they cope with no GC (lifetimes, borrowing) fights me at every turn, and really simple situations in other languages[2] become these intensely painful situations. Every time you think you&#x27;ve worked out how to fix a problem you find while you&#x27;ve fixed that one you&#x27;ve actually created 2 more.<p>Want to have a data structure of variable size (eg a struct with an Vector in it)? You can&#x27;t do that, structs have to be fixed size. OK so I&#x27;ll make it a reference to a Vector. That&#x27;s great, but now you can&#x27;t have a factory function because the lifetime goes out of scope. OK so I&#x27;ll wrap my reference in a Box. OK that&#x27;s great but now your OTHER reference: a trait (because traits are also of unknown size) is complaining. OK I&#x27;ll wrap that in a Box as well. Sorry, you can&#x27;t wrap this trait in a box because before your trait requires implementors to implement copy because at one point you have to use the trait in more than one place and references break the lifetimes and--- <i></i>THROWS LAPTOP OUT WINDOW<i></i><p>I&#x27;m going to keep chipping away at it for a bit longer, but I can feel my interest waning.<p>[1] Except for the bad docs bit, I really like the docs, and the error messages are definitely earnest in their attempts to help you.<p>[2] that I&#x27;m familiar with, which are no languages that don&#x27;t auto-GC<p>-- EDIT --<p>To everyone taking the first line of my intentional rant paragraph and pointing out it works fine… you&#x27;re correct, I am mistaken! Let me paste the reply I made to the first person:<p>---<p>You&#x27;re absolutely right. What I really meant was that you can&#x27;t have Vec&lt;T&gt; where T is a trait without also wrapping that in a box, which for me in turn doesn&#x27;t work for a bunch of other reasons.<p>In any case, my point remains the same: it is very challenging-- at least for someone used to just creating data structures and letting GC handle it-- to build code that does what you want, and you spend large amounts of time &quot;fighting&quot; the compiler. I am OK if people wish to peg that on me being stupid or whatever, it doesn&#x27;t change the core point: it&#x27;s hard for new people to get into, and if you&#x27;re wanting there to be less Electron apps and more native apps things like Rust being easy to use seems important for that.