News for hackers. Stuff that matters.
Re:Zig, the Small Language by sph on Wednesday September 07, 2022 @02:20PM (#32754199)
You and me both, in fact I made my voice heard in the Github issue.

What's damning is how much Stockholm Syndrome there is around this feature, with people saying it's no big deal and it helps catch bugs. It's more annoying than helpful, and it catches a very small amount of corner cases, while completely killing productivity.

And you know what's the reasoning behind this? "Zig doesn't have warnings." As if it's a massive undertaking to add warnings to a compiler. What a sorry excuse.

I have ranted about this before, so I already feel my blood pressure going up.

Re:Zig, the Small Language by kristoff_it on Wednesday September 07, 2022 @02:39PM (#32754530)
> And you know what's the reasoning behind this? "Zig doesn't have warnings." As if it's a massive undertaking to add warnings to a compiler. What a sorry excuse.

Setting aside the unused variables issue for a moment, you might want to take a moment to ponder the fact that not having warning messages is an explicit design choice, not a missing feature.

Re:Zig, the Small Language by lopatin on Wednesday September 07, 2022 @03:05PM (#32754986)
A dogmatic one, by the sounds of it.
Re:Zig, the Small Language by kristoff_it on Wednesday September 07, 2022 @03:26PM (#32755399)
Well if one never stops to think about its potential merits, it can surely only be perceived as dogmatic. One thing is evaluating a choice in its full context and not liking it, another is demanding to have your vision be understood and accepted without being willing to grant the same courtesy first.
Re:Zig, the Small Language by lopatin on Wednesday September 07, 2022 @07:01PM (#32758341)
> you might want to take a moment to ponder the fact

> Well if one never stops to think about its potential merits

Listing some of those merits may be more productive than insisting people aren't thinking about it hard enough

Re:Zig, the Small Language by naasking on Friday September 09, 2022 @08:07AM (#32778130)
I don't program in Zig, but I can think of a few reasons in principle:

1. WYSIWIG compiler: how many people have been complaining lately about C compilers eliminating code on them due to undefined behaviour? If you eliminate certain optimizations so your complier doesn't do this, like dead code/variable elimination, then what the code looks like is exactly what executes. This means some important optimizations may have to be done by hand. Eliminating dead variables could be one of them.

2. Arguably dead variables are a mistake. Either they're a (major) mistake because you neglected to include a value in your computation, or a (minor) mistake because you declared a superfluous variable that's never used.

3. If you want your code to be clear and as self-documenting as possible, unused variables are an impediment. I can't speak to the accuracy of Zig's analysis, but I can see how it would be annoying while working out an algorithm.

Re:Zig, the Small Language by bmacho on Thursday September 08, 2022 @03:14PM (#32770579)
> another is demanding to have your vision be understood and accepted without being willing to grant the same courtesy first.

Is it available somewhere? I can't think anything why that compiler patch[0] can't be upstream (of course not default, but under a flag/different build mode/config option).

[0]: https://github.com/ziglang/zig/issues/335#issuecomment-10138...

Re:Zig, the Small Language by avgcorrection on Wednesday September 07, 2022 @03:10PM (#32755083)
Maybe this becomes the equivalent of `go fmt` in 10 years. “How I learned to stop worrying and love errors-only”
Re:Zig, the Small Language by edflsafoiewq on Wednesday September 07, 2022 @03:17PM (#32755237)
We've had -Werror forever, the consensus is it's a bad idea. In addition to everything else, you can't ever change the warnings, including fixing bugs in them, without potentially breaking code.
Re:Zig, the Small Language by von_lohengramm on Wednesday September 07, 2022 @04:51PM (#32756656)
> We've had -Werror forever, the consensus is it's a bad idea.

Says who? Package repo maintainers? -Werror is actually quite divisive.

Re:Zig, the Small Language by plorkyeran on Wednesday September 07, 2022 @11:17PM (#32760751)
Anyone who wants to be able to compile a program with a different or newer compiler than the author last tested it on.
Re:Zig, the Small Language by ok_dad on Wednesday September 07, 2022 @02:35PM (#32754455)
So don't use Zig? I don't get why you're so angry about something someone else likes. Just don't use it or look at it! So easy...
Re:Zig, the Small Language by chongli on Wednesday September 07, 2022 @03:38PM (#32755615)
So don't use Zig?

I see this comment a lot in response to feedback: "Don't like it? Don't use it!" Every single time, it reads to me as "stop complaining!" For as many times as I've seen the comment, I haven't been able to read it any other way.

Am I being uncharitable or is it really just a clear-cut attempt to silence debate?

Re:Zig, the Small Language by geodel on Wednesday September 07, 2022 @03:52PM (#32755806)
Well it would depend on context. For a FOSS software in domain where there are tons of other options, it is much easier to use what one likes and ignore what one doesn't. So calling it silencing the debate sounds too strong when software in question is not some controlling the world type.

On the other hand in case cloud services like those provided Google/FB/Twitter/Cloudflare etc it is much more difficult to just go with "Don't use if you don't like" because not only there are not much alternative but also because sometimes Cloud service providers act in unison. So if one is pushed out from a service they are likely to be pushed from all other services too.

Re:Zig, the Small Language by chongli on Wednesday September 07, 2022 @04:15PM (#32756144)
"Don't like it? Just fork it!" is a variant I see a lot in the FOSS world. It's equally pernicious in my view. Either you end up maintaining your own fork that nobody uses (and who wants to do that) or the fork is successful and half the community starts hating you for causing more fragmentation. Perhaps the most recent example of this I can think of is neovim, though in the language world python 2 vs 3 is so infamous that people have started hating the entire community from the outside.

All of this says to me that Zig is taking the wrong approach. Making highly controversial, opinionated features the standard with no way to opt out just leads to these endless debates. Languages (or any tools, for that matter) that stay out of the debate and just give everyone a flag tend to have much more welcoming communities.

Re:Zig, the Small Language by Tozen on Thursday September 08, 2022 @10:29AM (#32766082)
I agree with a lot of this, in terms of the polarization and tribalism, which is often the result. Unfortunately, there is little that can be usually done, except use other programming languages (which are more agreeable) or fork/make your own.
Re:Zig, the Small Language by chongli on Thursday September 08, 2022 @12:01PM (#32767518)
Yeah, it's just really frustrating when a language like Zig comes along. It does so many things right and seems to have a really good philosophy. But then it includes some highly opinionated "features" that make it a non-starter for so many people who could otherwise benefit from it.
Re:Zig, the Small Language by ok_dad on Wednesday September 07, 2022 @03:56PM (#32755855)
Yea, I was under the assumption there are literally thousands of programming languages and you can fork most of them when I replied.

I’m not usually a “just don’t use it” kind of guy, but in this case it’s valid, imo.

Re:Zig, the Small Language by RussianCow on Wednesday September 07, 2022 @02:40PM (#32754544)
If I didn't use any programming language that I hated any part of, I wouldn't be able to write code.
Re:Zig, the Small Language by md224 on Wednesday September 07, 2022 @03:05PM (#32754976)
What if the person you're replying to really, really likes Zig except for this one aspect of it?
Re:Zig, the Small Language by ok_dad on Wednesday September 07, 2022 @03:37PM (#32755596)
Then they shouldn't get so mad at something that's merely annoying; it's bad for the heart and circulatory system.
Re:Zig, the Small Language by geodel on Wednesday September 07, 2022 @10:32PM (#32760387)
Yeah, exactly right! I mean we all adjust people, places, things all the time. There is nothing special about programing languages that it has to be perfect fit for each feature one desires.
Re:Zig, the Small Language by runald on Wednesday September 07, 2022 @10:42PM (#32760460)
Is that why you ignored all the other responses to your comment?
Re:Zig, the Small Language by LAC-Tech on Wednesday September 07, 2022 @11:29PM (#32760824)
Because only get upset about this because they love zig