3 ms·
> rust forces you to write correct code And to that extent, due to the lack of GC, you need to provide it (and keep in your head) with lots of extra informatio
by j1elo 4y ago
> rust forces you to write correct code
And to that extent, due to the lack of GC, you need to provide it (and keep in your head) with lots of extra information that wouldn't be needed with other languages.
I find that Rust is too strict because it assumes concurrent multithreaded code by default. Which wouldn't be needed for most desktop apps. Why no circular refs or having a mut ref and a ref at the same time, in my simple single-threaded To-Do list Tauri app?
- tene 4y agoI disagree, and I'd be fascinated to hear more of your perspective here. I love Rust precisely because I can keep extra information out of my head. When I express something with the type system, I can stop tracking it mentally, and just rely on the compiler to keep track of it for me. With dynamic languages, I have to track far more mental state. "Mutable xor shared" does not have anything to do with concurrency or threads. Here's one example in the Rust Playground: https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=a6d5af0b8995603154e448e0fd4a167d https://play.rust-lang.org/?version=stable&mode=debug&editio... If this were permitted, then this example would have use-after-free whenever myvec reallocates its storage. No concurrency needed. I'm not sure what you have in mind for circular references, but I don't know of any complications with circular references that have anything to do with concurrency.