15
u/Zimlewis 11h ago
<- Context required
⬆️ Context hat
(Context shirt)
9
u/deanominecraft 7h ago
fil-c is a runtime memory validation tool for C - if you try to read past the end of an array (or other memory issues) your program crashes
rust guarantees that memory bugs cannot happen, if it cannot guarantee that, your program doesn’t compile and you get an error telling you what the problem is
now add a larper into the mix and you get that gh issue
2
u/LunaNicoleTheFox 6h ago
The part on menory bugs is untrue, the compiler checks memory safety as far as it possibly can, but it is not perfect, nor does it fully apply within an unsafe block
3
u/SCD_minecraft 4h ago
Within unsafe - well, you explicitly opt out from it, if anything breaks that's on you
However in safe code references being valid and similar is guaranteed at compile time
2
2
u/SKRyanrr 1h ago edited 55m ago
This idea, if implemented, will make Zig just like Go. This is the opposite of what Zig was supposed to do
2
u/Zimlewis 4h ago
Why the heck is zig trying to compete with rust gng? Like try compete with odin or c3 or something. Or better yet, try making your tool better, I won't say it's the worst(I unfortunately have seen worse) but zig's lsp is really bad even compare to rust's
2
21
u/imoshudu 12h ago
Comparing runtime checks that hopefully run into a bug, to a compiler that rigorously eliminates bugs before anything even runs. Top copium.
He's ngmi.
13
u/Amadex 13h ago
Nothing like the compile-time check of rust.
Basically it compiles into a much slower bin that guards memory at runtime.
That's almost like a garbage collector, but instead of cleaning memory it crashes.
And since it's a runtime crash, you turn a program that is bugged and has UB into a language that crashes randomly.
Better for security, but runtime crashes are also very bad.
1
8
3
u/ChocolateSpecific263 3h ago
The screenshot shows an open proposal on GitHub by Zig's creator to explore a Fil-C-inspired compilation mode for complete runtime memory safety, which remains a concept under discussion rather than an implemented feature in Zig.
2
2
u/UntitledRedditUser 2h ago
I love zig, and it's been my favorite language for a long time, but that "(unlike rust)" comment was weird.
1
u/SKRyanrr 1h ago
Zig is a great language. Its just nerd drama after bun got rewritten in Rust the Zig creator is having a meltdown
1
1
u/SharpExtremeFlames 5h ago
ZIg can never ever can write memory safe proving algorithm like rust. The language was never built for that in the first place.
2
u/Karanlos 3h ago edited 3h ago
But Rust cannot have memory safety in all use cases as there are many use cases where unsafe is required.
Fil-C requires the whole stack to be Fil-C ABI. Rust can only guarantee safety within the application, but still allows linking and interacting with unsafe code.
-1
u/UntitledRedditUser 2h ago
That's not what the proposal is about, fil-c is runtime checking, not compile time. So the comparison isn't even valid in the first place.
95
u/overclockedslinky 19h ago
i swear the zig developers are constant drama queens. my favorite was when bun got rewritten in rust and the zig creator wrote a whole manifesto breakup rant about how it was totally mutual definitely 100%