Live data from Hacker News

Why Zig Is Quietly Doing What Rust Couldn't: Staying Simple

freedium-mirror.cfd

21–30 of 36 posts

Re: Why Zig Is Quietly Doing What Rust Couldn't: Staying Simple

#22

I stopped reading when he compared the Rust compiler to his angry ex. Like, what are we doing. This “article” is flame bait.

I read it through and there is nothing much there. Most of his points don't hold up to reality as rust is no longer (and hasn't been for a while) a "hyped language" and has proven time and time again to be a valuable language.

Re: Why Zig Is Quietly Doing What Rust Couldn't: Staying Simple

#24
>Zig, meanwhile, just shrugs and says, "You break it, you fix it."Exactly. That’s what Rust defends us from. It makes breaking things way harder. Rust forces you to think differently, you cannot just do what you want, but that’s it’s selling point. The article focuses mainly on feelings not facts and that’s ok, but I don’t feel exhausted writing Rust. I like that it’s safe and I’m happy to sacrifice some freedom if I get safety in return.

That’s a weird article. Rust wanted to be safe systems language and it is. Where’s the issue? Zig has different goals. That’s ok. What are actually discussing here?

Re: Why Zig Is Quietly Doing What Rust Couldn't: Staying Simple

#25

I know this post is AI generated to some extent but I'm still curious. The subtitle says: > Rust shouted about safety. Zig just built it — without the ceremony, the sermons, or the 15-minute compile times. Which I interpret as meaning that zig delivers memory safety in a simpler way than rust. But a few paragraphs in, it says: > Rust teaches you ownership like a tough-love therapist. Zig, meanwhile, just shrugs and s…

There is a simpler version for zig.

    pub fn main() !void {
        std.debug.print("Hello, World!\n", .{});
    }
The only difference is this writes to stderr and does not fail (and explicitly says it is meant for debug), while their example writes to stdout. In zig if you want to write to stdout you need to explicitly pick the std and handle all the details (like error handling).

He gave the possible worst example, this article is nonsense.

Re: Why Zig Is Quietly Doing What Rust Couldn't: Staying Simple

#26
post #13

Zig has no undefined behavior?

Zig has the concept of illegal behavior, of which a subset is unchecked illegal behavior - basically undefined behavior, but if evaluated at comptime, it results in a compile error. The documentation also states that most illegal behavior is safety-checked unless you use the ReleaseFast or ReleaseSmall optimization modes (and don't enable safety checks for individual blocks).

Re: Why Zig Is Quietly Doing What Rust Couldn't: Staying Simple

#27

I know this post is AI generated to some extent but I'm still curious. The subtitle says: > Rust shouted about safety. Zig just built it — without the ceremony, the sermons, or the 15-minute compile times. Which I interpret as meaning that zig delivers memory safety in a simpler way than rust. But a few paragraphs in, it says: > Rust teaches you ownership like a tough-love therapist. Zig, meanwhile, just shrugs and s…

Zig's memory safety has nothing in common with Rust. I'd even say, it mostly has barely more than C. It gets reliability from proper error handling.

It has a very weird feeling complaining about build.rs when any semi-serious Zig project comes with a build.zig that's always more complex than any build.rs.

Re: Why Zig Is Quietly Doing What Rust Couldn't: Staying Simple

#28

I know this post is AI generated to some extent but I'm still curious. The subtitle says: > Rust shouted about safety. Zig just built it — without the ceremony, the sermons, or the 15-minute compile times. Which I interpret as meaning that zig delivers memory safety in a simpler way than rust. But a few paragraphs in, it says: > Rust teaches you ownership like a tough-love therapist. Zig, meanwhile, just shrugs and s…

Logical contradictions in AI slop? Unthinkable!

But to address the serious question: We can't have all three of: a simple language, zero-cost abstractions, and memory safety.

Most interpreted language pick simplicity and memory safety, at a runtime cost. Rust picks zero-cost abstractions and memory safety, at an increasingly high language complexity cost. C and Zig choose zero-cost abstractions in a simple language, but as a consequence, there's no language-enforced memory safety.

(Also, having a simple language doesn't mean that any particular piece of code is short. Often, quite the opposite.)

Re: Why Zig Is Quietly Doing What Rust Couldn't: Staying Simple

#30
I like the article's theme. Coding in Rust does indeed suck brain-power and even after 2 years of off-and-on attempts, I am still faster (and less tired) in other languages (including C++). But the LLM generated text is just deeply pissing me off, sorry. Why use snarky LLM slop here ? Use straightforward, ordinary human-developer language for this.
Post reply on HN