News for hackers. Stuff that matters.
Re:Zig is so cool, C is cooler by forgotpwd16 on Saturday November 08, 2025 @12:00PM (#45858141)
Obviously the answer to https://nilostolte.github.io/tech/articles/ZigCool.html (discussed in https://news.ycombinator.com/item?id=45852328 ; currently both at first page alongside each other).
Re:Zig is so cool, C is cooler by tamnd on Saturday November 08, 2025 @12:06PM (#45858180)
Yes, I wrote that because of the interesting discussion here, not because of the article content.
Re:Zig is so cool, C is cooler by dj902ihda on Saturday November 08, 2025 @12:15PM (#45858251)
What a dumb writeup.
Re:Zig is so cool, C is cooler by nepthar on Saturday November 08, 2025 @12:24PM (#45858324)
Friendly reminder to take a look at our posting guidelines, found at the bottom of the page.

What specifically did you find dumb about this?

Re:Zig is so cool, C is cooler by jasonjmcghee on Saturday November 08, 2025 @12:22PM (#45858310)
Something I didn't see mentioned are alternative compilers like tcc that provide ~9x faster compilation - very useful during development etc

https://www.bellard.org/tcc/

Re:Zig is so cool, C is cooler by scottlamb on Saturday November 08, 2025 @12:23PM (#45858317)
I'm not rooting for Zig [1] but I think there are some misses here, e.g.:

> Cross-compilation looks like a standout feature in Zig, although C developers have been doing the same thing for decades. ... You can target an embedded ARM board or a RISC-V chip with one flag:

Disagree: Zig's cross-compilation support is better than anything else. For one, installing a toolchain for a different OS/arch combo is not necessarily so easy with C. For another, with Zig you can target an arbitrary Linux glibc version with a commandline argument. Without Zig's toolchain, [2] the best I've seen is to run within a Docker container with that glibc version installed.

[1] almost entirely because I think all new languages should have memory safety (via GC or borrow checking).

[2] I see people linking Rust programs with Zig's toolchain for this reason: https://github.com/rust-cross/cargo-zigbuild

Re:Zig is so cool, C is cooler by synergy20 on Saturday November 08, 2025 @12:46PM (#45858471)
generally speaking, cross compilation is a solved problem for common cpus on the market. on linux it's an installation step away, prepackaged and ready to use.

for newer chips or some vendor-optimized-purpose etc, you have to rely on vendor's SDKs, zig can not help there either.

Re:Zig is so cool, C is cooler by alexrp on Saturday November 08, 2025 @01:09PM (#45858654)
The selling point is not merely cross-compilation; as pointed out in the other thread, it's the any-to-any cross-compilation for any supported target. With Zig, you get to download the compiler for any supported host target and then build binaries for Linux, macOS, Windows, FreeBSD, and NetBSD. In the near future, I intend to expand that list to include OpenBSD, illumos, and SerenityOS too.
Re:Zig is so cool, C is cooler by tamnd on Saturday November 08, 2025 @01:24PM (#45858757)
I really appreciate the enormous amount of work that has gone into Zig.

Let me clarify my goal here: by writing this article I hope to hear solid counterpoints to the first one, which I didn't find very convincing, and to start a more constructive discussion.

I'm also curious, how hard is it to a new target in Zig? For example, FreeBSD and NetBSD are already supported, but OpenBSD isn't yet. What are the main challenges blocking that?

Re:Zig is so cool, C is cooler by abnercoimbre on Saturday November 08, 2025 @01:33PM (#45858819)
Dude your article got flagged, which means it's no longer on the feed.

If you ever use LLMs for "technical accuracy" again, maybe actually test things on the command line.

Re:Zig is so cool, C is cooler by tamnd on Saturday November 08, 2025 @01:40PM (#45858878)
Are you a moderator?

Sorry for all the negativity. I added some clarifications, but it might have been a bit too late.

Re:Zig is so cool, C is cooler by baranul on Tuesday November 11, 2025 @04:44PM (#45893299)
It's not just a matter of who is a moderator. It can be about the topic, what you are saying, or guideline issue. For clarification, you have to email HN.
Re:Zig is so cool, C is cooler by rootnod3 on Saturday November 08, 2025 @01:20PM (#45858728)
Yeah, but doesn't that also apply to GCC or LLVM? Download the target-system version and go compiling away. That is not unique to ZIG.
Re:Zig is so cool, C is cooler by tamnd on Saturday November 08, 2025 @12:30PM (#45858373)
> [2] the best I've seen is to run within a Docker container with that glibc version installed.

Agreed. I will revise that section tomorrow. Also, for compiling Go with CGO enabled, using Docker is the only reliable way to produce a binary correctly linked against glibc, especially when working with RHEL.

Re:Zig is so cool, C is cooler by mtklein on Saturday November 08, 2025 @12:32PM (#45858382)
Zig is so good at this, it is also probably the easiest way to cross-compile C.
Re:Zig is so cool, C is cooler by tamnd on Saturday November 08, 2025 @12:36PM (#45858421)
And it could be used as drop in replacement for gcc/clang

https://andrewkelley.me/post/zig-cc-powerful-drop-in-replace...

Re:Zig is so cool, C is cooler by binary132 on Saturday November 08, 2025 @12:32PM (#45858381)
none of this needs to be batteries-included, and there is no reason it cannot be done just as straightforwardly for C-family languages as it has been for Zig and Rust.
Re:Zig is so cool, C is cooler by estebank on Saturday November 08, 2025 @12:52PM (#45858506)
This is true of almost everything: it's not that Zig or Rust are unique on most features. Most of them have existed in one shape or another before. The praise they receive is because of the level of polish their design and implementation have and how they interact with their other features. There's no one stopping other projects from doing the same thing (modulo technical and organisational considerations), but they haven't yet, so it is reasonable to highlight them. If people talk about how good X is in language Y enough, people from language Z might notice and "steal" it. That's a good thing!
Re:Zig is so cool, C is cooler by binary132 on Sunday November 09, 2025 @07:57AM (#45865252)
I’m saying these things aren’t “language features” at all. I applaud their creation, but “batteries built in” has always seemed to me like a terrible design decision compared to “batteries provided” especially considering that many of these things would have been perfectly satisfactory generic tooling. Now we have people yapping about C++ not having a build system because they’re all habituated to a world where every language has its own, different build system built in.
Re:Zig is so cool, C is cooler by n42 on Saturday November 08, 2025 @12:25PM (#45858330)
It’s hard to see this article as being written in good faith. We’re at the point that we are responding to low quality LLM outputs with low quality LLM retorts and voting them both to the front page because of feelings.
Re:Zig is so cool, C is cooler by e2le on Saturday November 08, 2025 @12:52PM (#45858509)
I'm at the point now where I simply stop reading the article once it has too many red flags, something that is happening increasingly often.

I don't enjoy reading AI slop but it feels worse when users of AI tools have chosen not to disclose the authors of these articles as Claude/ChatGPT/etc. Rather than being honest upfront, they choose to hide this fact.

Re:Zig is so cool, C is cooler by tamnd on Saturday November 08, 2025 @01:15PM (#45858703)
I added some sentences at the top, so it wont waste people's time:

Some parts of this article were refined with help from LLMs to improve clarity and technical accuracy. These are just personal notes, but I would really appreciate feedback: feel free to share your thoughts, open an issue, or send a pull request!

If you prefer to read only fully human-written articles, feel free to skip this one.

Re:Zig is so cool, C is cooler by detaro on Saturday November 08, 2025 @01:40PM (#45858879)
It clearly wasn't "refined" using LLMs when it contained commands that plainly don't work. Don't lie.
Re:Zig is so cool, C is cooler by abnercoimbre on Saturday November 08, 2025 @01:22PM (#45858739)
We've flagged it. Please don't waste our time in the future.
Re:Zig is so cool, C is cooler by 0manrho on Saturday November 08, 2025 @02:39PM (#45859339)
> but I would really appreciate feedback

very well

> Some parts of this article were refined with help from LLMs to improve clarity and technical accuracy

Perhaps you should stick to writing about things you can write with clarity and and accuracy yourself instead of relying on an LLM to do it for you. Alternatively, properly cite and highlight what portions you used AI on/for from the outset as failure to do so reads at best as lazy slop and more often as intentional duplicity

Re:Zig is so cool, C is cooler by averms on Saturday November 08, 2025 @12:30PM (#45858374)
the entire github organization looks to be ai slop books... why even do this?
Re:Zig is so cool, C is cooler by n42 on Saturday November 08, 2025 @12:41PM (#45858450)
As a fan and user of Zig I found the original post embarrassing, but chalked it up to the enthusiasm of a new user discovering the joy of something that clicked for them

Taking offense to that enthusiasm and generating this weirdly defensive and uninformed take is something else, though

Re:Zig is so cool, C is cooler by fwip on Saturday November 08, 2025 @12:56PM (#45858549)
Edit: Apologies, it looks like I misunderstood. Original response left below for posterity.

It's not "weirdly defensive and uninformed" to question the value of posting a bunch of inaccurate LLM slop, especially without any disclosures.

If you're pro-AI, you should be against this too, before these errors get used as training data.

Re:Zig is so cool, C is cooler by wasabi991011 on Saturday November 08, 2025 @01:27PM (#45858777)
I think you are misunderstanding, they are calling TFA a defensive and uninformed reply to the pro-Zig post from yesterday.
Re:Zig is so cool, C is cooler by fwip on Saturday November 08, 2025 @02:14PM (#45859135)
Ohhhh, my apologies, then.
Re:Zig is so cool, C is cooler by n42 on Saturday November 08, 2025 @02:40PM (#45859354)
I can see how you would have read it that way, now, but yes — I meant this article is defensive for no reason while being uninformed
Re:Zig is so cool, C is cooler by pyrolistical on Saturday November 08, 2025 @12:34PM (#45858401)
The main reason why C is used everywhere is because the C ABI is the de facto ABI.

This is why Zig was smart to have first party support for C libs.

In fact the fact Zig pointer types are more precise, it allows imported C libs to be more correct than the original C.

Re:Zig is so cool, C is cooler by do_not_redeem on Saturday November 08, 2025 @12:34PM (#45858405)
Not a single mention of defer? There's no way I'll ever go back to writing goto towers.

Yes, I'm aware that some specific C toolchains have nonstandard extensions that accomplish the same thing, but if you lock yourself into one of those, the "Portability and Presence" section (and really, the first 20% of the article) goes out the window.

Re:Zig is so cool, C is cooler by 0x696C6961 on Saturday November 08, 2025 @01:28PM (#45858787)
C is actually getting defer!
Re:Zig is so cool, C is cooler by lelanthran on Sunday November 09, 2025 @12:58AM (#45863295)
> Not a single mention of defer? There's no way I'll ever go back to writing goto towers.

What's a goto tower?

(Repeating sibling post, `defer` is in the works for C as well)

Re:Zig is so cool, C is cooler by benatkin on Saturday November 08, 2025 @12:35PM (#45858412)
This feels wrong.

> Zig's compiler is self-contained. It includes a build system, cross-compilers, and package management features. This makes it simple for small projects or single-language codebases.

> C follows a different philosophy. Its toolchain is composable. The compiler, linker, build system, and package manager are independent pieces. You can use GCC or Clang, build with Make or Ninja, manage dependencies with apt or brew, and link with ld, lld, or mold.

Zig would be more composable, as rather than being separate programs, you can write code to compose them in different ways. You are composing in zig rather than bash.

Re:Zig is so cool, C is cooler by tamnd on Saturday November 08, 2025 @12:42PM (#45858452)
I see it a bit differently. Zig's toolchain is self-contained: one binary gives you the compiler, build system, cross-compilers, and a package manager. It doesnt depend on the system toolchain, which makes builds reproducible and easy to move between machines.

C's ecosystem is the opposite. It is modular, built from separate tools like GCC, ld, Make, and apt. You compose them externally.

Re:Zig is so cool, C is cooler by omgtehlion on Saturday November 08, 2025 @12:40PM (#45858448)
I have read both articles (this and zig-cool), and I regret the time wasted.

IMO, both articles fail to deliver on their titles :(

Both fail to list really cool parts, and both reiterate same arguments several times. This one even looks like an LLM output, but I'm not sure.

Re:Zig is so cool, C is cooler by tamnd on Saturday November 08, 2025 @12:44PM (#45858466)
Sorry you felt that way.

Which parts did you feel were missing or didn't live up to the title? What kind of points or examples would have made it feel more worthwhile to you?

Re:Zig is so cool, C is cooler by mzajc on Saturday November 08, 2025 @01:51PM (#45858960)
Nice dodge.
Re:Zig is so cool, C is cooler by 201984 on Saturday November 08, 2025 @12:43PM (#45858457)
>You can target an embedded ARM board or a RISC-V chip with one flag:

  gcc main.c --target=arm-linux-gnueabihf -o app
AI hallucination? --target does not exist in GCC. Clang has -target, but you still need to install libc for the target architecture.
Re:Zig is so cool, C is cooler by ramon156 on Saturday November 08, 2025 @01:12PM (#45858676)
https://github.com/little-book-of/c/commit/aa7496f9ba58ac11a...

just got updated with some clarity

> *Some parts of this article were refined with help from LLMs to improve clarity and technical accuracy. These are just personal notes, but I would really appreciate feedback: feel free to share your thoughts, open an issue, or send a pull request!*

Re:Zig is so cool, C is cooler by 201984 on Saturday November 08, 2025 @01:44PM (#45858909)
Seems the technical accuracy wasn't improved very much, if at all.
Re:Zig is so cool, C is cooler by e2le on Saturday November 08, 2025 @12:58PM (#45858565)
They fixed this "mistake" a few minutes ago.

https://github.com/little-book-of/c/commit/43b0a89852a507bdd...

Re:Zig is so cool, C is cooler by 201984 on Saturday November 08, 2025 @01:01PM (#45858582)
And that "fix" is not "one flag" any more either since you have to install that compiler somehow.
Re:Zig is so cool, C is cooler by e2le on Saturday November 08, 2025 @01:12PM (#45858679)
I wonder if they are simply pasting your criticism into an AI prompt.

https://github.com/little-book-of/c/commit/349d475a5922cf005...

Re:Zig is so cool, C is cooler by 201984 on Saturday November 08, 2025 @01:39PM (#45858862)
Lmao, probably. I'm not going to trust anything else this person has written, since this has proven to me he's writing about things he has little experience with.
Re:Zig is so cool, C is cooler by abnercoimbre on Saturday November 08, 2025 @12:56PM (#45858542)
Unfortunate to say the article does smell like LLMs had a heavy hand in it.
Re:Zig is so cool, C is cooler by cesarb on Saturday November 08, 2025 @12:52PM (#45858512)
> AI hallucination? --target does not exist in GCC.

It might also be someone used to a system which symlinks "gcc" to clang for compatibility (IIRC, that's the case at least on OS X).

Re:Zig is so cool, C is cooler by 201984 on Saturday November 08, 2025 @12:53PM (#45858522)
It's still just a single hyphen on clang, double hyphen like in the post does not work on clang either.
Re:Zig is so cool, C is cooler by synergy20 on Saturday November 08, 2025 @12:44PM (#45858462)
gcc main.c --target=arm-linux-gnueabihf -o app

this is definitely wrong, the correct way is to use arm-linux-gnueabihf-gcc main.c instead, there is no such flag called --target per se

Re:Zig is so cool, C is cooler by tamnd on Saturday November 08, 2025 @12:50PM (#45858492)
Fixed, thanks for pointing this out.
Re:Zig is so cool, C is cooler by 201984 on Saturday November 08, 2025 @01:00PM (#45858569)
Did you not even try the original command? As you've now updated it (https://github.com/little-book-of/c/commit/43b0a89852a507bdd...), it is definitely not one simple flag since arm-linux-gnueabihf-gcc has to be installed from somewhere. It doesn't exist in a default installation of GCC that only targets the host, and you'll need to install a GCC version for every architecture you want to target.
Re:Zig is so cool, C is cooler by laxd on Saturday November 08, 2025 @12:54PM (#45858524)
> But before Zig, there was C. For fifty years, C has been the foundation of modern computing.

And for fifty years, language theory has made progress. While C, brilliant as it once was, has given us never ending problems with security and reliability. The software world is saturated anyways. It's time to revise rather than just layering new junk in chase of profit.

> This article does not aim to dismiss Zig. Its focus is on the fact that C never stopped evolving.

It didn't stop but it certainly slowed down to glacial pace. There's plenty of fundamental issues that will never be fixed.

That said. I wish the software world would just keep its cool and not commit to Rust so fast. Rust was the first in a trend of new low level languages. It snowballed and now we may not get to make an informed decision on how the future of low level programming should be. I personally like Zig a lot more. Unfortunately people seem to be neither adequately scared of complexity nor sufficiently impressed by simplicity.

Re:Zig is so cool, C is cooler by stephc_int13 on Saturday November 08, 2025 @12:59PM (#45858568)
The Zig self-contained toolchain is one of the most appealing feature IMO, and it can also be used to compile C.

That said, I was very interested in Zig 2-3 years ago but that has mostly cooled off, C is not perfect but good/flexible enough for what I am building.

Zig has some opinionated language features/idiosyncrasies that I don't like and the syntax feels somewhat less clean.

Also, while I really like the memory management approach (passing allocators as parameters) the way it is implemented is conflicting some of my needs. There are probably some workarounds but I don't feel the need to invest much time in this language as the added QoL benefits are not simply not outweighing the cost for me.

Re:Zig is so cool, C is cooler by bbkane on Saturday November 08, 2025 @01:02PM (#45858592)
I feel like passing allocators is the most flexible design (if cumbersome to use). What needs does it conflict with?
Re:Zig is so cool, C is cooler by Cieric on Saturday November 08, 2025 @01:01PM (#45858583)
I really wish I could like zig more, I started using it heavily around 0.11, but I feel like as more features get implemented there is more that I like and more that I hate.

They've recently fallen into the trap of the wrong whitespace will now error compilation, which has effected me directly.

All the none blocking IO was stuck behind async, which when I was trying to use it it literally didn't exist (this might have changed in 0.15 from the videos I've seen, but all my code fails to compile now do to the former issue with whitespace).

I might come back at Zig 1.0 as long as some of the stupid decisions can be reverted or worked around in some way I find acceptable, otherwise I might just fork it myself to fix it so I can still have some fun with the language.

Re:Zig is so cool, C is cooler by TheMagicHorsey on Saturday November 08, 2025 @01:02PM (#45858593)
This is like that situation where a kid goes up to the dad who abandoned him and says, "You have given me nothing! I had to do everything myself."

And the dad says back, "By giving you nothing I have given you everything. Look at the tough guy you have become!"

Re:Zig is so cool, C is cooler by lelanthran on Sunday November 09, 2025 @12:57AM (#45863291)
Like that Johnny Cash song, A Boy Named Sue.
Re:Zig is so cool, C is cooler by xigoi on Saturday November 08, 2025 @01:25PM (#45858765)
Ah yes, the “portable” language where different implementations can’t even agree on how big an integer is. Don’t get me started about the “transparency in behavior” that’s not even close to how any modern computer works.
Re:Zig is so cool, C is cooler by jokoon on Saturday November 08, 2025 @01:37PM (#45858842)
I like neither C nor zig

C is too verbose, Zig has too many features and things.

I would rather have some sort of "improved C", without the complexity of C++, but with things map, string, vector math, etc, just standard quality-of-life stuff.

Zig has the same problems rust has: its syntax is too complicated, too modern and sophisticated.

Language designers need to understand that programmers are not always patient, smart or motivated to learn all those things. It's the 101 of user experience: make it easy and intuitive.

The programming language who dominate, dominate because they are accessible to lesser skilled people.

The more complex it is, the fewer chance it will reach adoption.

Re:Zig is so cool, C is cooler by Too on Saturday November 08, 2025 @01:42PM (#45858889)
> It includes some of the most advanced tools in computing

Half of them which shouldn’t be needed if the language didn’t let you shoot yourself in the foot in the first place.

> Transparency in Behavior

Undefined behavior has entered the chat

> Loop structures are clean and readable

If you like fiddling with i-variables and sizeof like foreach never happened.

> Error handling and optional results use simple, explicit patterns.

Proceeds and ignores the return code of fread(), leaving errors unhandled.

At this point I lost it as became more and more obvious it’s both AI slop and it’s ignoring the past 20 years of progress in programming languages. C may have its uses but jeez don’t pretend it is ergonomic.

Re:Zig is so cool, C is cooler by em-bee on Saturday November 08, 2025 @01:48PM (#45858935)
the part where C syntax examples are shown misses the same examples in zig to really allow a comparison. i am already familiar with C. giving me a C example and telling me it's better than zig does not tell me anything. i'd need to see the equivalent zig example too.