4 ms·
> D wants to give you options, so you can use GC/RC/manual where appropriate. Again, those options are what I listed as the wrong approaches. Manual = ad-hoc m
by kaoD 10y ago
> D wants to give you options, so you can use GC/RC/manual where appropriate.
Again, those options are what I listed as the wrong approaches. Manual = ad-hoc memory management.
There's an additional option only present in Rust: automatic memory management via static analysis. Rust does not allow manual memory management at all unless writing unsafe code. Unlike Rust, D code with memory allocations is either GC'd or unsafe.
Just to make it clear: the borrow and lifetime checkers are not manual memory management. Lifetimes are just hints for the compiler to do its automatic memory management at compile time.
> ultimately, D and Rust converge to the same point
Definitely not.
- qznc 10y ago> the borrow checker is not manual memory management Ok, we disagree on the terminology here. I would consider that manual, because it looks the same in C++. Rust only has the static analysis to weed out all the unsafe/broken code.
- deleted 10y ago[deleted]
- kibwen 10y ago> I would consider that manual, because it looks the same > in C++ Many also consider RAII in C++ to be "automatic memory management". Other than agreeing that C is manual and Java is automatic, terms are failing us here. :) In the Rust community, instead of trying to argue whether or not Rust is manual or automatic (or "safe manual memory management", or "static automatic memory management", or etc.), we tend to just say "in Rust, you do need to think about memory management, but you don't need to worry about memory management". :P