avatar
FalB @falb.bsky.social

memory safety for JS depends on the engine you're running it on, and I'm not necessarily referring just to memory safety, Rust also safeguards against memory issues like memory leaks, which aren't uncommon in JS.

aug 27, 2025, 3:32 pm • 1 0

Replies

avatar
HJVT @hjvt.dev

If you want to attack JS, you can just point at the fact that it has null and undefined, and laugh. You don't have to invent alternative facts about the benefits of Rust.

aug 27, 2025, 4:00 pm • 0 0 • view
avatar
Alice ✨ @welltypedwit.ch

rust can literally leak memory that doesn't have any references to it? that would be unacceptable in most other languages (it is literally the reason python also has a tracing gc).

aug 27, 2025, 3:34 pm • 0 0 • view
avatar
Alice ✨ @welltypedwit.ch

the kinds of memory leaks you can get in js where code holds on to things longer than it needs to are possible in any language with dynamic memory allocaton, including rust

aug 27, 2025, 3:34 pm • 0 0 • view
avatar
FalB @falb.bsky.social

yes, but in Rust it's still opt-in, you need to purposefully call std::mem::forget() or Box::leak(), in JS it happens because the GC fails.

aug 27, 2025, 3:38 pm • 1 0 • view
avatar
Alice ✨ @welltypedwit.ch

you don't, you can also create reference cycles. the js gc doesn't "fail". you're just holding on to memory that you don't need anymore. you can do that in rust as well.

aug 27, 2025, 3:40 pm • 0 0 • view
avatar
FalB @falb.bsky.social

Since when do you have any sort of access to memory on JS to where you're holding on to memory willfully? I don't have any control over when memory is freed or created in JS, I do in Rust.

aug 27, 2025, 3:44 pm • 1 0 • view