logoalt Hacker News

q3ktoday at 10:10 AM2 repliesview on HN

  $ grep --exclude-dir=.git -r 'unsafe {' | wc -l
  10465
Nice.

Replies

K0nservtoday at 10:45 AM

It's not that weird to end up with this when translating C/Zig/C++ to Rust. A first pass can use unsafe and then when the code is in Rust you can work on reducing the unsafe.

Trying to eliminate all unsafe as part of the rewrite, whether done by human or LLM, would be making too big of a change in the process of rewriting.

show 1 reply
janice1999today at 10:44 AM

The benefit of using Rust is that you know exactly where the unsafe code is so you can handle it explicitly and deliberately to avoid issues by imposing carefully crafted constraints... oh.