WeSearch

Bun's unreleased Rust port has 13,365 unsafe blocks

·1 min read · 0 reactions · 0 comments · 17 views
#rust#programming#software
Bun's unreleased Rust port has 13,365 unsafe blocks
TL;DR · WeSearch summary

Bun's unreleased Rust port has been analyzed for its use of unsafe blocks. The density of unsafe code is compared to other Rust runtimes, highlighting differences in how bindings and runtimes are structured. The findings suggest varying approaches to Rust code safety across different projects.

Key facts
Original article
Bun
Read full at Bun →
Opening excerpt (first ~120 words) tap to expand

Compared to other Rust runtimes Unsafe per 1,000 lines of Rust, measured the same way in each project. Density tracks how close the code sits to a C boundary: a crate that only binds a C++ engine is densest, a runtime that writes its own engine in Rust is sparsest. Bun keeps its bindings and runtime in one workspace; Deno splits the binding into rusty_v8 and writes much of its runtime in TypeScript. Draw your own conclusions. Counted with the measurement command from the methodology section, vendored C/C++ excluded, May 21 2026, commits pinned per row. Lines are Rust source only.

Excerpt limited to ~120 words for fair-use compliance. The full article is at Bun.

Anonymous · no account needed
Share 𝕏 Facebook Reddit LinkedIn Threads WhatsApp Bluesky Mastodon Email

Discussion

0 comments

More from Bun