Hacker News new | ask | show | jobs
by kangalioo 17 days ago
I haven't heard that number before and I'm actually impressed.

For a file-by-file close to literal translation of a memory-unsafe language to Rust, isn't that pretty good?

I was expecting the post-rewrite Bun's unsafe usages to be in the order of magnitude of C2Rust (https://c2rust.com/). I was _not_ expecting it to be in the same ballpark as hand-written Rust.

1 comments

I'm not sure I'd classify "double" as "the same ballpark", but either way C2Rust appears to just mark everything as `unsafe` (even when it's completely unnecessary), so I don't think that's a fair comparison. Further, I know for a fact that their are instances of the `unsafe` in the bun codebase right now that are just trivially incorrect in rust. A vaguely competent human programmer, even one doing a 1:1 translation (which is likely a bad idea anyway) would have caught those.