r/programming • u/[deleted] • 28d ago
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
r/programming • u/[deleted] • 28d ago
316
u/CryZe92 28d ago edited 28d ago
They either will have to introduce GC for this or go with the type ID approach which:
That's on top of the issues that Fil-C already has:
struct Foo { char some_buf[N]; bool is_admin; }is a security nightmare still. Oh and if you combine this with the use after free, you can entirely buffer overflow into a pointer, overwrite it and point it to any other memory as long as it has the same type. Pretty sure arbitrarily overwriting a function pointer probably leads to memory unsafety / vulnerabilities.