Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Zig is so cool, but C is cooler.

I like how Zig feels clear and simple to start with. I like that it gives one toolchain and makes cross compilation easy. I like that it helps people see how systems programming can feel approachable again.

I also like that C has done these things for many years. I can use different tools, link libraries, and trust that it will still work. I can depend on standards that keep improving while staying familiar.

I think Zig is exciting for what it adds today. I think C is cooler because it has proved itself everywhere and still runs the world.



I've used for well oven a year now, and I identify with this comment... well no, but I used to. In between Zig, and another language I enjoy was Python, and it was breath of fresh air to come back to the C style that I know and love within Zig. I would have said exactly this, when I first started writing Zig.

Today, Zig is so much better than C. I used to refer to Zig as an improved version of C. But I don't anymore. C may have come first, but chronological roles reversed. If Zig is a programming language, than C is a toy trying to copy Zig's functionality and usability.

Calling C easier to use in a cross platform context is absolutely insane. If I was only concerned about $HOST I would consider using C. Today, when I might want to copy a binary to literally any other system, I wouldn't even consider C. Zig wants code to work. C wants code to compile. There's a stark and critically important difference between the two.

> I think Zig is exciting for what it adds today. I think C is cooler because it has proved itself everywhere and still runs the world.

I couldn't have put it better myself, the only thing C has over Zig is inertia. But I wouldn't consider that a selling point....


Have you tried C23, especially its new Unicode support? It really surprised me after returning to C more than ten years later.

You can now write wide and UTF-8 string literals directly:

    char8_t* s = u8"こんにちは";
    char16_t* t = u"Привет";
    char32_t* ustr = U"你好";

It just works across compilers, no special libraries or hacks needed.

C still feels like C, but cleaner, safer, and more consistent.


I abandoned the goal of investing More time into C when they couldn't get defer into their latest version.

2 years later, already enjoying it in Zig `defer` is a lot less important to me now. But I still view it as a symptom of the death of the language. C isn't dead, by any stretch of the imagination, but it's no longer learning from it's mistakes, where as I still am.


I started learning C again for one simple reason: to understand the Linux kernel. You cannot do that without knowing C, and soon you end up learning about GCC, linkers, and how programs really run.

Once I spent time with it, I saw how many smart ideas from the kernel could be used anywhere. the initcall system that runs modules in order, the way structs with function pointers create flexible drivers, the use of macros to build type-safe lists and so on.

https://www.collabora.com/news-and-blog/blog/2020/07/14/intr...

For real work, though, life is short. I use Go.


I want to love Zig. I like so many of the ideas on paper, but fuck I found it so annoying to write. I ended up switching to Odin and I'm enjoying that so much more.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: