Live data from Hacker News

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

kristoff.it

131–140 of 159 posts

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

#131
post #38

I wonder if Zig is getting too much hype at the moment considering its immaturity (and so many easy to hit bugs as noted by other commenters). Is it getting hype before it's ready? Will it be able to recover from that?

Disclaimer: Not a Zig fan. I think Zig is getting too much hype. It's unfortunate because Zig could have potential, but hyping something before it's ready is a recipe for alienating early adopters and killing progress towards popularity. The worst part of it is that I've heard people say that they've got Zig in production; with all of the bugs in the compiler, they are apt to get burned, and too many burns will lead…

A number of those using zig in production have played with zig for a considerable amount of time (I started playing with 0.5.0 where large breaking changes came shortly after) thus know what to expect. Afaik most of those are within embedded, using it as a toolchain (zig cc not zig), or have similar constraints.

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

#132
post #77

Earlier quoted context omitted.

The bug that's currently blocking me from any work using master is https://github.com/ziglang/zig/issues/12325 That's not really a bug related to unfinished features that might get replaced anyways, but simply one involving recursive structs with pointers between, i.e. linked lists. Not detecting issues like these feels less like a "these parts are unfinished hence here be dragons" thing and more like a fundamental c…

You're using the master branch of a pre-1.0 tool, and you expect it to be stable without regressions? I feel like your expectations are too high.

he just want to force zig devs to tackle his problems first.

Using phrases like "fundamental culture problem" or "at least some stability"

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

#133

