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. Goblin+Vz3[view] [source] 2026-02-03 15:42:07
>>audunw+hJ2
C++ is more C-like than Zig and Rust, so it's more likely to become a C replacement.
◧◩◪◨⬒⬓
6. bnolse+lva[view] [source] 2026-02-05 12:41:10
>>Goblin+Vz3
Except for all the baggage it carries along with it including hacks to address baggage resulting in a very bloated language.
[go to top]