Hacker News new | ask | show | jobs
by saagarjha 157 days ago
Usually rewriting something in Rust requires nontrivial choices on the part of the translator that I’m not sure are currently within the reach of LLMs.
1 comments

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.
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.