Live data from Hacker News

Why is Zig so cool?

nilostolte.github.io

301–310 of 527 posts

Re: Why is Zig so cool?

#301
post #274

Earlier quoted context omitted.

Zig has a lot of manpower behind it in comparison to Odin and this is one of the most important things for people, they see a proverbial crowd and that builds a lot more interest. With that said, here are a couple of things you have in Zig that you don't get in Odin: - Cross-compilation & cross-linking (more or less works): Odin doesn't do cross-linking. - Comptime; you can actually use it to effectively get Functors…

Thanks for the info. I'm curious to see what people will do when Jai will finally be released next year. So far, Rust has been gaining a lot of traction, although wit ha lot of controversies attached to it. Zig seems to be doing well but the lack of progress towards v1.0 after all those years is quite concerning, making it looks more and more like a toy project rather than something serious. Odin seems to be flying u…

If Jai is ever actually released to a meaningful amount of people I think we'll see just how little Blow's name means to people in practice. There is an artificial mystery around Jai right now and when the lid comes off the pot I think a lot of that is going to dissipate very fast.

With that said, I'll try it out. I'm not really impressed by what I've seen so far, though, it's very middle-of-the-pack with some really nonsense ideas. The possibility of easily creating your own checks with the compile-time machinery is potentially interesting but would probably turn into a nothingburger for us.

I think that's where most of this is at: After so many years of "waiting" (I think most people stopped actually waiting after a few years of mostly talking and very little actual productive doing) we'll end up with a very meh language that was touted as super special... And a painfully simple sokoban game that people are going to pretend is somehow super complex and hard to make.

Re: Why is Zig so cool?

#302
How on earth is it unique to compile code for different architectures? This is a solved problem since the 80s.

It basically looks like C with different syntax, im also not convinced the 0…9 implicit range is better for iteration - i prefer it explicitly for lower level languages.

Re: Why is Zig so cool?

#303

Zig is not cool. It's a mediocre new language, missing key features needed for industrial development, like destructors or overall memory safety. But for some reason it's overhyped.

If you think destructors/`Drop` traits or the like are good then Zig was never for you. It has nothing to do with "industrial development", neither does memory safety. The irony is that memory safety as a concept definitely is overhyped.

Destructors aren't just good. They are one of the most important innovations in programming, since they reduce boilerplate and prevent many bugs. Developing a language without them means introducing more bugs which could be avoided.

Re: Why is Zig so cool?

#304

Earlier quoted context omitted.

Sure sometimes... other times you get deadpan replies unironically demanding citations and proof of claims. There's nothing veiled or an insult: what I mentioned is a real factor in why people would read that statement and jump to demanding proof. - If I told a room full of plumbers that Sharkbites are actually sponsored by big Water trying to encourage water wastage, it definitely might not land... but none of them…

You might want to know about Poe's law: https://en.wikipedia.org/wiki/Poe%27s_law

I don't think Poe's law is applicable here on HN/anymore in general. Writing something stupid is not as valuable/funny as it was in 2005. The lack of /s or /j is only one half of the problem, the other half is that that comment is garbage. (I estimate these two are ~50-50% problematic in this case.)

I think a better rule of thumb is that one shouldn't use tone indicators at all. If you are needing them, then chances are that what you are going to post is not valuable/funny.

Re: Why is Zig so cool?

#305
This is a very confusing blog post. I found myself looking for ChatGPT markers because it doesn't make sense to say: omg zig is so much cooler than C here's why, then start listing the absolute basics of the language that are identical in most modern languages without any actual reflection why writing the same thing in a different syntax somehow makes zig superior?

Re: Why is Zig so cool?

#306
post #295

Earlier 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…

In 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.

Re: Why is Zig so cool?

#307

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 langua…

> 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.

Re: Why is Zig so cool?

#308
post #8

A 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

I wish we had that for Nim too!

try pixi!

Re: Why is Zig so cool?

#309
post #90

"This associated with the ability to cross-compile code to be run in another architecture, different than the machine where it is was originally compiled, is already something quite different and unique." Perhaps I'm missing something but this is utterly routine. It even has the name used here: Cross-compiling.

> this is utterly routine. It even has the name used here: Cross-compiling.

Zig makes cross-compilation trivial and part of the language philosophy.

Other languages either rely on external toolchains (C/C++, Rust with C deps) or are limited in target flexibility (Go).

For projects targeting multiple OS/architectures, Zig is currently the most straightforward option.

Re: Why is Zig so cool?

#310
post #196
post #190

Earlier quoted context omitted.

It seems pretty common to me?! Java is developed that way. So is Rust. And many others. What exactly do you see as different in Zig?

I don’t think Java and Rust were so ok with completely removing features. For example, in Zig 0.15 they completely overhauled the io, meaning all libraries now have to rewrite up usage. Just to make sure they did it right

> I don’t think Java and Rust were so ok with completely removing features.

This just shows that you weren't around for pre-1.0 Rust. Back then Rust was infamous for the language making breaking changes every week. Check out this issue from 2013 tracking support for features which were deprecated but had yet to be removed from the compiler: https://github.com/rust-lang/rust/issues/4707 , and that's just a single snapshot from one moment in Rust's prehistory.

Post reply on HN