r/Zig Apr 04 '26

AI slop projects are not welcome here

821 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 19h ago

Zig IO Explained.

Thumbnail youtu.be
51 Upvotes

Good morning all!

I have received a lot of requests to make a video explaining the new IO interface that was introduced in Zig 0.16, and I finally made it

I walk through how to use the new IO interface, how it's changed Zig programs, how to construct an interface, and then we also dove into what the actual interface looks like in the standard library

If you don't care about the video and just want to read some code here is the repo too! https://github.com/jackparsonss/learn-zig-io

Hope you find the info useful and have a great day!


r/Zig 23h ago

Billion Row Challenge in Zig

Thumbnail youtu.be
38 Upvotes

r/Zig 19h ago

Zig compiler is like my Mom? Both say "have one at a time"

5 Upvotes

Okay, aside the sarcasm this is a genuine critic, cry for help or curiosity post. I am a beginner to zig, familiar to C family of languages and a recent interest to a custom VM implementation brought me to zig. I've been exploring it for a couple of days only so pardon for my limited insights.

Zig surely is opinionated as well as quite stubborn and in a wrong way many times. Unused variables and even function parameters are hard errors rather than warnings. Like why?

I like the idea of pure control and absolute performance but why do we need to explicitly pass allocators everytime? Why not have defaulted allocator parameters just in-case? Maybe at least for less critical API.

Giving only single errors at a time in this age paired with lackluster lsp (maybe cause the compiler itself gives just one error at a time and lsp depends on compiler diagnostics) makes using the language pretty hectic. Leave alone all other use cases, how is any change that cascades to be caught ergonomically?

There could be multiple errors and all you see is a single one so you fix that and run the compiler thinking it is done and surprise, it's another error and the same cycle of "fix -> compile -> error" continues. It's so stupid that it's funny, and salute to those who are developing and maintaining large projects like ghostty and tigerbeetle with such lackluster tools.

So it's quite a bit of friction going forward and I am really questioning whether to keep going with zig ( does it get better, or there are work-arounds or other tools that help minimize such painpoints?). What's others noticeably (good or bad) in Zig from your experience? Please provide your 2 cents.


r/Zig 3d ago

I made an x86_64 machine code generator

Thumbnail github.com
41 Upvotes

So, I wanted to make a JIT compiler for my friend's programming language, but it's in Zig, so about 5 days ago, I decided I was going to learn Zig by making the JIT library in it, and I made this! Lemme know what you think. Btw, this isn't supposed to be a competitor to any other libs like this in Zig (I don't know of any, but yk).


r/Zig 4d ago

Little Console-Base Snake Game in zig 0.16

Post image
47 Upvotes

My first project with zig.

I had fun learning about comptime and generics, so I made this demo where I run multiple game instances at once with different configurations all created in compile time.

https://github.com/Youssef-Afella/Z-ConsoleSnake/tree/main


r/Zig 5d ago

YAML made me cry, so I made my own

Thumbnail codeberg.org
64 Upvotes

Basically, I couldn't decide which popular configuration format to use between JSON, YAML, TOML and a few other options, since all have their own limitations and quirks that I wasn't keen on dealing with.

So I figured I might as well make my own with its own quirks, but only limited by what I can implement for myself.

And at this point it seems pretty usable to me, but I'd like some feedback from others. Would you consider using this? Why or why not (besides lack of tooling and support for other programming languages, obviously)?


r/Zig 6d ago

Looking for feedback on my VM without KVM written on ZIG.

24 Upvotes

Hello everyone!

I wood like get some feedback from you.

Repository: https://codeberg.org/angryduck001/vmduck

Recently i am started working on the VM machine on Zig. I am not using KVM - Instead of standart linux syscalls (like mmap, mprotect, sigaction). And next, I intend to do that more secure and isolated from main system. I am also currently working with catching system interrupts (int) to running in 16-32 bit mode.

This project is still early.


r/Zig 7d ago

Color me concerned!

108 Upvotes

