Comment by simonw

5 hours ago

One metric I thought might be interesting with respect to the Rust rewrite is the number of "unsafe" occurrences in the code.

I was optimistic those would be going down over time but it looks like they've stayed pretty constant: https://news.ycombinator.com/item?id=48966569#48967630

Does that data exclude FFI wrappers, which necessarily must be unsafe? If not, don’t put much stock in it.

  • No, it's a raw count.

    I get that there's a baseline of unsafe that's necessary, but I was under the impression that some of those unsafes were in places where they could be replaced by more idiomatic Rust at a later date.

    • I don't think that's true. I think a fair chunk of them are places where Bun is handed a pointer by WebKit or something similar. I believe they write about this a little.

      1 reply →