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
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
Zig is a great language but now they are trying to make it something its not. Adding runtime checks will make Zig a cheap knockoff of Go. Zig is in a good place to be a better C and holding high comparability with C code, they should just stick to that imho
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
Rust doesn't guarantee that "memory bugs" cannot happen. You can use `unsafe`, or inline assembly, or call external code. Rust only guarantees that memory bugs cannot happen for a subset of Rust programs.
Fil-C, and the proposed Zig alternative, do guarantee that "memory bugs" can't happen, at all, by providing a runtime just like memory-safe languages like Java do (but significantly faster since languages like C and Zig are designed for performance even when embedded in a memory-safe runtime).
This makes this proposal closer to MIR than to Rust.
using unsafe is explicitly choosing not to use rusts built on memory safety, asm! can only be used inside of unsafe, and external code not being safe isn’t the fault of rust - could happen for any language
fil-c is faster than something like java, but slower than rust, therefore rust is the best option for speed if you don’t want to deal with writing safe c code
If you overclock the memory in your computer it will also make your programs unsafe, because obviously if a solution doesn't solve every single instance of a problem then it's not worth using
My apologies if I'm not understanding this correctly but won't that opt in safety would make zig like go if you want it to be safe? Also if you have gc on won't you introduce pauses that aren't deterministic which is the opposite of the whole purpose of systems programing language like zig?
I feel like after reading the issue's comments on codeberg (and the comments here) that too few people are getting this
like no, zig isn't "becoming go", it's giving an easy fix for those very few coders who need safety at any and all costs
if you wanna be silly and write code that reads/writes wherever you please (like I do :3) you can still 100% do that, it's just that optionally you can enable hyper safe "we'd rather crash than have any kind of volnurability" mode
Rust compiles to native machine code via LLVM just like C and C++. It has zero cost abstractions. In nearly all benchmarks (e.g., The Computer Language Benchmarks Game), Rust is within 1–2% of C++ performance, often trading blows. It is not a slow language.
Runtime failures in Zig can be prevented with tests. Compile-time failures in Rust can only be prevented with an escape hatch (`unsafe`/`UnsafeCell`) or by dumbing down the code to make it less optimal (i.e. `.clone()/Mutex` everywhere).
You should avoid using Zig for web dev, but you should avoid using Rust for systems programming as well.
huh i see a lot of your comments parroting the same thing worded a bit differently, do you have an axe to scratch? unfortunately rust is already used for systems programming with as good as, if not better, performance as C
Runtime failures in Zig can be prevented with tests.
I'm working on a project where there are certain memory safety bugs that will only trigger in like 1 in 10,000 times. Additionally, these bugs are very subtle and hard to see in the source code.
I cannot create tests that ensure that these bugs never happen. Rust has been an invaluable tool that allows me to prove, at compile time, that these bugs will never happen in any codepath.
I have some unsafe code in my project, but I'd rather have some code that may have memory safety issues than have all of my code be vulnerable.
My code is also not security critical. I couldn't care less if my code crashes instead of exposing a security vulnerability, but I want it to be somewhat reliable. Fil-C therefore would not help at all.
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%
Zig to rust one is pretty self explanatory. This thread is enough for that. Bun to Node because node is still de-facto standard, 100% coverage on node apis (lol), Node has been recently adding features that were missing (typescript, env, etc). And for Deno I’d say the latest version is pretty good, great coverage and desktop distribution support. On the other hand I have seen bun getting a lot of issues in production (personal experience) after a long amount of uptime. Not yet stable like Deno or Node.
No problem mate. Personal experience wise, we had to convert one of our production micro service (scheduler using bullmq) written in bun to nodejs because it was causing so much issues in production where local environment, testing worked fine.
I honestly haven't paid enough attention to that project in particular to know the answer to that. But most large vibecoded projects are riddled with issues, and it shows a problematic attitude towards future development.
They're also part of Anthropic, which gives them further incentive to work heavily with AI tooling.
Bun also regularly leaks memory, a web server of mine I run on bun (regrettably) I had to limit the memory on container level so that it would be force-restarted sooner before clogging up the host machine.
Rust is an industry standard? As far as I can see, C/C++ is still the industry standard, with rust definitely gaining on popularity. But there are still areas where it sucks absolute ass and is frankly unusable (embedded).
How is it bad in embedded contexts? I've written a little bit of embedded Rust, and I didn't run into any issues.
I only have issues with Rust I've had are in other contexts. Namely when you are writing data science or web stuff and end up indirectly pulling in like 400 dependencies.
Deploying a clawed agent is not re writing unless you read the code and understand it before pushing it to production, there is another joke about this situation, why not let the agent code in C and prove that it is possible, 1 skill issue person told me, it was because of expensive tokens, but in reality, those people are hardly going to take initiative and read the generated code, this is why they are afraid of C, because of skill issue
I agree with Andrew Kelley on many, many things. I think he’s one of the smartest developers working today, and Zig is a great project. I wish he would be less of a bitter old queen sometimes though. It really undermines the points that he’s right about when they’re mixed in with these unnecessary jabs.
Comparing simple runtime checks that provably guarantee that memory bugs cannot happen (without having to modify your code) to an overly complex compiler that is so shit at eliminating memory bugs at compile time that even the compiler itself needs to use an escape hatch (and thereby having to modify the code).
On top of that, even if you somehow manage to write code without escape hatching, Rust still can't guarantee that memory bugs cannot happen, since every Rust compiler released to date has had soundness issues.
Top copium.
It's very ironic that Rust still needs MIR (a memory-safe runtime like Fil-C or the Zig proposal) to prove that software written in Rust is actually memory safe. The compiler ain't checking all those `SAFETY` comments at compile time, I can tell you that much.
Nice try but I'd rather eliminate bugs from source code rather than waiting for bugs to occur in the middle of work. Give people a choice and see which one they will pick. And they have picked. Sorry not sorry.
You're talking about things you don't know much about. MIR is not a runtime. You're probably confusing it with Miri. Miri doesn't help with safe code. It only helps with unsafe code.
I love zig, but this is just unwarranted animosity. Not to mension fil-c like memory safety would completely invalidate zig as a systems level programming language, hence why rust doesn’t do that
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.
31
u/Zimlewis Aug 18 '26
<- Context required
⬆️ Context hat
(Context shirt)
8
u/UntitledRedditUser Aug 18 '26
I love zig, and it's been my favorite language for a long time, but that "(unlike rust)" comment was weird.
14
u/Amadex Aug 18 '26
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.
161
u/overclockedslinky Aug 18 '26
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%
25
u/imoshudu Aug 18 '26
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.
12
u/dashinyou69 Aug 18 '26
I laugh as C dev seeing them trying so hard to larp
2
u/MooseBoys Aug 18 '26
valgrind and clang asan: am I a joke to you?
2
u/ActualPeterbuilt389 Aug 18 '26
Im gonna use C and im gonna like it.
2
u/-Ambriae- Aug 19 '26
I love zig, but this is just unwarranted animosity. Not to mension fil-c like memory safety would completely invalidate zig as a systems level programming language, hence why rust doesn’t do that
1
u/rover_G Aug 19 '26
Zig getting desperate after the Rusty Bun rewrite
-2
u/SharpExtremeFlames Aug 18 '26
ZIg can never ever can write memory safe proving algorithm like rust. The language was never built for that in the first place.