I’ve started to see a concerning trend with zig of late.
If you look at today’s commit logs you will spot it.
Adding support for spork8 it’s a hobby 8-bit computer project that Andrew Kelly hung out with over the weekend for like a hackathon. The spork8 project has like 54 stars.
How someone spends their free time is no ones business but there own. But it seems the BD of zig has been on one tangent after another.
Spork8
Fil-C
Custom backend
Incremental compilation
Spriv
All are cool things who doesn’t like faster compile times but are these things needed to finalize the language.
I see many accepted proposals that make or add to the language which to me are more important than many of these tangents. Sure u compile faster than rust now big whoop with every release of rust do know what doesn’t happen ? All the tutorials, documentation, guides, code don’t all become invalid.
Do you know what happens when your language gets 1.0 your libraries, docs, tutorials, user base can grow exponentially. Your core ppl can focus on polishind the std and it’s not a complete churn fest with every version.
Maybe totally wrong I hope I am I would hate to see zig be a forever hobby language.
Just had to rant.


r/Zig 7d ago

Starting my journey in Zig

16 Upvotes

I've been learning Zig for a while now and it has been really interesting and challenging sometimes. But in order to solidify my knowledge I want to be releasing an article every week on a topic that might help people but this is my first time doing it. I need advice of how to go about it and what I can write on weekly.

Although I've written 2 articles so far, which are on Merge sort and Quick sort implementation in Zig which you can find here https://devbytex.dev/posts but I need more solid topics I can write on. Thanks in advance


r/Zig 10d ago

Discussion: `@importRoot` instead of `@import("root")`

26 Upvotes

So, let me start by saying I'm pretty new to Zig. I like to learn languages by example, and when reading through examples and source code I noticed `@import("root")` and thought it was importing the corresponding "root.zig" file. After some further research I found out that this is actually a special-cased argument for the compilation root. Honestly I think that's a horrible decision, not only is there special-cased arguments for a compiler-provided method, but its a string argument, so it seems completely magical and non-discoverable.

Imo, Zig already has a specific syntax for special compiler-provided operations: `@func`. So I think a much more sensible and readable version would be `@importRoot`, because if "root" is going to be treated specially then let it at least be openly acknowledged as being special. Same for all of the other special arguments: `@importSelf` and `@importStd`.

But again, I'm new, so let me know if I'm totally off-base here.


r/Zig 12d ago

JWT Authentication in Zig

Thumbnail youtu.be
50 Upvotes

Hey everyone!

If you've seen my posts in the past, you'd know that I've got a few different tutorial series going on in Zig, one is a game engine, but another is building out a REST API in Zig.

I come from a background in Web Dev and find it a lot of fun to take what I know and apply it in Zig, and I want to share the knowledge!

If you want to start at the beginning, I've put together all the videos as a playlist: https://www.youtube.com/playlist?list=PLUUIFT8XnWz8

But please let me know what you all want to see next! I'm planning a video on how to scale the API to thousands of concurrent requests, but what other API things do you all want to see?

Hope you have a great day :)


r/Zig 14d ago

There is a way to create a thread pool with pre-spawned worker threads?

15 Upvotes

r/Zig 15d ago

There’s More Than One Way To Do It

32 Upvotes

Recently I am started learning Zig language, btw here I seen many constructions that remind me Golang in more ways. But there are many ways to do the same thing.

For example more ways to initialize structure. And work with the cycles/conditions.

But Zig aims to do everything in one way, doesn't it?

What you think about this?


r/Zig 15d ago

strings for assembly is ugly

24 Upvotes

The problem i have with zig assembly syntax is you have to use strings which is just ugly. I suspect this is inherited from C.

String and their syntax is designed so you can write just about anything in them. The price for that is visual noise minimum, and in my opinion its just less readable to re use syntax of the "just about any text" thing for the "small set of valid assembly ops" thing. Multi line string has less noise but cannot be used in all cases for assembly.

Theres a reason @"name" syntax isnt the way you declare every function and variable and is instead only for special cases, its just hideous and noisy.


r/Zig 16d ago

LLDB is awesome and found a way to foot-gun myself with defer

47 Upvotes

I've been working on a tcp server and recently started building tests for the server using multiple threads with clients to do partial sends, slow sends, etc and make sure its not blocking the server. I added an atomic flag in the main while loop, instead of while(true), so an outside thread can signal the server to stop running. Then I put a deinit() call after the main loop exits so the server would clean itself up. The problem is that a while ago I put a defer server.deinit() at the top of the test and forgot about it. Today, when I got back to working on the project, I was so confused when my program was aborting with a TRAP signal and no other information.

