zlacker

[return to "Zig Libc"]
1. OsamaJ+Ea1[view] [source] 2026-02-02 22:46:04
>>ingve+(OP)
250 C files were deleted. 2032 to go. Watching Zig slowly eat libc from the inside is one of the more satisfying long term projects to follow
◧◩
2. LexiMa+Ra2[view] [source] 2026-02-03 05:44:31
>>OsamaJ+Ea1
That's something I've always admired about Zig.

A lot of languages claim to be a C replacement, but Zig is the second language I've seen that seemed like it had a reasonable plan to do so at any appreciable scale. The language makes working with the C ABI pretty easy, but it also has a build system that can seamlessly integrate Zig and C together, as well as having a translate-c that actually works shockingly well in the code I've put through it.

The only thing it didn't do was be 99% compatible with existing C codebases...which was the C++ strategy, the first language I can think of with such a plan. And frankly, I think Zig keeping C's relative simplicity while avoiding some of the pitfalls of the language proper was the better play.

◧◩◪
3. Walter+0q2[view] [source] 2026-02-03 07:56:28
>>LexiMa+Ra2
D can import C files directly, and can do C-source to D-source translation.

D can compile a project with a C and a D source file with:

    dmd foo.d bar.c
    ./foo
◧◩◪◨
4. audunw+hJ2[view] [source] 2026-02-03 10:21:42
>>Walter+0q2
Do you have to bring up D in every Zig related post?

I do like D. I've written a game in it and enjoyed it a lot. I would encourage others to check it out.

But it's not a C replacement. BetterC feels like an afterthought. A nice bonus. Not a primary focus. E.g. the language is designed to use exceptions for error handling, so of course there's no feature for BetterC dedicated to error handling.

Being a better C is the one and only focus of Zig. So it has features for doing error handling without exceptions.

D is not going to replace C, perhaps for the same reasons subsets of C++ didn't.

I don't know if Zig and Rust will. But there's a better chance since they actually bring a lot of stuff to the table that arguably make them better at being a C-like language than C. I am really hyped to see how embedded development will be in Zig after the new IO interface lands.

◧◩◪◨⬒
5. bachme+FV2[view] [source] 2026-02-03 11:58:24
>>audunw+hJ2
This is, like, the most ironic comment ever posted on HN. An article about cat nutrition could hit the front page and the Rust fanbois would hijack the conversation.

In this case, however, Walter was not the one that brought up D. He was replying to a comment by someone promoting Zig with the claim that only Zig and C++ have ever had a strategy to replace C. That is objectively false. There's no way to look at what D does in that area and make that sort of claim. Walter and anyone else is right to challenge false statements.

◧◩◪◨⬒⬓
6. LexiMa+yN3[view] [source] 2026-02-03 16:35:35
>>bachme+FV2
> claim that only Zig and C++ have ever had a strategy to replace C

What I actually said was that it was the second language I have seen to do so at any appreciable scale. I never claimed to know all languages. There was also an implication that I think that even if a language claims to be a C replacement, its ability to do so might exceed its ambition.

That said I also hold no ill will towards Walter Bright, and in fact was hoping that someone like him would hop into the conversation to try and sell people on why their language was also worthy of consideration. I don't even mind the response to Walter's post, because they bring real-world Dlang experience to the table as a rebuttal.

On the other hand, I find it difficult to find value in your post except as a misguided and arguably bad-faith attempt to stir the pot.

[go to top]