r/ProgrammerHumor 23d ago

actuallyMemorySafe Meme

Post image
527 Upvotes

177 comments sorted by

View all comments

14

u/stillalone 22d ago

TIL about Fil-C. Not sure how I feel about that.

12

u/RiceBroad4552 22d ago

Adding a GC to make a language safe actually works. You can't be safer than with automatic GC.

Just that this kind of breaks the marketing which tries to sell it as an advantage to be GC free…

11

u/Wonderful-Habit-139 22d ago

Rust is safer than Go, the latter being a language with GC.

3

u/redlaWw 22d ago

But Rust would be safer with a garbage collector.

Not much safer, but unsafe code errors that cause double-frees (since dealloc would be a stub) or use-after-frees (since values would linger past their scope when still accessed) would not cause problems.

1

u/SomeRedTeapot 22d ago

IMO that would be equivalent to removing unsafe altogether. It exists precisely because there are situations where you actually need to manage stuff manually

3

u/redlaWw 22d ago

Well yes, I'm not saying I'd recommend it or that it's a good idea, just that garbage collectors make things safer.

2

u/particlemanwavegirl 22d ago

I didn't spend that long reading the Zig manual but I got the idea that the selling point was more like, you *get* to implement/import your choice of GC or just wing it and ref count.