In school I've picked up a bit of a habit of getting pretty close with my programs/solutions and then turning to llms when I need to debug my code. My excuse has always been that I'm in a hurry to get stuff done, so when I ran into the issue from before, I immediately turned to an llm. It was able to fix a few issues that weren't the root cause but the original error was still there. It always annoys me when I get sucked into a loop of "llm fix this" where nothing gets fixed. In the past I don't usually snapped out of it and turn on my brain, but today I watched this video from JetBrains Academy. It was pretty obvious and yet still the wakeup call I needed. I figured out how to use LLDB with zig and spent 5 minutes stepping through my code and found the error, my server deinit's itself when stopped but I still called defer deinit when I created the server.

Its too easy to outsource your thinking and learning right now.


r/Zig 16d ago

huntclaw - a fast find-and-replace utility in Zig

Thumbnail gallery
74 Upvotes

Hello everyone,

I’d like to introduce huntclaw—a search-and-replace utility written in Zig that turned out to be faster than sd (written in Rust) and the standard GNU utilities.

there’s a fairly simple explanation for this high speed: the lack of a regex engine and a focus on speed itself, but I don’t think that’s a bad thing. Note that searching is also very fast, thanks to SIMD two-byte prefiltering

In the photos I've attached, you can see the benchmarks: huntclaw vs. other utils and v0.3 vs. v0.4 versions of huntclaw. You can run them yourself using the ‘huntclaw_bench.py’ file (or on your own tests).

the benchmark also shows that rg and grep is faster at sparse searches—though the gap isn’t that big (20ms-9ms and 55ms-1619ms)
I look forward to your feedback or comments.

version now: v0.8

huntclaw on GitHub: https://github.com/tigerlang/huntclaw


r/Zig 16d ago

I want use ZIG (Is this good solution?)

14 Upvotes

Hello everyone, last times i write code on the C/C++/Go. I love system programming, low level development. Recently i started getting tired from implicit moments in C. I watch in Rust side, but Zig more interesting me. And i did work with rust in 2025 (small time). Which interesting moment in Zig you like and should i tried that in system low level developming (for yourself). Thanks!


r/Zig 15d ago

How true is this, and how important is it?

Thumbnail youtube.com
0 Upvotes

r/Zig 18d ago

What are some usecases of multi-item pointers

35 Upvotes

I started learning zig recently and was midway completing the ziglings exercises. Its a very good source of knowledge about the language intricacies but I am having a difficult time trying to think of examples or usecases where those details might be useful.

When I did the multi-item pointers exercise, to my mind it didn't seem to have any use because of how it loses information about length and can cause more memory bugs. I am not doubting zig devs and I'm sure there would be some really good usecases for it but I need some examples for me to have a better understanding of it.

Writing here hoping someone will point me to some good resources.


r/Zig 19d ago

What Zig felt like, coming from Rust

Thumbnail besok.github.io
55 Upvotes

r/Zig 19d ago

Why i'm building my game engine in Zig

Thumbnail youtu.be
77 Upvotes

Hey everyone!

I'm back with a new video, and it's the first devlog for my game engine written in Zig

If you've seen my other videos, you might know that I've been putting together a tutorial series on making a game engine in Zig, but I also want to make videos on where the latest version of the engine is

So in this video, I break down why I gave up on Rust and chose Zig instead, and then break down the existing state of the engine

Hope you all enjoy :)


r/Zig 19d ago

Introduction to metaprogramming with comptime

Thumbnail slicker.me
65 Upvotes

r/Zig 19d ago

Logs compression algorithm built in zig 0.16

2 Upvotes

Hi folks, I’ve just achieved a big win for log compression using Zig 0.16. My algorithm doesn’t need full data rehydration to find a specific log. It takes just 2 seconds to search through 1.5M log lines


r/Zig 20d ago

What if I switch from Rust to Zig because of long build times in development?

48 Upvotes

I just opened https://www.reddit.com/r/rust/comments/1voapjq/rust_backend_slow_dev_compile_times_im_exhausted/. I'm wondering if i can swith to Zig easily.

  • Is the dependency/library ecosystem ready? For example is there something like rust-embed?
  • What might be the challenges?

I'm not a comfortable, lazy, or quitter. I enjoy challenges, but I'm really exhausted by Rust's build times during development.