Comment by koakuma-chan
1 month ago
I heard this before, that apparently there are things you cannot implement in Rust. Like, apparently you cannot implement certain data structures in Rust. I think this is bullshit. Rust supports raw pointers, etc. You can implement whatever you want in Rust.
Presumably they are saying that you'd end up using a lot of `unsafe`. Of course, that's still much better than C, but I assume that their point isn't "You can't do it in Rust" it's "You can't translate directly to safe rust from C".
> Of course, that's still much better than C
Exactly. "can't translate to safe Rust" is not a good faith argument.
If anything, writing unsafe code in Rust is also fun. It has many primitives like `MaybeUninit` that make it fun.
Yes, you are looking for https://rcoh.me/posts/rust-linked-list-basically-impossible/.
That’s not what I said. I am saying that translating C code to Rust usually involves a human in the loop because it requires non-trivial decisions to produce a good result.