Comment by ogoffart

Comment by ogoffart 12 hours ago

2 replies

> Rust, contrary to public claims, often does worse on memory safety than C++, which is a sad state of affairs.

Nonsense! Where do you get that from?

Aslo, you can make easily make linked list, it's just not a recommended data structure.

curious9999_2 9 hours ago

On memory unsafe Rust: It tends to come crashing down when unsafe is necessary, for both reasoning about unsafe is harder than in C++, and the rules for unsafe in Rust is an active area of research. Do you know all the intricate rules of unsafe (not all which have been defined), can you reliably predict what is safe and what is not without using Miri? Miri that cannot test all? Are you an expert on aliasing and pinning? Can you describe what tree borrows are?

On doubly linked lists: Sorry, but to implement a doubly linked list in Rust well, you have to go through trials and tribulations. A whole book was written about an epic of implementing doubly linked lists in Rust: https://rust-unofficial.github.io/too-many-lists/ . And if all that is required for a data structure as simple as a doubly linked list, what will then be required for some of the more complex data structures?

  • npalli 7 hours ago

    Well said, the point of doubly linked lists is not that it is the be all and end all of all data structures. You can possibly workaround that. The real issue is a real program has much more complex data structures, how can you possibly make it work or refactor easily when a simple thing like DLL's are causing so much grief. So, yeah Rust really is unproductive in a massive way. Just useful in small parts where you might really need memory safety (that too, not sure why you wouldn't chose another language).