5 ms·
Yes. Any system like Rust will have corner cases where it is awful. The simplest example is doubly linked lists, specifically, and any circular data structure
by worik 4y ago
Yes.
Any system like Rust will have corner cases where it is awful.
The simplest example is doubly linked lists, specifically, and any circular data structure in general.
They are hard in any language to get right, but for all its sweat and pain Rust is no help here. C++ is a better choice.
- gavinray 4y agoI will openly say I think Rust is an all-around better language. If you are building general-purpose systems software, or just want to write fast software, use Rust. If you are fiddling with bits, doing low-level concurrency, writing a GC/Memory Manager etc, or have self-referential datastructures like graphs or trees, you're going to have an order of magnitude easier time writing it in C++. (Rust-experts excepted) Also, the developer experience writing C++ is worse than Rust by miles. Though the tooling (fuzzing, LSP, debugging, sanitizers, etc) is stellar, likewise with Rust.
- rich_sasha 4y agoI agree with this, but also sadly note structures like trees are sadly quite common, in the type of code I write anyway. It is a bit of a niggle I have with Rust.
- worik 4y ago> sadly note structures like trees are sadly quite common, in the type of code I write anyway. It is a bit of a niggle I have with Rust. Trees are no problem with Rust It is circular, rather than recursive, data structures that are troublesome
- rich_sasha 4y agoI had to use recursion to build a tree in AoC '22 day 7. I needed to have both a mutable stack of current tree nodes (`cwd` if you like) and the tree structure. Or equivalently a doubly-linked tree, where nodes point at their parent. It was a bit ugly. In C++ you just write it. I get why it's hard in Rust, just saying, it really does crop up.
- worik 4y agoYes. It is hard on garbage collection too, circular structures.
- pjmlp 4y agoTry the Rust development experience in Visual Studio or Clion versus C++, specially for stuff like GUI, DirectX or parallel debugging.
- gavinray 4y agoCLion is quite good you're right. I think it's the best of any Jetbrains IDE Visual Studio is also impressive, though I have a bit of bias against it from when it was so slow. (I know it's not the case now. It has a great debugging experience, that I don't think can be rivalled anywhere else.)