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.
If bugs are your concern, then this upcoming release is good news for you. Total number of open bug reports is 1,124. However if we remove bugs labeled "stage1" - that is - bugs that are no longer applicable because this release changes the default compiler to the self-hosted one - then the number drops to 514. It would be a fair characterization to say that this release cuts the number of known bugs in half. We have…
Zig Is Self-Hosted Now, What's Next?
51–60 of 159 posts
Re: Zig Is Self-Hosted Now, What's Next?
#52Add vector math types/functions/operators, those should be standard, in my view.
Re: Zig Is Self-Hosted Now, What's Next?
#53Write a "Zig in Y minutes", to me a language doesn't exist if it's not there. Add vector math types/functions/operators, those should be standard, in my view.
https://gist.github.com/ityonemo/769532c2017ed9143f3571e5ac1...
Re: Zig Is Self-Hosted Now, What's Next?
#54Write a "Zig in Y minutes", to me a language doesn't exist if it's not there. Add vector math types/functions/operators, those should be standard, in my view.
Re: Zig Is Self-Hosted Now, What's Next?
#55Earlier quoted context omitted.
Ugh that "Zig has function coloring" post again. The misunderstanding that post makes is that function coloring refers to at compile time . In other words, in Zig you don't need to write two versions of a function to use it in async vs sync context. Obviously the functions will have different runtime representations, so if you do something that cares about runtime calling conventions or w/e then yes you do need to wo…
The person you are replying to (me) is the author of that post. > The misunderstanding that post makes is that function coloring refers to at compile time. The original function colors post referred to runtime, so you're wrong. > In other words, in Zig you don't need to write two versions of a function to use it in async vs sync context. This is correct, if you only care about compile time. > Obviously the functions…
Not to impugn your character, but I feel the same way about the points you're making.
> So you admit that Zig does have function colors?
Not in any meaningful way, no. Again, the runtime representation of async vs sync functions is unavoidably different, and has nothing to do with the language. The fact that Zig lets you write one function definition that can be called in sync vs async contexts (unless you're specifically choosing to do sync vs async things) is what it means to be colorless!
> Also, according to the actual Zig documentation, which I quote in my post, there is only one version of every function; if a function is used in an async context, even if it is sync otherwise, the compiler makes the function async and continues on its merry way, so there is only one runtime representation of a function.
I dunno if that's accurate? Someone with more knowledge of Zig internals would have to confirm, but I assume if the same codebase uses a function in each context it'll be monomorphized into the specific version needed, same as generics. I don't think that's contradicted by what you quoted.
Re: Zig Is Self-Hosted Now, What's Next?
#56I'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…
Re: Zig Is Self-Hosted Now, What's Next?
#57Quoted post unavailable.
Re: Zig Is Self-Hosted Now, What's Next?
#58I have a lot of admiration for Zig, as I think it takes a very interesting approach to being a "better C", and the no-nonsense approach, ruthless simplicity, and thin abstraction over the hardware fall very much in line with my values as a programmer.
As a product manager, a few thoughts ran through my head when when I was watching this: with where Zig is as a language, is this kind of focus on extreme memory optimization actually the best use of his time?
There's an argument that it might be: maybe this is an exercise in dogfooding Zig as the kind of language which is suitable for data oriented design. Or it could be Kelly has fallen victim to the temptation many of us do, in following the most fascinating path rather than the one that's creating the most long lasting value.
Either way I guess that's a luxury he has the right to indulge as an independently funded auteur PL designer.
Re: Zig Is Self-Hosted Now, What's Next?
#59Earlier quoted context omitted.
Here's a pretty substantial bug from just a week ago: https://github.com/ziglang/zig/issues/13211
"stage1 is expected to be broken in many ways and does not handle non-x86_64 C ABI at all." so its self-hosted for x86_64 only so far, which is fine if communicated
Re: Zig Is Self-Hosted Now, What's Next?
#60I'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 started trying to learn Zig as my first non-GC language but switched over to C because I had trouble finding learning resources for Zig, while there are plenty of books and C code written to ISO standards to learn from. It felt like a language for people already proficient in C/C++ and systems programming.. but props to you for proving that wrong!