Live data from Hacker News

Zig 0.8.0 Release Notes

ziglang.org

21–30 of 82 posts

Re: Zig 0.8.0 Release Notes

#21
This is an astounding amount of work for such a small project. Looks like the 0.7.0 release was about a year and a half ago.

I've been sponsoring for a couple months now. I love the passion here and want to support a smart, dedicated guy leading a project in the open. I'm curious just to see what happens and where the project goes. Watching Andy brainstorm, experiment, and triage in GitHub issues has been worth the $5/mo, in project management tips alone!

One of these days I'll have to actually give Zig a try...

Re: Zig 0.8.0 Release Notes

#22
post #10

The changes to the IR data structures in this release are really neat- whole trees and graphs fit in a small fixed number of flat arrays. This saves on allocations, saves on total memory usage, and makes them trivial to serialize because there are no pointers. I recently arrived at a similar design for manipulating NFAs as adjacency matrices, as a replacement for more pointer-y adjacency lists, by way of sparse matri…

> " his saves on allocations, saves on total memory usage " Co-Dfns is Aaron Hsu's project, and he has a talk[1] on a compiler implemented in a nano-pass style, once in Racket, once in Chez Scheme[2] and once in Dyalog APL, each using CPU and GPU. For compiling an AST with ~16 million nodes, he gives benchmark figures that Dyalog APL takes 64MB RAM to hold it, Racket takes 1051MB and Chez Scheme takes 1485MB. His pro…

Two issues here, we are at a memory wall, and if system X takes 64MB and system Y takes 1024MB, that is 4 doublings. So the 9x faster number holds. APL in this case is like being 4 Moore Units ahead of everyone else.

The other one is that, separating the thing from the representation of the links between things is not unlike a set of basis functions forming a high dimensional space. The indices into the store forming a point in that space.

Some say Petgraph is a hack, I think Petgraph is a mathematical sculpture.

Re: Zig 0.8.0 Release Notes

#23
post #16

The energy in this project is amazing! The idea of including a C++ and a C compiler gratis is brilliant, and solves a big interoperability headache very elegantly. For my own purposes, IIUIC it is fatally flawed, lacking destructors, but as a raw C replacement it has legs. Compile-time execution and types as regular compile-time values makes it actually powerful.

> lacking destructors seriously? write a `deinit(self: *Self)` function into your struct and explicitly call `defer obj.deinit()`. Explicit is better than implicit. And the penalty? One line of code per destroy site, plus writing the `allocator.destroy(self)` line in your deinit method. As a result of being explicit, SO many headaches are solved. What are the rules again when you have a C++ class that polymorphically…

I think GP means RAII, which is still an open area of discussion in Zig: https://github.com/ziglang/zig/issues/782

I'd love to see it if it can be implemented in a way that fits the language, but that remains to be seen.

Re: Zig 0.8.0 Release Notes

#24
post #19
post #5

I've been working with Zig almost 8h/day since Sept. of last year[0], and am super excited about the ideas it is bringing to low-level programming - even to C/C++/Rust. I hope folks outside of the Zig community give it a glance even if just for the ideas it brings around cross-compilation and being a nice out-of-the-box experience. Some of my favorite highlights from this release: > With the advent of the Self-Hosted…

I really, really wish Zig had RAII. I am so used to this in C++ and have grave difficulty living without it. But it has been shot down as RAII is considered a high-level feature. Well, I guess I will admire the language from a distance but I am unlikely to use it practically. https://github.com/ziglang/zig/issues/782

With regards to RAII (as in constructors/destructors, not the stuff in the issue you linked), I think it simply didn't fit within Zig's goals. A big part of Zig is readability; what you read is what you get, and RAII is very much not that. Looking at a block of C++ code, there's no way to tell what happens unless you also know what the constructors/destructors of each data type in the block does.

Re: Zig 0.8.0 Release Notes

#25

Congratulations to the Zig team. Zig's a very interesting project for language mavens. A question - what does the Zig ecosystem look like? Are there strong products and parsers, services, actor models, interfacing with Middleware written in Zig? Or is the theme - drop to C based interfaces to those products? What's the zen of Zig say? What are some notable wide use applications, solutions written in Zig?

It's still pretty early for a significant ecosystem to exist, but in general interfacing with C (or C++ `extern "C"` stuff) in either direction - calling C from Zig or Zig from C - is extremely simple. You can tell Zig functions / structs to use the C ABI with the `extern` keyword, and you can use C headers (structs, prototypes, enums, #define's, etc) via `@cImport` or `translate-c`

Re: Zig 0.8.0 Release Notes

#26
I’ve been using Zig for a new JavaScript build tool and I really like it. It’s great for writing performance-critical code.

It took me about two weeks to feel comfortable & productive in it.

Re: Zig 0.8.0 Release Notes

#28
As the military aphorism go "Amateurs talk strategy. Professionals talk logistics." I like that Zig seems to talk about compiler/linker logistics in great details as opposed to just endless list of new language features and APIs that so many languages do.

Re: Zig 0.8.0 Release Notes

#29
post #27

Does anyone know if Zig is bootstrappable in the "Bootstrappable Builds" sense? i.e. You can take the source code without any pre-generated binaries or code and build Zig solely using external tools. https://bootstrappable.org/ https://bootstrapping.miraheze.org/

Yes. There is a repo containing exactly that: https://github.com/ziglang/zig-bootstrap

Re: Zig 0.8.0 Release Notes

#30

This is an astounding amount of work for such a small project. Looks like the 0.7.0 release was about a year and a half ago. I've been sponsoring for a couple months now. I love the passion here and want to support a smart, dedicated guy leading a project in the open. I'm curious just to see what happens and where the project goes. Watching Andy brainstorm, experiment, and triage in GitHub issues has been worth the $…

0.7.0 was 7 months ago. Thanks for your support :)
Post reply on HN