Live data from Hacker News

Assorted Thoughts on Zig and Rust

scattered-thoughts.net

301–307 of 307 posts

Re: Assorted Thoughts on Zig and Rust

#301
post #68

I think Zig's biggest advantage is that it's just C without the warts, or footguns as is said in the Zig world. The comptime feature is probably the most exciting thing I've seen in a while. I've looked at Rust and feel it's more of a competitor to C++, Java and C#. Whereas Zig is C done right.

Yes. I think Zig is a safer C, while Rust is a safer C++. C programmers will be more excited by Zig than by rust, and the opposite is true for C++ afficionados.

It's interesting people keep saying this. I see Rust as being much closer to C than it is to C++. Rust is safer C with the bare minimum of added advanced features.

Re: Assorted Thoughts on Zig and Rust

#302

Very interesting set of observations. As a C and C++ programmer, I am feeling more and more excited about Zig. One thing that feels missing from Zig though is encapsulation. I don't believe that you can declare struct fields private, such that they can only be accessed by methods. This seems really important to me, not only as a technical means of enforcing invariants, or hiding internal-only implementation details t…

Yes this is an area where Zig fundamentally doesn't solve the same problems that C had. Zig can't check that you're not dangerously wrecking an invariant while Rust can do that, or in the worst case simply cause a program exit with a panic rather than random memory corruptions like Zig would cause.

Re: Assorted Thoughts on Zig and Rust

#303
post #70

Earlier quoted context omitted.

My impression was completely the opposite. I was very excited about Rust at first, especially the ownership system, but after a while I saw that it was a cleaned-up C++ with most of C++'s problems (one of the most complex programming languages in software history; very slow feedback loop). Zig, on the other hand, seems revolutionary and a complete rethinking, from the ground-up, of what low-level programming should b…

Rust is trying to replace C++. If you were not in the market for C++ to begin with it's unlikely that Rust is going to excite you.

Rust is not "trying" to replace anything. Rust can and is used plenty for embedded programming where only C was ever used previously. People have commented they prefer writing simple command line applications in it more than they do python.

Re: Assorted Thoughts on Zig and Rust

#304
post #69

I think this an argument like the following is not really meaningful: > Most of this difference is not related to lifetimes. Rust has patterns, traits, dyn, modules, declarative macros, procedural macros, derive, associated types, annotations, cfg, cargo features, turbofish, autoderefencing, deref coercion etc Nobody forces beginners to write macros. Beginners are only macros _users_. With time and experience, the ne…

The author is obviously in the top ~1% or something of programmers: the article is thoughtful and shows a lot of technical depth and knowledge about things most programmers won't even have heard of and he clearly has a fair amount of practical experience. So telling him he's just somehow imagining all this complexity and cognitive load, because he doesn't have to use all this complexity feels a tad tone deaf, in a ve…

> The author is obviously in the top ~1% or something of programmers

Appeal to authority much?

Re: Assorted Thoughts on Zig and Rust

#305
post #295

I think Zig's biggest advantage is that it's just C without the warts, or footguns as is said in the Zig world. The comptime feature is probably the most exciting thing I've seen in a while. I've looked at Rust and feel it's more of a competitor to C++, Java and C#. Whereas Zig is C done right.

The whole comptime stuff is very un-C.

But a strict improvement on the preprocessor madness that you have to get into with C. Having `static if`-like behavior is much preferable to `#ifdef` and the like and other things falling out of that system is just a bonus.

It's tempting to view `comptime` as additional complexity, but the truth is that it replaces a much more complicated and hard-to-work-with system. That one is just one that people have gotten used to over decades.

Re: Assorted Thoughts on Zig and Rust

#306
post #154

Earlier quoted context omitted.

Looking at that unicode PR, It seems like the thought process is "we don't want to spend time fixing unicode security regressions until we have stabilized the rest of the language", the unicode library is totally broken rn, don't fix a minor part of the problem.

There is no excuse, in my opinion. The PR would have taken a step in a safer direction, even if the entirety of it is scrapped at a later date. It wouldn't have broken anything else in the codebase, and it was a completed, merge-able change. Again, the frustration wasn't just from the PR alone - it was also the Discord flame war that ensued prior to the PR.

While I'm not usually 100% happy with the Discord server (it currently has very little moderation and has had one user behave like a piece of shit for a long time) I've had a hard time finding the flame war you mention. I found the discussion about utf8 decoding and it seemed cordial, with two people agreeing with you and only one saying (paraphrasing...) "Fuck this, I'm leaving this community until people stop asking too much" (which didn't make much sense).

I usually find community overrated and I've made a conscious effort to separate it from technology for the most part. Zig as a language has certain values that it's built with in mind and those values for the most part are aligned with mine, so this is basically what keeps me interested in it. I would use Rust despite its community if it aligned with my values. I despise the leadership of Elixir and Phoenix but I still use both of those when it makes sense.

With all this said, the IRC channel is a lot less about memery and wild discussions (but also less active) than the Discord server, so if you feel like it you can always just pop into #zig on FreeNode if you have questions and would like to talk about the language.

Post reply on HN