News for hackers. Stuff that matters.
Re:Zig Is Self-Hosted Now, What's Next? by kristoff_it on Tuesday October 25, 2022 @01:44PM (#33333827)
We do have a good number of known miscompilations, I can substantiate for the parent poster with a simple link: https://github.com/ziglang/zig/labels/miscompilation

It's also true that the self-hosted compiler has caused new bugs to pop up, which in turn made us write new behavior tests. To me that's to be expected with every project aimed at rewriting an existing system.

It's also true that proper testing infrastructure is critical, and we do have it, although the requirement of more than 8gb of ram has not played in our favor in the past. We plan to revamp our CI systems once we are done with this release.

That said, it's a v0 language. If you choose to use it, you know you're coming with us on a ride. The choice of how much to prioritize correctness vs progress is influenced by many things that are going on in the project and there is no one clear strategy that trumps all others.

Quoting j-pb from another comment:

> A language that (does or doesn't) compile your code in 0.1 seconds to a broken binary is worse than piping your code into dev/null.

Eh, yes, but also no. Obviously a compiler needs to work correctly to be useful, but our priority right now is to move the project forward using our best judgment, not ensure that it has maximal utility to early adopters. I do agree with the sentiment that the compiler needs to be reliable, it's just that Zig is v0 for a reason.

In concrete terms I think that once we're done with an initial adjustment phase, you will find that the compiler will have a steady increase in stability over time. That's how it was with the bootstrap compiler before we started the self-hosted work.

Also, quoting dist1 from up the comment tree:

> I'm not so familiar with Zig, are you saying that the compiler fails to compile correct (i.e. according to spec) code?

Keeping in mind everything that I just wrote, note that Zig doesn't have a spec yet. Sometimes, some issues in the compiler are the result of discovering that a design choice needs to be amended.

Recent example of that: https://github.com/ziglang/zig/issues/12251

Re:Zig Is Self-Hosted Now, What's Next? by the_mitsuhiko on Tuesday October 25, 2022 @05:40PM (#33336528)
> Eh, yes, but also no. Obviously a compiler needs to work correctly to be useful, but our priority right now is to move the project forward using our best judgment, not ensure that it has maximal utility to early adopters.

I feel like I’m a potential early adopter and the amount of miscompilation I ran into playing around with it really made me lose interest. It seems like the priorities are set somewhere else entirely.

Re:Zig Is Self-Hosted Now, What's Next? by kristoff_it on Tuesday October 25, 2022 @06:21PM (#33336921)
Going by your own comment, you seem to not be an "early enough" adopter. That's totally fair, maybe Zig will be more interesting for you once it stabilizes more in the future.
Re:Zig Is Self-Hosted Now, What's Next? by the_mitsuhiko on Tuesday October 25, 2022 @06:32PM (#33337036)
I don’t believe this to be true.

Zig is 6 years old now going by Wikipedia. In comparison I use Rust in an more extensive way than Zig for almost 20 years now. I for sure wrote more Rust in 2012 when it was ~2 years? old than Zig last year, yet I don’t remember miscompilations on that level. The same is true for my recollection of using very early D which however at this point was in an earlier life of mine and very fuzzy.

Re:Zig Is Self-Hosted Now, What's Next? by kristoff_it on Tuesday October 25, 2022 @06:42PM (#33337159)
I'm not sure I understand your point. Zig is clearly too unstable for your liking, by your own admission.

If your point is that Rust was more stable (and why not, even an overall better project) at the same age, then I'm happy to immediately concede the point. But that doesn't really have any influence on the main question, does it?

Re:Zig Is Self-Hosted Now, What's Next? by the_mitsuhiko on Tuesday October 25, 2022 @07:03PM (#33337381)
The argument that you were making (unless I misunderstood you) is that there are more important issues for the language than correctness or appealing to early adopters to which I made the remark that this attitude is steering me away from the language.

Zig is in a weird spot because it has a similar momentum behind it than some other languages I was exited about, it has even more hype (and is very hype driven with streams and everything) yet it has from my experience with it much more stability issues. And I assume some of this comes from a relay complex compile time system that is harder to implement rigorously than some other things.

I also have to say that I find these responses unnecessarily combative.

Re:Zig Is Self-Hosted Now, What's Next? by kristoff_it on Tuesday October 25, 2022 @07:27PM (#33337615)
> The argument that you were making (unless I misunderstood you) is that there are more important issues for the language than correctness or appealing to early adopters to which I made the remark that this attitude is steering me away from the language.

Yes, and I still stand by my assertion. Next to you in the "early adopter spectrum" are people who can put up with more breakage on one side, and people who cannot put up with the current level on the other side. At any point in time the project will be somewhere along that spectrum and some people will be on one side of that line and others will be on the other.

Similarly, different things going on in the project will move the line in either direction. Switching to a new compiler implementation is unsurprisingly a source of bugs, if you want to use Zig now, you will have to accept the current state of things.

> it has even more hype (and is very hype driven with streams and everything)

Hype driven... you mean Andrew's 100 people streams? Or my 30 people streams? What hype-driving streams are you referring to. My YouTube channel with 4k subs (hit that milestone today btw)?

> I also have to say that I find these responses unnecessarily combative.

I really don't know what to tell you. If Zig is too broken for your liking, don't use it. If other projects at the same level of age/popularity/whatever had a level of breakage that you found tolerable, then great, and if Zig doesn't meet that standard, then it means, by definition, that it's too early for you to use it.

If you want to make a different point, then state it clearly, from the early adoption perspective, I don't see any argument to be discussed here.

Re:Zig Is Self-Hosted Now, What's Next? by username-404 on Thursday October 27, 2022 @09:15AM (#33357003)
> Hype driven... you mean Andrew's 100 viewer streams? Or my 30 viewer streams?

More like release notes with 1,000 upvotes on Reddit:

https://www.reddit.com/r/programming/comments/rl87pr/zig_pro...

Re:Zig Is Self-Hosted Now, What's Next? by pjmlp on Wednesday October 26, 2022 @01:11AM (#33340064)
2022 - 2010 ==> 12 years. :)
Re:Zig Is Self-Hosted Now, What's Next? by ksec on Wednesday October 26, 2022 @08:48AM (#33342846)
20 years? Something doesn't add up.
Re:Zig Is Self-Hosted Now, What's Next? by the_mitsuhiko on Wednesday October 26, 2022 @01:13PM (#33346616)
It’s a typo. Was supposed to say 10.