logoalt Hacker News

latortugalast Sunday at 7:04 PM2 repliesview on HN

I seem to recall this Rust rewrite is all "unsafe" meaning it really doesn't automatically eliminate those issues.


Replies

mrothroclast Sunday at 7:17 PM

Relevant passage from Jarred's post:

"At the time of writing, about 4% of Bun's Rust code sits inside an unsafe block (~13,000 unsafe keywords across ~27,000 lines / ~780,000 lines), and 78% of those blocks are a single line — a pointer that came from C++, or one call into a C library. I expect this number to go down over time as we refactor from a faithful Zig port (which had no greppable unsafe keyword) to idiomatic Rust, but we are going to continue using C & C++ libraries like JavaScriptCore so it will always have more unsafe than pure Rust projects."

show 2 replies
nsonhayesterday at 9:14 AM

what is surprising about it? The way porting works has alway been first doing a faithful pass before going back to address impedance mismatches case by case. You would do that even when porting things manually, let alone in a super risky completely automated bulk migration.