News for hackers. Stuff that matters.
Re:Why is Zig so Cool? by SonnyTark on Saturday November 08, 2025 @08:41AM (#45856597)
This is a very confusing blog post. I found myself looking for ChatGPT markers because it doesn't make sense to say: omg zig is so much cooler than C here's why, then start listing the absolute basics of the language that are identical in most modern languages without any actual reflection why writing the same thing in a different syntax somehow makes zig superior?
Re:Why is Zig so Cool? by raldu on Saturday November 08, 2025 @09:53AM (#45857003)
Titles get the headlines.
Re:Why is Zig so Cool? by muragekibicho on Saturday November 08, 2025 @10:07AM (#45857114)
I've learnt this the hard way. The most important thing is to get you to click. Sometimes I'll first iterate over the title before even writing on substack.
Re:Why is Zig so Cool? by tamnd on Saturday November 08, 2025 @10:11AM (#45857138)
I have learned that too. If you write about C, almost no one clicks. It is not new, it is not flashy, and it does not promise easy results. Yet almost everything still runs on it. The quiet parts of computing rarely get attention, even though they keep everything working.

I still write about C anyway. It may not trend, but it lasts.

Re:Why is Zig so Cool? by tialaramex on Saturday November 08, 2025 @11:31AM (#45857898)
I'm sure I'm not alone - after decades - already knowing far too much about C, so that any article I'm likely to read either I'm like "No, that's wrong and I even understand why you thought that, but it's still wrong" or I just nod along and sigh.

I spent a substantial fraction of my professional career writing C, and I remain interested in WG14 (the language committee) and in several projects written in C though I avoid writing any more of it myself.

The reason it's so widespread is called "Worse is Better" and I believe that has somewhat run its course. If you weren't aware of "Worse is better" a quick Google should find you the original essay on that topic years back.

In contrast when I read an article about say Zig, or Swift, I am more likely to learn something new.

But I can certainly endorse your choice to write about whatever you want - life is too short to try to get a high score somehow.

Re:Why is Zig so Cool? by tamnd on Saturday November 08, 2025 @11:40AM (#45857985)
Thanks for sharing your thoughts. I have never deployed any production C code and I would not choose C for professional work either, but learning it, with all its rough edges, has made me a better engineer. It helps me understand how things really work under the hood. No pain, no gain.

Maybe I am biased, but for professional work, I stay with Go. I have built large distributed data systems that handle hundreds of millions of business transactions daily, and Go has been steady and reliable for that scale. Its simplicity, strong concurrency model, and easy deployment make it practical for production systems. I still enjoy exploring Zig and Rust in my spare time, but for shipping real systems, Go continues to get the job done without getting in the way.

Re:Why is Zig so Cool? by lelanthran on Sunday November 09, 2025 @01:07AM (#45863335)
> I still write about C anyway. It may not trend, but it lasts.

> I have never deployed any production C code and I would not choose C for professional work either

What do you write about C, if not for practical usage in the industry? Can you post some links?

FWIW, since you seem interested, here are some blog posts of mine specifically about practical usage of C, some of which got a little discussion here on HN in the past:

https://www.lelanthran.com/chap13/content.html

https://www.lelanthran.com/chap9/content.html

https://www.lelanthran.com/chap5/content.html

Re:Why is Zig so Cool? by tamnd on Saturday November 08, 2025 @11:43AM (#45858012)
> I'm sure I'm not alone - after decades - already knowing far too much about C, so that any article I'm likely to read either I'm like "No, that's wrong and I even understand why you thought that, but it's still wrong" or I just nod along and sigh.

If you have some spare time, I would really like to hear more about your experiences. It sounds like you have worked with C for a long time, and that kind of insight is hard to find now.

Most people around me started with JavaScript or TypeScript as their first language, and for many, that is still all they know. I mean no disrespect, it is just how things are today. It would be great to hear how your view of programming has changed over the years and what lessons from C still matter in your work today.

Re:Why is Zig so Cool? by johnisgood on Saturday November 08, 2025 @08:18PM (#45861980)
How old are you? I am asking because of "Most people around me started with JavaScript or TypeScript as their first language".

Am I old? I am 31, and I started with C around age 14 (writing mods for ioquake3 forks), been my most used programming language ever since.

Re:Why is Zig so Cool? by lelanthran on Sunday November 09, 2025 @01:08AM (#45863343)
> It sounds like you have worked with C for a long time, and that kind of insight is hard to find now.

I've already replied to you in a sibling post, but I have been writing in C since the mid-90s; there's really not that much insight you get specifically to C.

Re:Why is Zig so Cool? by zamadatix on Saturday November 08, 2025 @11:07AM (#45857653)
An alternative view of "not new and flashy" is "known and expected", which not 100% of C conversations have to be. Just look at the excitement around Fil-C lately!
Re:Why is Zig so Cool? by tamnd on Saturday November 08, 2025 @10:14AM (#45857165)
Oh, and I just submitted a link to my article about C. I am pretty sure no one will click it.

Articles about C never get much traffic, but that is fine. I wrote it because I care about how things really work, not because I expect it to trend. If even a few people read it and see the beauty in the old language that still runs the world, that is enough.

Re:Why is Zig so Cool? by rand0m4r on Saturday November 08, 2025 @11:16AM (#45857737)
I would like to find more articles on C so feel free to share, thanks
Re:Why is Zig so Cool? by tamnd on Saturday November 08, 2025 @11:27AM (#45857861)
Here is the link for you: https://github.com/little-book-of/c/blob/main/articles/zig-i...

I hope next month I will have more time to write deep dives into the internals of SQLite, PostgreSQL, Redis and maybe curl, all written in C.

Re:Why is Zig so Cool? by zobzu on Saturday November 08, 2025 @01:45PM (#45858912)
thanks, i enjoyed reading it (though a bit lengthy).

what gets me personally is what you describe at https://github.com/little-book-of/c/blob/main/articles/zig-i... - zig is made to feel easy and modern for people who don't know any better, and it does this well. But as soon as you actually need to do complex stuff, it gets in the way moreso than C and it's current environment/ecosystem will.

And to be fair, as much as I enjoyed writing in C in my younger years - I only use C when I actually need C. And asm when I actually need asm. Most of my code now uses higher level languages - this puts zig into such a niche.. it feels like golang to me: the cool language that isn't really solving as much of a need as you'd think.

Re:Why is Zig so Cool? by tamnd on Saturday November 08, 2025 @02:02PM (#45859038)
And I want to clarify again, these are just personal notes written with some help from LLMs. They may contain mistakes, so please read them with curiosity, or feel free to skip them altogether.
Re:Why is Zig so Cool? by tamnd on Saturday November 08, 2025 @02:00PM (#45859019)
I mean, if you embed Zig in a larger C++, Rust, or Python project, coordinating the build systems can be difficult. Zig prefers to manage the entire pipeline itself, so mixing it with other compilers and dependency managers can require workarounds. In my opinion, the only practical way to do this is by exposing C interfaces.
Re:Why is Zig so Cool? by bnolsen on Monday November 10, 2025 @09:48PM (#45883627)
I don't think zig is that much more complex than golang, with a (currently) crappier standard library. The bonus being you leave no performance on the table. I wonder if it would work with devops, where both c++ and rust fails.
Re:Why is Zig so Cool? by tamnd on Saturday November 08, 2025 @11:30AM (#45857891)
and my favorites:

   - https://daniel.haxx.se/blog/2025/04/07/writing-c-for-curl/
   - https://www.sqlite.org/whyc.html
Re:Why is Zig so Cool? by rand0m4r on Saturday November 08, 2025 @01:38PM (#45858849)
thanks again
Re:Why is Zig so Cool? by antegamisou on Saturday November 08, 2025 @10:05AM (#45857101)
Honestly this (the fact it is being massively upvoted) looks a lot more like paid promotion. Not the first time and not the only example of submission btw.
Re:Why is Zig so Cool? by scotty79 on Saturday November 08, 2025 @10:07AM (#45857110)
What I got was:

  - pointers to bitfields
  - checked bitshifts
  - small ints like u4
  - imperative array initialization blocks
  - test code blocks
  - equivalent of debugger; keyword from js
  - some vague stuff about being able to do at compile time
The rest is pretty generic
Re:Why is Zig so Cool? by beej71 on Saturday November 08, 2025 @12:03PM (#45858161)
I had to dig farther on the compile time execution stuff. It's actually pretty cool-looking. Recommend digging into it. I don't know that it's a killer enough feature to draw me away from Rust's guarantees, but it is interesting.
Re:Why is Zig so Cool? by jandrewrogers on Saturday November 08, 2025 @12:54PM (#45858523)
It is difficult to overstate how useful compile-time execution is in practice. I can't imagine using a systems language without it now. The term "modern C++" largely denotes when compile-time execution was added to that language.

I would love to see Rust get compile-time execution that is as capable as Zig or C++20.

Re:Why is Zig so Cool? by nicce on Saturday November 08, 2025 @03:42PM (#45859794)
> I would love to see Rust get compile-time execution that is as capable as Zig or C++20.

Can you give examples? Const functions are pretty capable in Rust already.

Re:Why is Zig so Cool? by kllrnohj on Saturday November 08, 2025 @07:20PM (#45861602)
> I would love to see Rust get compile-time execution that is as capable as Zig or C++20.

Isn't that just macros which are way more powerful than what Zig or C++20 offer?

Re:Why is Zig so Cool? by aib on Saturday November 08, 2025 @09:32AM (#45856879)
You're absolutely correct! </s>

The "how to modify an environment variable" bit and the bin-dec-hex table made me feel the same way. Then I saw the part explaining how to check for duplicates in a row... I'm struggling to understand the point of the article. Testing a text generator?

Re:Why is Zig so Cool? by joaogui1 on Saturday November 08, 2025 @09:55AM (#45857018)
Also bizarre that it got to the front page of HN while being so low quality :/
Re:Why is Zig so Cool? by dustymcp on Saturday November 08, 2025 @10:01AM (#45857071)
Well i think that is why it got there people really love hating :)
Re:Why is Zig so Cool? by bigbuppo on Saturday November 08, 2025 @06:48PM (#45861325)
They're excited about their new hammer.