5 ms·
I'm afraid this article kinda fails at at its job. It starts out with a very bold claim ("Zig is not only a new programming language, but it’s a totally new way
by unscaled 11mo ago
I'm afraid this article kinda fails at at its job. It starts out with a very bold claim ("Zig is not only a new programming language, but it’s a totally new way to write programs"), but ends up listing a bunch of features that are not unique to Zig or even introduced by Zig: type inference (Invented in the late 60s, first practically implemented in the 80s), anonymous structs (C#, Go, Typescript, many ML-style languages), labeled breaks, functions that are not globally public by default...
It seems like this is written from the perspective of C/C++ and Java and perhaps a couple of traditional (dynamically typed) languages.
On the other hand, the concept that makes Zig really unique (comptime) is not touched upon at all. I would argue compile-time evaluation is not entirely new (you can look at Lisp macros back in the 60s), but the way Zig implements this feature and how it is used instead of generics is interesting enough to make Zig unique. I still feel like the claim is a bit hyperbolic, but there is a story that you can sell about Zig being unique. I wanted to read this story, but I feel like this is not it.
- deleted 11mo ago[deleted]
- neuvarius 11mo ago[flagged]
- debo_ 11mo agoAre you ok?
- JSR_FDED 11mo agoI use Lua in 2025, it’s brilliant. By the way, so does everyone using neovim.
- zimpenfish 11mo ago> By the way, so does everyone using neovim. See also Roblox (and there used to be a whole bunch of game engines that had Lua scripting but I -think- most of them have switched to "NIH!" scripting engines?)
- tourist2d 11mo agoAs a c++ developer who's heard of Zig but never dived into it, I was reading this article scratching my head wondering what is it actually so unique about it. Why the blog has a section on how it install it on the path is also very puzzling.
- deleted 11mo ago[deleted]
- bnolsen 11mo agoZig is simple, clever and clean. certainly not perfect but it addresses much of what I disliked about c++. I wanted to like D and rust but they seem just as complex as c++. Yes, better in some ways but still full of complexity.
- phplovesong 11mo agoAgreed. But i would not put comptime as some sort of magical invention. Its still just a newish take on meta programming. We had that since forever. From my minimal time with Zig i kind of think comptime as a better version of c++ templates. That said Zig is possibly a better alternative to c++, but not that exiting for me. I kind of dont get why so many think its the holy grail, first it was rust, and now zig.
- deleted 11mo ago[deleted]
- johnisgood 11mo agoAs much as I dislike Rust, I gotta give it credit where it's due. It has something unique: a borrow checker. What is so unique in Zig?
- flohofwoe 11mo ago> It has something unique: a borrow checker. Rust's borrow checker isn't unique either but was inspired by Cylone: https://en.wikipedia.org/wiki/Cyclone_(programming_language) https://en.wikipedia.org/wiki/Cyclone_(programming_language) IMHO a programming language doesn't need a single USP, it just needs to include good existing ideas and (more importantly) exclude bad existing ideas (of course what's actually a good and bad idea is highly subjective, that's why we need many programming languages, not few).
- simonask 11mo agoRust's borrow checker is unique in the sense that it is production-ready. Cyclone is indeed prior art, but it's not as if it ever got beyond the research project stage.
- johnisgood 11mo agoI don't necessarily disagree, of course. That is why I like Odin the most so far, and perhaps C3.
- Shorel 11mo agoCompile time seems to be a standard feature in D-lang as well. Powerful macros that generate code that then gets compiled =)
- nwhnwh 11mo ago"this article kinda fails at at its job" Definitely.
- WalterBright 11mo agoD has had compile time function execution since 2007 or so. https://dlang.org/spec/function.html#interpretation https://dlang.org/spec/function.html#interpretation It doesn't need a keyword to trigger it. Any expression that is a const-expression in the grammar triggers it.
- jhgb 11mo agoBut Zig doesn't need a keyword to trigger it either? If it's possible at all, it will be done. The keyword should just prevent run-time evaluation. (Unless I grossly misunderstood something.)
- WalterBright 11mo agoI'm no expert on Zig, but "comptime" is the keyword to trigger it.
- jhgb 11mo agoI'm pretty sure the "comptime" keyword only forces you to provide an argument constant at compile time for that particular parameter. It doesn't trigger the compile time evaluation.
- WalterBright 11mo agoThat's how the constant is provided - through compile time evaluation.
- jhgb 11mo agoYes, but compile-time evaluation in Zig doesn't require the "comptime" keyword. Only specific cases such as compile-time type computation do (but these specific cases are not provided by compile-time function evaluation in D anyway, so language choice wouldn't make a difference here).
- rurban 11mo ago
- brabel 11mo agoThe code samples are so weird... Some are images, others are not, and there's like 10 different color schemes (even among the textual ones, it's not consistent). That actually takes some kind of effort to achieve :D.
- bdangubic 11mo agogives you a preview of the experience of using it :)
- pmkary 11mo agoWhen I read "I can easily say that Zig is not only a new programming language, but it’s a totally new way to write programs" I expected to see something as shocking as LISP/Smalltalk/Realtalk/EVE/FORTH/Prolog... A whole new paradigm, a whole new way to program. Or at least a new concept like the pure functionalism of Haskell, or Prototyping like in Lua/JS/Io. And I was so damn shocked how I must have missed something so huge, having read the entirety of Zig's documentation and not have noticed anything? As you mentioned, turned out nothing, and I was shocked then why is it in the top of HN? Also turned out for no reason based on the comments.
- skotobaza 11mo agoThe idea of modern society is "get hyped for the new thing". Tech crowd did not escape that unfortunately, and keeps rediscovering techniques that were already possible more that 50 years ago. Because they don't want to learn the history of the technology they are using.
- pjmlp 11mo ago"Computing is a fashion show" -- Alan Kay
- wolvesechoes 11mo agoDev celebs makes blogposts and videos on how Zig is awesome and unique, so the herd repeats.
- sparky4pro 11mo agoSame can be said about other programming languages. Therefore the comment of yours has zero value…
- wolvesechoes 11mo agoNah, there are many languages ignored or even despised by those dev celebs. > yours has zero value Yours didn't bring much as well, so I suppose value isn't strictly required.
- otabdeveloper4 11mo ago> C/C++ No such thing. Also C++ has most of those features too.
- pjmlp 11mo agoYeah, as I keep repeating, it is a Modula-2 in C clothes, minus comptime, which as others have mentioned D has had for quite some time.
- jb1991 11mo ago> 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.
- pjmlp 11mo agoNope, 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?
- 1718627440 11mo agoIn 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.
- pjmlp 11mo agoNah, 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 bounds checking enabled.
- 1718627440 11mo agoIn my opinion, this is an important issue and not "bikeshedding", but it can be discussed whether the term "C/C++" is always an example of that idea or not. I think it is not, but it is connected enough, that I won't use it to side step the issues.
- wseqyrku 11mo ago> Zig is not only a new programming language, but it’s a totally new way to write programs I'd say the same thing about Rust. I find it the best way to express when what code should run at any given point in the program and the design is freakin interstellar: It is basically a "query engine" where you write a query of some code against the entire available "code space" including root crate and its dependencies. Once you understand that programming becomes naming bits and then queries for the ones you wish to execute.
- JoeyJoJoJr 11mo agoAs someone not really familiar with Rust, this sounds intriguing, but I don’t full understand. Do you have any links that can or examples that could clarify this for someone who is just starting out with Rust?
- vacuity 11mo agoNot GP, but I genuinely don't understand what GP is talking about.
- 1718627440 11mo agoAnonymous structs and type interference are things even C has, although support for the later one is quite recent and limited.
- HarHarVeryFunny 11mo ago> I'm afraid this article kinda fails at at its job Yeah, I know nothing about Zig, and was excited by the author's opening statement that Zig is the most surprising language he has encountered in a 45 yr software career... But this is then immediately followed by saying that ability to compile C code, and to cross-compile, are the most incredible parts of it, which is when I immediately lost interest. Having a built-in C compiler is certainly novel, and perhaps convenient for inter-op, but if the value goes significantly beyond that then the author is failing to communicate that.