3 ms·
What you basically wrote is that my problems would go away if only I wrote code that the compiler approves.. But that is not easy, and much of that is due to t
by kramerger 3y ago
What you basically wrote is that my problems would go away if only I wrote code that the compiler approves..
But that is not easy, and much of that is due to the complexity of Rust and the way it handles memory safety. Which is where fighting the compiler comes in.
- baq 3y agoYeah I get it, I was there. It is super hard if you actually know C/C++ or mastered a GC language. Rust won’t like some patterns at all and will fight you. The point is, there are replacements for those patterns that are safer, about as performant and simultaneously easier to reason about by both you and the compiler. To stop fighting, you must switch to them. Old ways will not work. This is by design and a key point of Rust. A single, concrete example: do not use references in object graphs. Use an array and indexes into it. If you have a dynamic structure with many additions and deletions, use generational indexing.