News for hackers. Stuff that matters.
Re:Why Zig over C for Systems Programming by llm_nerd on Friday November 13, 2026 @09:49AM (#50484345)
I wrote recently about a weird issue I encountered with Zig, though to be fair it was related to using Zig to compile C code, humorously in a Rust project (which touches on all of the languages mentioned in this post).

https://dennisforbes.ca/blog/microblog/2026/10/the_accidenta...

While I did just dismiss it as an edge issue, it turns out that this same rather clumsy sort of mistake has happened repeatedly in Zig's pure rewrite of MUSL. And despite being an absolutely catastrophically bad problem, by my judgment, the problem is still in main at this moment, across a wide number of musl function rewrites.

Which gives me pause about the whole zig project. If you're rewriting a critical library, making such simple but consequential mistakes shouldn't happen, and if they do happen it should be a red alert type situation.

Re:Why Zig over C for Systems Programming by dnautics on Friday November 13, 2026 @10:03AM (#50484577)
> Which gives me pause about the whole zig project

The whole zig project is like six people in a trenchcoat. You can't expect them to prioritize your one thing.

Re:Why Zig over C for Systems Programming by llm_nerd on Friday November 13, 2026 @10:07AM (#50484632)
It isn't my thing though. It's quite literally, by choice, their thing. They are the ones who decided that rewriting musl in zig was something they need to do and was such a priority. Only it's a serious regression.

But I mean, the six people in a trenchcoat comment is basically precisely what should give people pause. In my project I simply eliminated zig from the stack entirely because even if I worked around the problems, what comes next? What's the next showstopper that gets waved away as oh well six people in a trenchcoat...

Eh, whatever.

Re:Why Zig over C for Systems Programming by nvme0n1p1 on Friday November 13, 2026 @10:15AM (#50484747)
It's a 0.x project, let them cook. Building things takes time.

https://ziglang.org/documentation/master/std/#std.mem.findSe... didn't exist then, now it does.

And if i may quote from https://ziglang.org/download/0.17.0/release-notes.html:

> Zig has known bugs, miscompilations, and regressions.

> Even with Zig 0.17.x, working on a non-trivial project using Zig may require participating in the development process.

> When Zig reaches 1.0.0, Tier 1 support will gain a bug policy as an additional requirement.

If you're not willing to participate in the development process, then you should wait or use something else.

Re:Why Zig over C for Systems Programming by simonask on Friday November 13, 2026 @10:44AM (#50485186)
Isn't that exactly what they're saying?

Some people (not its creators) talk about Zig as if it's anywhere near production ready. It's fine to be excited about it (there's a lot to be excited about), but we gotta be realistic.

Re:Why Zig over C for Systems Programming by dnautics on Friday November 13, 2026 @10:53AM (#50485328)
No, the framing "give pause" is the soft of framing that people create FUD create
Re:Why Zig over C for Systems Programming by llm_nerd on Friday November 13, 2026 @11:50AM (#50486182)
This whole thread is amazing, and I think people considering Zig should pay close attention.

This submission is advocating Zig over C for system programming. I pointed out a pretty significant reason why maybe you should pause that decision for a bit.

Now it's "FUD", also it's a beta and you're a beta tester, and it's 0.x, and look they disclaim that you shouldn't trust it, and...

This is a bizarre thread. These very comments are precisely why it should give pause (which isn't remotely "FUD", and what an utterly asinine claim). Zig looks neat and it might get there, but this absurd apologism and goalpost moving is not convincing to adopt the language.

Again, in a submission advocating using Zig for system programming. You couldn't script it better.

Re:Why Zig over C for Systems Programming by nvme0n1p1 on Friday November 13, 2026 @10:58AM (#50485424)
Zig team: "Zig is 0.x and has known bugs"

llm_nerd: "I found a bug. This gives me pause about the whole zig project"

I don't see how the latter is a fair reaction given the former. They only just started working on the libc port (although it has been talked about for a while now)

Re:Why Zig over C for Systems Programming by diffxx on Friday November 13, 2026 @10:52AM (#50485314)
They have been cooking for over ten years. It is more than fair to say at this point that they are not capable of shipping a stable, reliable, fast and efficient compiler. It is fundamentally flawed and I could easily write thousands of words explaining why from the architectural design to the development process.

Zig hides behind its pre 1.0 status to justify poor decision making while simultaneously actively trying to attract attention through marketing. That attention translates to resources and influence that are undeserved on the technical merits.

Re:Why Zig over C for Systems Programming by nvme0n1p1 on Friday November 13, 2026 @11:07AM (#50485557)
> I could easily write thousands of words explaining why from the architectural design to the development process.

Alright then go for it, hotshot. We're waiting.

Re:Why Zig over C for Systems Programming by alexrp on Friday November 13, 2026 @01:50PM (#50487993)
> It is fundamentally flawed and I could easily write thousands of words explaining why from the architectural design to the development process.

Always happy to learn.

Re:Why Zig over C for Systems Programming by acedTrex on Friday November 13, 2026 @10:52AM (#50485315)
The dudes name is "llm_nerd" its not worth engaging lol. These are the same people that saw the bun rewrite in rust break tls and fail open and shrugged.
Re:Why Zig over C for Systems Programming by forgotpwd16 on Friday November 13, 2026 @11:29AM (#50485873)
It has been 0.x for 10y+. At this point won't be off if considered 0ver (https://0ver.org) and permanently beta.
Re:Why Zig over C for Systems Programming by MonstraG on Friday November 13, 2026 @10:09AM (#50484665)
I'm not the poster, but I found the related issue:

https://codeberg.org/ziglang/zig/issues/37402

Re:Why Zig over C for Systems Programming by senderista on Friday November 13, 2026 @12:17PM (#50486580)
If their resources are so limited, why have they decided that rewriting libc from scratch is a top priority?
Re:Why Zig over C for Systems Programming by stateoff on Friday November 13, 2026 @10:14AM (#50484741)
Why not adding the link to the issue in the blog post?

https://codeberg.org/ziglang/zig/issues/37402

Looks like it is being worked on.

Personally I think it's not that catastrophic for zig < 1.0. Just a performance regression, and one can always link to other libc implementations, or is their own implementation enforced now?

Re:Why Zig over C for Systems Programming by dleslie on Friday November 13, 2026 @10:17AM (#50484783)
If errors like this are acceptable because of the version number of an otherwise decade old project, then that's ample evidence of why Zig is not ready and should not be used for any software that needs surety.
Re:Why Zig over C for Systems Programming by nvme0n1p1 on Friday November 13, 2026 @10:23AM (#50484873)
When you're setting expectations about a project, it's never a bad idea to listen to the creators themselves.

https://ziglang.org/download/0.17.0/release-notes.html

> Zig has known bugs, miscompilations, and regressions.

> Even with Zig 0.17.x, working on a non-trivial project using Zig may require participating in the development process.

> When Zig reaches 1.0.0, Tier 1 support will gain a bug policy as an additional requirement.

Re:Why Zig over C for Systems Programming by stateoff on Friday November 13, 2026 @10:25AM (#50484925)
https://blog.jetbrains.com/blog/2026/06/05/why-zig-isn-t-1-0...

I did not say it's acceptable, just not catastrophic, especially since workarounds exist.

I've used zig in similar capacity in production in the past and personally I would take the slowdown just to avoid dealing with MSVC :)

Re:Why Zig over C for Systems Programming by Joker_vD on Friday November 13, 2026 @10:27AM (#50484936)
You know that GNU libc to this day essentially calls strlen() on every call to sscanf(), which is pretty much the same issue? And that this behaviour, present in many other implementations of standard C library (including Microsoft's), was responsible for e.g. slow JSON parsing in some very popular online games [0]? Does that mean glibc is still not production-ready?

[0] https://news.ycombinator.com/item?id=26296339

Re:Why Zig over C for Systems Programming by dleslie on Friday November 13, 2026 @10:49AM (#50485258)
sscanf is quadratic in the worst case, and has been flagged along with the rest of the libc string support as being harmful. Its continued existence is for compatibility, but new projects should not use it.
Re:Why Zig over C for Systems Programming by Joker_vD on Friday November 13, 2026 @12:39PM (#50486917)
First of all, sscanf doesn't need to be quadratic in the worst case; it absolutely can work without finding the NUL-terminator first. Second, I'd like to see that list of "flagged along with the bulk of the rest of the libc string support as being hazardous or potentially harmful" functions. Does this list include strchr()? Because if yes, your original argument fails to stand.
Re:Why Zig over C for Systems Programming by Zak on Friday November 13, 2026 @11:57AM (#50486291)
A version number starting with 0 is not just evidence, but a direct statement by the maintainer that software is unstable/pre-release no matter how long it has been in development.
Re:Why Zig over C for Systems Programming by drdexebtjl on Friday November 13, 2026 @10:31AM (#50484994)
[delayed]
Re:Why Zig over C for Systems Programming by senderista on Friday November 13, 2026 @12:15PM (#50486552)
The best kind of correct!
Re:Why Zig over C for Systems Programming by lukaslalinsky on Friday November 13, 2026 @10:59AM (#50485438)
When working with Zig, you are a beta tester. The development process is unfortunately not great, so bugs slip in fairly easily. You need to be ready for it and test your application properly. Large Zig projects don't target the latest version. That said, if you can deal with that, you get a great language that is fun to use and very practical. I think it's worth it, even if it can be frustrating at times.
Re:Why Zig over C for Systems Programming by brabel on Friday November 13, 2026 @12:11PM (#50486507)
I agree Zig can be fun but for real projects people should stick with Rust or even D which is just as fun!
Re:Why Zig over C for Systems Programming by chandlore on Friday November 13, 2026 @11:25AM (#50485818)
Andrew Kelley had a comment re this bug over at lobste.rs:

> I made the judgement call to let this slide in the review. I'm still not sure whether it was the right or wrong call.

https://lobste.rs/s/lh1j0e/shlemiel_painter_is_back_how_zig_...

Re:Why Zig over C for Systems Programming by senderista on Friday November 13, 2026 @12:11PM (#50486502)
Zig can be a hobby/learning project (in which case these elementary mistakes, and the lax development process that allowed them, are totally acceptable), or it can be a project that targets critical applications (like TigerBeetle, which handles REAL MONEY), but it can't be both.