Live data from Hacker News

Zig 0.11

ziglang.org

11–20 of 193 posts

Re: Zig 0.11

#12
post #4

> Backed by the Zig Software Foundation, the project is financially sustainable. These core team members are paid for their time: (lists five people) That's quite impressive. For comparison, Python had 2 full time paid devs in 2019 (not sure about now).

[deleted]

Re: Zig 0.11

#13
post #5

What are the use cases for zig? The website says general purpose and tool chain but people who have used it, what it excels at?

My understanding is that Zig has all of the power and modernity of Rust, without the strictness and borrow checker. Unlike Rust, it also has powerful compile-time evaluation and custom allocators, and probably more improvements I'm not familiar with (in Rust you can effectively emulate custom allocators, but you have to rewrite every allocating structure to use them; or you can use nightly, but most third-party library and even some standard-library types don't support them).

I also heard someone say "Zig is to C what Rust is to C++". Which I interpret as, it's another maximum-performance modern language, but smaller than Rust; "smaller" meaning that it has less safety and also abstraction (no encapsulation [1]), but less requirements and complexity.

Particularly with games, many devs want to build a working prototype really fast and then iterate fast. They don't want to deal with the borrow checker especially if their code has a lot of complex lifetime rules (and the borrow checker is a real issue; it caused evanw to switch esbuild to Go [1]). In small scripts with niche uses, safety and architecture are a waste of effort, the script just has to be done and work (and the latter is only partly necessary, because the script may not even be fed enough inputs to cover edge cases). Plus, there are plenty of projects where custom allocation is especially important, and having every type support custom allocation is a big help vs. having to rewrite every type yourself or use `no_std` variants.

[1] https://github.com/ziglang/zig/issues/2974

[2] https://github.com/evanw/esbuild/issues/189#issuecomment-647...

Re: Zig 0.11

#14
post #7

Anybody here who is using zig on daily basis?

I am building an on-premise annotation platform for medical image data (MVA.ai) where it is used for both backend and frontend (WASM). Really enjoy the language, with the key aspects being the low level control and performance, the build system and cross-compilation, comptime for generics, the easy integration of existing C libraries and the support for WASM. Manual memory management is sometimes a bit tedious, but you get used to it quite quickly. On the other hand, being able to use different allocators can even give you something like 'lifetimes'.

Re: Zig 0.11

#17
post #5

What are the use cases for zig? The website says general purpose and tool chain but people who have used it, what it excels at?

As someone who used C as main language, I've switched to zig. It's the only language that tries to be "better C", and not another C++. Comptime being like Nim where it's not entirely own language is also plus. I'd say it excels at general purpose system programming, and especially if you need to work with memory in detailed way (rust makes this very annoying and hard).

Re: Zig 0.11

#18
post #7

Anybody here who is using zig on daily basis?

I don't know about "daily" right now (I've had to take a break due to obligations), but I'm working on a modern implementation of the Self programming language with actor capabilities: https://github.com/sin-ack/zigself

It's nowhere near usable yet, but Zig has been a joy to work with for over a year, and I can definitely see myself using it for a big piece of software.

Re: Zig 0.11

#19
post #5

What are the use cases for zig? The website says general purpose and tool chain but people who have used it, what it excels at?

My understanding is that Zig has all of the power and modernity of Rust, without the strictness and borrow checker. Unlike Rust, it also has powerful compile-time evaluation and custom allocators, and probably more improvements I'm not familiar with (in Rust you can effectively emulate custom allocators, but you have to rewrite every allocating structure to use them; or you can use nightly, but most third-party libra…

Also none of the common knowledge around traditional data-structures and algorithms work with Rust anyways. One needs to dance like a ballerina with their hands and feet tied.

Re: Zig 0.11

#20
post #10
post #5

What are the use cases for zig? The website says general purpose and tool chain but people who have used it, what it excels at?

Being Modula-2 like (in safety), with a syntax that is more appealing to C minded folks, with nice compile time execution support.

I think this is one of the best short description of Zig.
Post reply on HN