I've been learning Zig by porting my toy SQL database in Go to Zig (both projects are on Github, you can go find them if you'd like). This is my first time trying to seriously use a non-GC language for a project, so there's a big learning curve unrelated to Zig in particular. However, it's much easier than trying to learn C (which I've tried a few times). The standard library is incredibly feature rich compared to C…

> I haven't noticed miscompilation yet I found it shockingly easy to get a miscompilation that it really soured my interest in it. It’s good to hear that in practice that appears to be less of a concern.

Anecdotally again, but I've been coding in Zig since 2020 and have hit I think 2-3 compiler bugs in all that time?

The first was fixed within 24 hours, in fact just before I reported it. The others had clear TODO error messages in the panic, and there were easy enough workarounds.

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

#134
post #73

Earlier quoted context omitted.

when i have an idea for a program i want to build, i struggle to express it in terms of structs, pointers, and C/zig’s language features. but with C, i can often find similar programs and find good examples of how to do what i want. for example right now i’m working on an SDL/opengl app with an immediate mode gui, and there’s enough code in the wild for me to pour over to understand how and why they structure their p…

On knowing how to structure low level code, I highly recommend reading Casey Muratori's blog post on Semantic Compression: https://caseymuratori.com/blog_0015 And, more generally, watching some of his (free) handmade hero video series: https://handmadehero.org/

Wow, that was incredibly helpful. I could read writeups of straightforward code all day. I also love how his ethos extends to the design of the website as well. Thanks so much for sharing.

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

#135
post #106

I always enjoy reading about Zig advancements. I haven't developed anything substantial in Zig yet, but I'm very optimistic about the future of the language. If you're curious to see a large Zig codebase, two significant projects are Bun [1] and TigerBeetle [2]. [1] https://github.com/oven-sh/bun [2] https://github.com/tigerbeetledb/tigerbeetle

Joran from TigerBeetle here!

Awesome to hear that you're excited about Zig.

Thanks for sharing the link to our repo also—would love to take you on a 1-on-1 tour of the codebase sometime if you'd be up for that!

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

#136
post #132

Earlier quoted context omitted.

You're using the master branch of a pre-1.0 tool, and you expect it to be stable without regressions? I feel like your expectations are too high.

he just want to force zig devs to tackle his problems first. Using phrases like "fundamental culture problem" or "at least some stability"

Frankly I don't care if the problem gets fixed or not. I've already started a rewrite in Rust, and I don't plan on revisiting the Zig version until Zig has hit 1.0.

Coming from a Clojure background I generally agree with Hoare's "One is to make the program so simple, there are obviously no errors. The other is to make it so complicated, there are no obvious errors.", and in that sense Zig should easily be more correct than Rust which is much much much more complex.

The fact that that hasn't happened, with Rust being much more production ready for most of it's life, despite some major backwards compatibility breaking changes, leaves two possible answers for me:

1. The Rust developers are magically better programmers, which I believe to be false.

2. The rust community has a general culture for correctness and QA which the Zig community lacks.

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

#137

Earlier quoted context omitted.

Consulting Wikipedia's "first appeared" field for each: D: 8 December 2001; 20 years ago Go: November 10, 2009; 12 years ago Rust: July 7, 2010; 12 years ago TypeScript: 1 October 2012; 10 years ago Zig: 8 February 2016; 6 years ago The only one of these which isn't at least twice as old as Zig is TypeScript, which has the might of Microsoft behind it, and is based on a well understood, pre-existing language. This is…

The more reasonable interpretation (backed up by his other posts on this article and his use of "was") is that he is comparing Zig as it stands today to D, Go, Rust, and TypeScript when they were similarly new.

Fair point.

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

#138
post #136
post #132

Earlier quoted context omitted.

he just want to force zig devs to tackle his problems first. Using phrases like "fundamental culture problem" or "at least some stability"

Frankly I don't care if the problem gets fixed or not. I've already started a rewrite in Rust, and I don't plan on revisiting the Zig version until Zig has hit 1.0. Coming from a Clojure background I generally agree with Hoare's "One is to make the program so simple, there are obviously no errors. The other is to make it so complicated, there are no obvious errors.", and in that sense Zig should easily be more correc…

I'd be interested in some constructive feedback on your Zig experience. There's nothing I can do with the claim that Zig users have a culture problem, especially since the "the zig community" does not work on the compiler - it's just me and a handful of other people - and I'm not really able to evaluate the claim about Rust being in a more "production ready" state at a comparable point in its life. To be honest, these two points feel like nothing more than personal insults.

So, putting those aside, if you have any actionable experiences to share, such as other problems you ran into, what went well, what went poorly, what workarounds you tried, other experiences you had that could help inform the direction of the project, then these things would help make Zig shine when you revisit 1.0.

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

#139
post #129

I've been learning Zig by porting my toy SQL database in Go to Zig (both projects are on Github, you can go find them if you'd like). This is my first time trying to seriously use a non-GC language for a project, so there's a big learning curve unrelated to Zig in particular. However, it's much easier than trying to learn C (which I've tried a few times). The standard library is incredibly feature rich compared to C…

Being a better C is not hard to achieve as goal, JOVIAL, NEWP and PL/I did it one decade before C was born, and Modula-2 did it while C was mostly a Bell Labs toy, back in 1978. The problem is getting the wider market to pick better C languages.

I agree! I think the Zig community is doing a better job marketing than most better-c languages (which saddens me in some respects because I like D too, but sometimes you go with what meets most criteria and seems like it will succeed with adoption!).

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

#140
post #136
post #132

Earlier quoted context omitted.

he just want to force zig devs to tackle his problems first. Using phrases like "fundamental culture problem" or "at least some stability"

Frankly I don't care if the problem gets fixed or not. I've already started a rewrite in Rust, and I don't plan on revisiting the Zig version until Zig has hit 1.0. Coming from a Clojure background I generally agree with Hoare's "One is to make the program so simple, there are obviously no errors. The other is to make it so complicated, there are no obvious errors.", and in that sense Zig should easily be more correc…

Am I missing something here?

You are comparing a language which hit 1.0 and had seven years of additional refinement, to a language which is still at least 2-3 years away from 1.0 and spent most if not all its time in the past 12 months on self hosting compiler?

Post reply on HN