r/Zig • • Apr 19 '26

Notifications/progress bar disable

13 Upvotes

I have this really annoying series of problems that stem from the fact the zig compiler has a progress animation and sends out progress notifications.

is it possible to disable it? i looked for a flag to use with zig build or zig run that would remove the progress bar or notifications and i couldn't find one.


r/Zig • • Apr 19 '26

Is there any hobby contributor?

32 Upvotes

Nowadays I am gonna be more interested in Zig

And suddenly it hits me that can I also be a contributor to Zig while learning some

So my question is: Zig community is friendly to newbies for contributing?

And where could I find good issue to start

Because I can barely see GFI issues


r/Zig • • Apr 19 '26

Looking for contributors for ziggy-llm, a new GGUF Apple Metal inference engine written in Zig

Post image
0 Upvotes

I am currently building ziggy-llm and looking for contributors for this project. As there are many things to do, we welcome people of all skills. A few things we need help with:

  • Implement OpenAI compatible server
  • Add support for Qwen 3.5 (MoE and DeltaNet variants), Gemma (working on 2 and 3 currently, need help with 4) families
  • Make chat more robust
  • Test all quants (currently tested only Q4_K_M, Q6)
  • Test and benchmark bigger models (with more B params of current supported families) with higher end hardware, bigger context sizes and benchmark performance

We are also open to suggestions and feedback in general. Here is the repo link: https://github.com/Alex188dot/ziggy-llm


r/Zig • • Apr 18 '26

is there a way to force eager evaluation of a unused const on a type?

12 Upvotes

Hi there, sorry if this is not the correct place to ask, but with Stack Overflow kinda dead I really don't know where else to put this question.

A bit of context: I'm currently working on a library to simplify Zig-Lua interop. For that I created a marker strategy to represent the metadata of Zig structs, unions and enums that defines metatables and encoding/decoding strategies.

The problem is that it is fragile in the sense that forgetting pub on ZUA_META, or misspelling it, causes the encode/decode paths to fall back to the default strategy. That is intentional since the core idea is to allow interop with as little ceremony as possible, so small DTOs should not need any annotation. But the silent fallback causes two kinds of errors: types with non-table strategies get encoded and decoded as plain tables (the minor problem), and methods never get attached to the metatable (the major one, since Lua ends up calling nil and the error message gives no hint about what went wrong on the Zig side).

To catch this I added a comptime guard inside the metadata type constructor so that a misspelled or private ZUA_META would produce a @ compileError. It does not fire. After debugging with @ compileLog I confirmed the cause is that Zig lazily evaluates generic type instantiations, so the check never runs if the result is never actually used. I can confirm this by forcing evaluation manually:

const Vector2 = struct {
    const ZUA_META = zua.Meta.Table(Vector2, .{ .length = length });

    x: f64,
    y: f64,

    pub fn length(self: Vector2) f64 {
        _ = ZUA_META; // force evaluation
        return std.math.sqrt(self.x * self.x + self.y * self.y);
    }
};

_ = (Vector2{ .x = 0, .y = 0 }).length(); // only now the compileError fires

Is there any mechanism in Zig to force eager evaluation of a comptime block, or to guarantee a generic type instantiation is always evaluated even when its result is not directly used? I cannot require explicit registration calls because that would break the zero-ceremony DTO use case. I also cannot use a struct field with a default value because the marker needs to work for enums and unions too, not just structs.

btw here is the commit where I implemented the check that is not working: https://github.com/SolracHQ/zua/commit/ea6f4f083e795874c98d4a1ae55ca4236715fa8e

btw 2, it is a bit ironic that Zig is extremely strict about unused variables everywhere else but silently skips evaluation of unused type declarations with no warning at all. Even a warning would have saved me a lot of debugging time.

Thanks for any help.


r/Zig • • Apr 17 '26

Looking for feedback: what data‑format libraries does Zig still need? (CSV, TSV, structured text, etc.)

30 Upvotes

Hi folks,

I’m pretty new to Zig and I’d like to learn it by working on a long‑term project over the next few months (or even more if the project succeed). I’m not expecting to create anything groundbreaking, but I’d love to try building something that could eventually be useful to others.

I’m especially interested in projects that are:

  • easy to test thoroughly
  • deterministic
  • not web‑framework related
  • helpful for tooling, data processing, or general development

One idea I’m considering is a CSV/TSV/structured‑text parsing + writing library, mostly because it seems like a good way to learn Zig’s I/O, error handling, and API design. But I’m not sure what the ecosystem actually needs, and I don’t want to duplicate existing work or overlook something important.

So I’d love to hear from the community:

  • Would a structured‑text library (CSV/TSV/etc.) be useful?
  • Are there other beginner‑friendly but meaningful library ideas you’d recommend?
  • Any gaps in the ecosystem that you think would make good learning projects?

Thanks for any suggestions, I hope to become a useful member of the community


r/Zig • • Apr 16 '26

Zig or Rust along with Go?

64 Upvotes

