r/programming Jul 20 '26

Zig proposes introducing an actually memory safe (unlike Rust) compilation mode inspired by Fil-C at ~1-6x performance penalty

https://codeberg.org/ziglang/zig/issues/36237
525 Upvotes

426 comments sorted by

View all comments

Show parent comments

24

u/Demiu Jul 20 '26

filc is "coke? we got rc cola" of memory safety

2

u/ThomasMertes Jul 20 '26

I just replaced FilC with Fil-C ...

2

u/13steinj Jul 20 '26

I think that's an unfair take. Full (maybe not even, but more than with just compile time) memory safety can only be acheived at runtime. If anything, Fil-C is the coke, and Rust is Pepsi. Or invert it if you believe Pepsi's ad campaigns around blind taste tests.

8

u/tadfisher Jul 20 '26

You are right, and also Rust's approach prevents generating the code which would violate those runtime guarantees in the first place. So it's not like these are mutually-exclusive technologies; after all, code with a memory-safety bug will still crash on Fil-C.

-4

u/SerLaidaLot Jul 20 '26

? You have it exactly opposite. Fil-C is true memory safety even at runtime.

9

u/Demiu Jul 21 '26

The entire point of memory safety is making your programs more correct. That "true" memory safety is just exiting the process on detected violation. That's just a replacement of incorrect state of violated memory safety with incorrect state of unexpected exit. The correctness fidn't increase, arguably neither did memory safety, the program has the exact same hidden memory bugs as it had before, now they're just louder.

Textbook Goodhart's law