Earlier quoted context omitted.
> how to handle errors and diagnostics, though it's an area of active exploration I am flabbergasted and exasperated by this sentiment. Zig is over 9 years old at this point. This feels this same kind of circular arguments from Golang "defenders" about generics and error handling.
Go gets a lot of flack for getting some things wrong but it was a stable and productive language within a couple of years. If you look at the current Zig website the hello world example doesn’t compile because they changed the IO interface. Something as simple as writing to the console. It’s easier to get things right if you have no issues breaking backward compatibility for a decade. It feels it’ll be well over 10 y…
Why is Zig so cool?
331–340 of 527 posts
Re: Why is Zig so cool?
#332Rust passes that test because it's categorically better than C and C++ in several ways: much better type system, safety, better modules and code reuse, etc. It's complex, but as far as I can tell most of its complexity is required to offer its level of safety guarantees in a pure systems language without a garbage collector or any kind of true dynamic typing. To make a safe systems language you need to have a very rich type system that can prove safety across a wide array of situations. Either that or you'd have to go to the other far end of the simplicity-complexity spectrum and have a language with virtually no features, which would result in very verbose code and probably a lot of boilerplate.
Zig's coolest feature to me seems like "comptime" and the lack of a weird macro side-language, which is one of Rust's anti-features that feels bolted on. Don't make me learn yet another language. Of course sophisticated macros in Rust are usually instead written in Rust itself via procedural macros, but that is more unwieldy than "comptime."
Still not enough to justify a whole new language and ecosystem though. Again: don't make me learn yet another language unless there's a big payoff.
Re: Why is Zig so cool?
#333Earlier quoted context omitted.
Titles get the headlines.
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.
I still write about C anyway. It may not trend, but it lasts.
Re: Why is Zig so cool?
#334Zig 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…
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....
Re: Why is Zig so cool?
#335Earlier quoted context omitted.
Titles get the headlines.
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.
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?
#336A neat little thing I like about Zig is one of the options for installing it is via PyPI like this: https://pypi.org/project/ziglang/ pip install ziglang Which means you don't even have to install it separately to try it out via uvx. If you have uv installed already try this: cd /tmp echo '#include int main() { printf("Hello, World!"); return 0; }' > hello.c uvx --from ziglang python-zig cc /tmp/hello.c ./a.out
That's really cool actually. Now that AI is a little more commonly available for developer tooling I feel like its easier than ever to learn any programming language since you can braindrain the model.
During the last year I have been observing how MCP, tools and agents, have reduced the amount of language specific code we used to write.
Re: Why is Zig so cool?
#337Earlier quoted context omitted.
Of which, perhaps, the author isn't aware? Perhaps the author has very narrow experience in programming languages. Or it's hyperbolic.
>Perhaps the author has very narrow experience in programming languages. I got that impression as well. Xi's impressed about types being optional because they can be inferred. That's ... hardly a novelty ...
Funny they mention Java that has got type inference few years now. Even C got a weaker version of C++'s auto in C23.
Re: Why is Zig so cool?
#338Earlier quoted context omitted.
> C/C++ It has been several decades since putting a slash between these two made sense, lumping them together like this. It would be similar to saying something like Java/Scala or ObjectiveC/Swift. These are completely different languages.
Nope, that is a English grammar construct that is a shortcut for "and" and "or", as any good English grammar book will explain. Indeed you see those for Java/Scala and Objective-C/Swift in technical books and job adverts. Any search on the careers sites, or documentation, on companies that have seats at ISO, sell/develop C and C++ compilers, have such C/C++ references in a couple of places. Do you need any example?
Re: Why is Zig so cool?
#339Earlier quoted context omitted.
In the general case yes, but "C/C++" became an idiom for the stance, that C and C++ are essentially the same, that C++ is a superset of C or that C++ is just the replacing successor of C and it should be treated as superseded. This is quite wrong and thus there is a lot of rightful intervention to that term. Personally I use "C, C++" when I want to talk about both without claiming, that they are the same language.
Nah, that is what pedantic folks without English grammar knowledge keep complaining about, instead of actually discussing better security practices in both languages. It is a bikeshedding discussion that doesn't help in anything, regarding lack of security in C, or the legions of folks that keep using C data types in C++, including bare bones null terminated strings and plain arrays instead of collection types with b…
Re: Why is Zig so cool?
#340Earlier quoted context omitted.
Java and Rust have surpassed 1.0 version a long time ago, so they don’t remove features left and right on each feature release. Not that it’s a bad thing. Python removes stuff, and it takes time to upgrade to new versions.
And Zig has surpassed 1.0 or where is the argument?