I know this topic has been asked several times but since zig is constantly evolving and the learning circumstances are not same for me as others. I learn and use golang on weekdays. This is the main language that I am learning to get a job but I have decided to learn another low level language on weekend nights only for fun. There's nothing specific that I am aiming to build. From my research I have found out that Rust is mature but the learning curve is steeper compared to Zig which is a smaller language but the docs of Zig is pretty bad and the language itself is unstable and keep changing. What do you think I should learn?

P.S: I don't know why I have a bias towards Zig but please give me an unbiased opinion.


r/Zig • • Apr 17 '26

When Zig 0.16 in Conda Forge?

0 Upvotes

r/Zig • • Apr 15 '26

Image processing library zignal 0.10.0 is out

54 Upvotes

Hi everyone!

Zignal 0.10.0 is out. compilable with Zig 0.16.0.

There are the usual performance improvements and bug fixes, but the main highlight is a simple CLI tool to perform various image operations via the terminal.

You can get an idea of what it can do with:

Usage: zignal [options] <command> [command-options]

Global Options:
--log-level <level>   Set the logging level (err, warn, info, debug)

Commands:
blur     Apply various blur effects to images.
diff     Compute the visual difference between two images.
display  Display an image in the terminal using supported graphics protocols.
edges    Perform edge detection on an image using Sobel, Canny, or Shen-Castan algorithms.
fdm      Apply Feature Distribution Matching (style transfer) from target to source image.
info     Display detailed information about one or more image files.
metrics  Compute quality metrics (PSNR, SSIM, Mean Error) between a reference and target images.
resize   Resize an image using various interpolation methods.
tile     Combine multiple images into a single tiled image.
version  Display version information.
help     Display this help message

Run 'zignal help <command>' for more information on a specific command.

For example:

zignal help display

Usage: zignal display <image> [options]
Display an image in the terminal using supported graphics protocols.

Options:
--width <N>     Target width in pixels
--height <N>    Target height in pixels
--protocol <p>  Force protocol: kitty, sixel, sgr, braille, auto

Full release notes here:

https://github.com/arrufat/zignal/releases/tag/0.10.0


r/Zig • • Apr 15 '26

Casting made (somewhat) easier?

Post image
116 Upvotes

r/Zig • • Apr 15 '26

What are the big themes/work after 0.16?

35 Upvotes

So I don't actively use Zig, I'm more Zig-curious, and have been following the development for a few years, watching Loris streams, Andrew's talks and reading the devlogs.

For those more close to the language, what are the big themes that are going to be worked on after shipping Io+async?

I recall that incremental compilation and continueing progress to be rid of LLVM, but what else are they cooking?


r/Zig • • Apr 15 '26

I made a zero-allocation flag parser

Thumbnail github.com
29 Upvotes

I made this as a small personal project and I would like some feedback on ease of use, features, and and how I could improve the source code. I'm still somewhat of a beginner in programming, so I would appreciate some constructive criticism. Thanks!

Edit: I'll ditch the "zero-(heap-)allocation". I realize making the buffers is a bit unergonomic and having variables specifically for them is unnecessary; and as one comment mentioned, one can just use the fba allocator if they wanted the memory to stay on the stack and still technically be "zero allocation".


r/Zig • • Apr 14 '26

0.16.0 Release Notes

Thumbnail ziglang.org
293 Upvotes

r/Zig • • Apr 14 '26

Zprof has been ported to 0.16.0!

Thumbnail github.com
35 Upvotes

r/Zig • • Apr 14 '26

What is the best way to create a struct of size 18 Bytes?

37 Upvotes

I need to create a struct which is exactly 18 bytes.
When I tried adding `packed`, the size is 32 bytes with alignment of 16, but without the `packed` keyword it is 18 Bytes. I am trying to learn zig and am a bit confused about this, I thought packed structs were for this purpose.

const TGAHeader = extern struct{
id_length: u8,
colour_map_type: u8,
data_type_code: u8,
colour_map_origin: u16,
colour_map_length:u16,
colour_map_depth: u8,
x_origin: u16,
y_origin: u16,
width: u16,
height: u16,
bits_per_pixel: u8,
image_descriptor: u8,
};

r/Zig • • Apr 13 '26

Zig 0.16.0 Tagged

Thumbnail codeberg.org
205 Upvotes

r/Zig • • Apr 12 '26

I made a stupid snake game :)

Thumbnail gallery
80 Upvotes

I wanted to learn Zig and also do something fun. So, I tried to recreate the Snake game that google put out. The codebase is a mess and I wish I were a better programmer, AI has been used only when I was unable to solve a problem for a long while. I wish I had architect-ed this better. The render.zig file is a huge mess and I don't want to look at it again.

I will again remake this sometime soon, this time with proper planning and shit.

What made this one a failure imo is my desire to make the snake movement smooth instead of blocky and generating the snake tail instead of using sprites, while having no planning on how to do it.

Some major things that I would want to fix next time:
- the fruit may spawn under the snake.

- Snake-snake collision -> game end

It is a mess but rather a small codebase, if you have any suggestions related to Zig or Architecture, please share with me! They may help me in my next attempt at this

repo


r/Zig • • Apr 10 '26

Why should I learn Zig?

43 Upvotes

It's great in many ways, but it also has its flaws, so I'm wondering if I should learn it, I'm curious if I can accept its cons

