News for hackers. Stuff that matters.
Re:Bun is being ported from Zig to Rust by satvikpendem on Tuesday May 05, 2026 @10:02AM (#48022678)
Well yeah, it's in Zig, not a memory-safe language, so of course I'd expect memory leaks. That's why I haven't seriously used bun and instead use a runtime that actually is in a memory-safe language, Deno in Rust. It's like wearing roller skates without brakes and wondering why you keep running into things.
Re:Bun is being ported from Zig to Rust by LinusU on Tuesday May 05, 2026 @10:39AM (#48023116)
Memory safety has nothing to do with memory leaks, and it's perfectly valid to leak memory in Rust?

e.g. `Box::leak(Box::new( ... ))`

Re:Bun is being ported from Zig to Rust by nicoburns on Tuesday May 05, 2026 @10:44AM (#48023205)
Memory safety doesn't help too much here, but "RAII" (automatically dropping values when they go out of scope) does.
Re:Bun is being ported from Zig to Rust by satvikpendem on Wednesday May 06, 2026 @02:17AM (#48032888)
Generally it's automatically dropped unless you go out of your way to use the leak function, which most software doesn't do.
Re:Bun is being ported from Zig to Rust by bnolsen on Tuesday May 05, 2026 @06:34PM (#48029660)
Unit tests in zig will fail if the tested code leaks memory.