Live data from Hacker News

Zig Is Self-Hosted Now, What's Next?

kristoff.it

11–20 of 159 posts

Re: Zig Is Self-Hosted Now, What's Next?

#11
post #3

Correctness please. Zig is a way too simple language to justify all the really easy to hit bugs. I'd give everything for a zig compiler that's 10 times as slow but actually compiles my code. Also testing infrastructure. Zig really needs fuzzing and property testing tooling build-in. Hitting stage 2 with arbitrary autogenerated zig code and IR, would have really helped detect regressions for example.

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

Re: Zig Is Self-Hosted Now, What's Next?

#12
post #11
post #3

Correctness please. Zig is a way too simple language to justify all the really easy to hit bugs. I'd give everything for a zig compiler that's 10 times as slow but actually compiles my code. Also testing infrastructure. Zig really needs fuzzing and property testing tooling build-in. Hitting stage 2 with arbitrary autogenerated zig code and IR, would have really helped detect regressions for example.

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

Yeah, theres a surprising amount of stuff that's buggy, think `if` or `recursive structs with pointers` level stuff.

Re: Zig Is Self-Hosted Now, What's Next?

#13
post #3

Correctness please. Zig is a way too simple language to justify all the really easy to hit bugs. I'd give everything for a zig compiler that's 10 times as slow but actually compiles my code. Also testing infrastructure. Zig really needs fuzzing and property testing tooling build-in. Hitting stage 2 with arbitrary autogenerated zig code and IR, would have really helped detect regressions for example.

Looks like your complaint was a known tradeoff.

> The self-hosted compiler brings many advantages, but it did cost us a significant amount of effort and time. While Zig is still going up in popularity and starting to make a tiny dent in the industry, people that have been following along for long enough will know that this work has reduced our momentum in the last two years.

> Bug fixes in the compiler have been often put on hold since fixing the bootstrap compiler was ultimately useless, and accepted feature proposals have been piling up because it would have required implementing everything twice.

Re: Zig Is Self-Hosted Now, What's Next?

#14
post #11
post #3

Correctness please. Zig is a way too simple language to justify all the really easy to hit bugs. I'd give everything for a zig compiler that's 10 times as slow but actually compiles my code. Also testing infrastructure. Zig really needs fuzzing and property testing tooling build-in. Hitting stage 2 with arbitrary autogenerated zig code and IR, would have really helped detect regressions for example.

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

We're using the C++ compiler rather than the self-hosted compiler because the self-hosted compiler does not yet support async. Yes, it sometimes fails to compile correct code (by crashing) or compiles correct code to incorrect code.

Re: Zig Is Self-Hosted Now, What's Next?

#15
post #3

Correctness please. Zig is a way too simple language to justify all the really easy to hit bugs. I'd give everything for a zig compiler that's 10 times as slow but actually compiles my code. Also testing infrastructure. Zig really needs fuzzing and property testing tooling build-in. Hitting stage 2 with arbitrary autogenerated zig code and IR, would have really helped detect regressions for example.

Looks like your complaint was a known tradeoff. > The self-hosted compiler brings many advantages, but it did cost us a significant amount of effort and time. While Zig is still going up in popularity and starting to make a tiny dent in the industry, people that have been following along for long enough will know that this work has reduced our momentum in the last two years. > Bug fixes in the compiler have been ofte…

Your quoted sentence talks about bugs in the old C++ compiler, I'm talking about bugs in both compilers.

Pretty much all of the talks and blog posts on the `in-Zig` compiler are about better performance, lower memory footprint, e.t.c.

I would much rather have heard a talk about how they improved correctness through automatic testing, formal methods, simple language design e.t.c.

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.

Re: Zig Is Self-Hosted Now, What's Next?

#17
post #2

Nice achievement. Curious about this though: > building the compiler itself used to require 9.6GB of RAM, while now it takes 2.8GB. Why is the RAM usage so high? It was only a few years back and we were building C++ compilers on machines with barely 16MB.

I'd guess at least part of it has to do with increased core counts. Each instance of the compiler might use a few hundred MB, which by itself is probably fine, but multiply that times 8, 16, or 32 and it adds up. And if you're building even a medium-sized c++ codebase you're really going to want to use all available cores.

Re: Zig Is Self-Hosted Now, What's Next?

#19
post #8
post #2

Nice achievement. Curious about this though: > building the compiler itself used to require 9.6GB of RAM, while now it takes 2.8GB. Why is the RAM usage so high? It was only a few years back and we were building C++ compilers on machines with barely 16MB.

> It was only a few years back and we were building C++ compilers on machines with barely 16MB. "A few years" seems like a serious understatement, but beyond that... compilers in the time period you're talking about weren't really doing optimizations, they were just shoveling assembly out the door. Doing very little work takes very few resources, but the resulting binaries were way slower than they could have been. A…

Just wait until you get old... a "few" years ago, starts becoming a larger number...

Re: Zig Is Self-Hosted Now, What's Next?

#20
post #3

Correctness please. Zig is a way too simple language to justify all the really easy to hit bugs. I'd give everything for a zig compiler that's 10 times as slow but actually compiles my code. Also testing infrastructure. Zig really needs fuzzing and property testing tooling build-in. Hitting stage 2 with arbitrary autogenerated zig code and IR, would have really helped detect regressions for example.

Looks like your complaint was a known tradeoff. > The self-hosted compiler brings many advantages, but it did cost us a significant amount of effort and time. While Zig is still going up in popularity and starting to make a tiny dent in the industry, people that have been following along for long enough will know that this work has reduced our momentum in the last two years. > Bug fixes in the compiler have been ofte…

[deleted]
Post reply on HN