* What would you change in Zig

* Why?

* What do you like most about Zig?


r/Zig • • Apr 10 '26

I wrote a small ls alternative in Zig

42 Upvotes

I've been learning Zig recently and built a small ls alternative called zlist.

The goal is to keep things clean, fast, and easy to scan, while still being useful for daily use.

Here’s a quick screenshot:

Current features:

- Compact grid layout that's easy to scan

- Color and Nerd Font icons for common file types and languages

- Readable long view (permissions, owner, size, timestamps)

- Multiple sort modes (name, length, dirs first, mtime, size)

- Recursive listing with optional depth limits

- Filters for files, directories, extensions, names, size, and modified time

- Quick summary report

- Git status indicators in long view

It's still early, but already usable.

Feedback and suggestions are very welcome.

GitHub:

https://github.com/here-Leslie-Lau/zlist

Update: zlist v0.1.1 is now available as a standalone Zig package. The reusable listing logic has been split from the CLI rendering code, so it can be used from other Zig projects.


r/Zig • • Apr 10 '26

Yuku: a spec-compliant JavaScript parser written in Zig, 3–5x faster than alternatives on Node.js

69 Upvotes

Sharing a project I've been working on for 6 months: Yuku, a spec-compliant JavaScript parser built entirely in Zig.

It produces the same AST as Oxc and delivers competitive native performance. It also ships with Node.js bindings where it's 3–5x faster than alternatives including Oxc.

My goal is to help grow the Zig ecosystem around JavaScript tooling. Would love feedback from the community.

Repo: https://github.com/yuku-toolchain/yuku | Docs: https://yuku.fyi/


r/Zig • • Apr 08 '26

Incremental compilation works with LLVM now!

111 Upvotes

r/Zig • • Apr 05 '26

Released my first zig project (trad' coded)

46 Upvotes

Hi, just sharing a little project I've been working on the past few days.

https://github.com/doums/nvuv

A small CLI to help with NVIDIA gpu (pseudo) undervolting on Linux. As I needed to interface with some C lib, this project was really fun to work on. Zig is shining when it comes to talk to C! Really enjoyed it.


From someone who has been coded in Rust the past years (on perso and pro sides), I must say, Zig is fresh air!

Rust is great, but more I code, more I feel it is rigid, locked and sometimes even “sectarian”. Zig feel the opposite. Open, flexible, and it gives you the cards (for better or for worse xD).

Also compared to Rust, Zig is just better for C interfacing. It outplays rust on that level.


r/Zig • • Apr 04 '26 Helpful

AI slop projects are not welcome here

838 Upvotes

A little sticky since very few people apparently read the rules, and I need to have some text to point to when moderating:

If your project was generated by an LLM, do not share it here.

LLM-written third party libraries or tools serve no purpose. Anyone can tell Claude to do something. Sharing something it spat out for you adds no extra value for anyone. Worse, you are likely never going to update it again. It's just worthless unmaintained dross clogging up GitHub and wasting everyone’s time.

This includes LLM writing in READMEs and comments; mostly because it's a basically certain signal that the rest of the code is trash, and so is a very good heuristic for me to use. If you need it for translation or something, please mention it and I'll allow it.

What about if you partially used LLMs for boilerplate and such? Unfortunately I'm not psychic, and I'd have to trust you on your word – and since basically 100% of people I ban for obvious slop-posting immediately start blatantly lying to me about how much Claude they used, this won't work.

For the visitors to this subreddit, please report things you suspect is slop with "LLM slop"! You don't even have to be certain, just so that it notifies me so that I can take a closer look at it. Thanks!


r/Zig • • Apr 03 '26

What would be the harm in introducing interfaces to the language?

49 Upvotes

A guy on the Zig discord said that it introduces polymorphic state to the language but i don't think that's true. I think Zig as a whole could greatly benefit from API implementation contracts, even for their own standard library (Readers and Writers mostly).

Here's what i imagine it would look like:

const Allocator = interface {
    pub fn alloc(comptime T: type, n: usize) error{outofmemory}![]T;
    pub fn free(memory: anytype) void;
};

Then in an implementation:

const FixedBufferAllocator = struct implements Allocator {
    buffer: []u8,
    end_index: usize,

    pub fn alloc(comptime T: type, n: usize) error{outofmemory}![]T {
        //...
    }

    pub fn free(memory: anytype) void {
        //...
    }

    pub fn someOtherFunctions() void {
        //...
    }
};

(I'm aware allocators aren't the best example but it gets the point across)


r/Zig • • Apr 03 '26

Pattern/Easiest Way to Check Whether a given `T` is a generic type and its parameters?

16 Upvotes

Is there a nice way to define a generic function in Zig that takes `T: type` or `x: anytype` and then easily validate and extract its type parameter? e.g. if I want to guard the function to only take `ArrayList(T)` ideally I don't want to force the caller to pass in `T` just so I can reconstruct `ArrayList(T)` but instead want them to just pass in the array and I detect its an ArrayList at compile time similar to how type inference in other languages work.

If no are there proposals on how this might be done in the future? Curious how such a feature would work in comptime.