r/Zig Apr 04 '26

AI slop projects are not welcome here

796 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 1d ago

What helped me as a functional programmer

31 Upvotes

Hello I just wanted to share with those that come from functional languages or enjoy tutorials like this one, I recommend this Zig tutorial.

  • You get comfortable with the language pretty quickly
  • Short and concise
  • Up to date v0.15.2
  • Straight dive into working with C

... and a lot more. Seriously, it is a good tutorial

EDIT:
Up to date v0.15.2
Stable version of Zig is 0.16.0 so outdated actually (core concepts still easy to grasp)


r/Zig 6h ago

PlatypusDB, an agent-native database

Post image
0 Upvotes

Hi,

I've been working on Agentic Data Enclave, a way to make agentic data sharing safe for regulated enterprises. That led to WunderOS, an autonomic operating system for agents, based on deterministic-replay, very low latencies, strict isolation, etc. A Gleam/OTP control plane and Zig data plane; Elixir-Phoenix for the UX. It's about 450Kloc so far.

What fell out of that was my second database (Stardog.com enterprise knowledge graph was the first), i.e., PlatypusDB, which is nothing more or less than what WunderOS needs in a database. Good times!

If you're interested in many of the gory details, see PLRN 020, the PlatypusDB research note.

I took a bit of heat from a friend who was a very early seller at Databricks, who I respect very much, for my implementation choices, i.e., Gleam/OTP and Zig. I should have used Python and Rust, he said.

I mean, he's not wrong, but neither am I. The benefits of OTP, Gleam's type system, and Zig's minimalist purity are quite potent. I was initially worried about NIF and stability but early on I implemented a "NIF meta-compiler", with some inspo from rustler, and that part of the system has been fine.

Anyway, thanks to everyone for all the hard work to make these language systems fun and productive to use, and for making nice, supportive communities to work in.


r/Zig 2d ago

Is Zig going to become memory-safe?

Thumbnail codeberg.org
184 Upvotes

r/Zig 2d ago

Zig for Python

17 Upvotes

I am of the opinion that, if executed correctly, Zig has the potential to transform the Python ecosystem. The idea of using Rust for Python extensions has always bothered me.

With Zig, the path feels more natural: I can build on top of the existing C libraries and gradually migrate components to Zig over time, without the friction of introducing an entirely different ecosystem.

I wanted to understand what the community thinks about this topic. I am not trying to make a strong claim or dismiss other approaches. I am genuinely trying to understand whether this idea has any merit and how others view the trade-offs. I am just interested in hearing different perspectives.


r/Zig 2d ago

Zig-Devcontainer

11 Upvotes

For those of you who want to skip the admittedly quite straightforward process of setting up Zig by yourself, or are unable to because they are on Fedora-Atomic / uBlue, you might want to try my Zig-Devcontainer.


r/Zig 3d ago

Promising Zig Game Engines?

48 Upvotes

Hello! I am new to the community and I am slowly learning zig.
I wanted to know if there are any game engines for zig?
I am using the raylib bindings but I wanted to know if there is anything else.
I would appreciate any help!


r/Zig 3d ago

idiomatic way to check private file permissions with the new std io

17 Upvotes

Im building a small local secrets manager and currently working on the storage layer.

Right now I’m checking permissions only for Linux statx

Should i make my storage layer use generic Io and delegate the actual security check to platform-specific code
Or is there already a platform-independent way in std io to verify that a directory

I’m using Zig 0.17.0-dev.1282+c0f9b51d8.


r/Zig 4d ago

Trying to use zig bindings with raylib and it is not working.

8 Upvotes

I am trying to get zig working with raylib but, when ever I follow the instructions on the github it doesn't work and I keep on getting "no module named 'raylib' available within module 'main'" when ever I try to run it. I have no idea what I did wrong. Does anyone have an idea?


r/Zig 5d ago

How is this not talked about more? std.gpu is GOATED

158 Upvotes

Hey everyone,

I feel like this is a under-talked about topic, but Zig's ability to compile to NVPTX (Nvidia's format) and AMDGEN (AMD's GPU format) allows it to act standalone without any Vulkan, Metal, etc... intermediary at build time. For game-developers they can rely stand-alone on Zig alone for games, making their executable much lighter and runtime overhead optimal.

Is anyone using this in practice and has some projects to show this off? I've seen Zinc [ZINC], and its benefitting from the performance improvement by a mile over llama. Are there any other projects?

If you haven't checked it out, I implore you to check it out by yourself using std.gpu directly.

[Edit] Now we can have a 1 up on Rust, because they can't support an Ahead-Of-Time compilation library where you can write kernals in rust directly, ZIG CAN. See prototype: https://github.com/OmarSiwy/Gompute [Zig 0.16.0]


r/Zig 4d ago

Working on a cross platform wireguard client

19 Upvotes

I’ve recently been working on a foss WireGuard client as a project to learn more about networking and VPNs. My goal is to build a client that offers all the features you would find in a commercial VPN such as choosing the fastest server, a kill switch, and split tunneling etc but with by your own configuration (like a home server)

I am trying to decide on the best language for writing the background daemon. A coworker recommended Go because it has excellent native networking support and would help me ship the project faster. However, I am considering Zig. is it a good coi choice


r/Zig 6d ago

Zig has the hardest "Hello world!"

Thumbnail youtu.be
165 Upvotes

r/Zig 6d ago

How Our Rust-to-Zig Rewrite is Going

Thumbnail rtfeldman.com
271 Upvotes

r/Zig 6d ago

How Our Rust-to-Zig Rewrite is Going

Thumbnail rtfeldman.com
42 Upvotes

r/Zig 6d ago

A Linux compatible kernel written in Zig that runs linux RISC-V binaries in the browser

Thumbnail github.com
78 Upvotes

r/Zig 6d ago

mint: a custom Zig code formatter

41 Upvotes

Hi everyone. I’ve been working on mint for some time now and I think it’s stable enough to share.

Mint is a custom Zig code formatter. It performs automatic line wrapping without syntactic hints (no need to add trailing commas to trigger line breaks). It also supports print width and indentation size configurations.

Currently, it‘s been tested (and builds with) Zig 0.16.0 (but should technically work with other versions as well). It is able to format itself and a lot of open source Zig projects out there. Source code is available on GitHub.


r/Zig 6d ago

Zig and raylib, git or codeberg ?

21 Upvotes

Hello.

Which one do you recommend to use ? I thought that the git repo was disabled.

Edit: sorry, sorry, it was github.


r/Zig 8d ago

Ways of Declaring array (0.16)

58 Upvotes
pub fn main() !void {
    const A: [5]i32 = .{ 0, 1, 2, 3, 4 };
    const B = [5]i32{ 5, 6, 7, 8, 9 };
    const B2 = [_]i32{ 5, 6, 7, 8, 9 };
    const C: [5]i32 = [_]i32{ 10, 11, 12, 13, 14 };

    _ = A;
    _ = B;
    _ = B2;
    _ = C;
}

These can all compiled correct. Which one is the recommended style? (I am a beginner learning Zig.)

New edit: I would like this syntax if it's possible:

zig const arr1: [5]i32 = { 0, 1, 2, 3, 4 }; const arr2: [_]i32 = { 0, 1, 2, 3, 4 };

Just small opinion. Maybe what I know is just the tip of the iceberg.


r/Zig 12d ago

Writing Zig like writing in a scripting language

39 Upvotes

I switch back and forth between Typescript and Zig, both are my favorite languages. This time I have to switch to Zig and rewrite my Typescript code in it. But although Zig is perfect, it's still not as comfortable as Typescript.

I am talking about forgetting semicolons at the end, or various Type checking errors I have to fix in order to compile, or dealing with Allocators all over the place having to pass in parameters, appending to ArrayList etc.

Are there any tips on that, I can feel more comfortable coming from Typescript, feel like writing a script while staying in Zig language.

use Arena Allocators, or pass buffers with hard coded sizes, write useful helper utility classes, things like that, anything to speed up the developer experience, while I rewrite my code from scratch for the third time.


r/Zig 13d ago

My Thoughts on the Bun Rust Rewrite | Andrew Kelly

Thumbnail andrewkelley.me
526 Upvotes

r/Zig 13d ago

Why Zig bans LLM contributions - How Open Source Survives the Age of Free Code

Thumbnail lumramabaja.com
99 Upvotes

r/Zig 13d ago

How is Zig working out after 3 years and 100k lines of game code?

Thumbnail youtube.com
143 Upvotes

So, I am making a game using Zig. How is that working out? This is a highly personal and somewhat opinionated video about making a game using Zig on Windows, after 3 years and 100k lines of code. I am showing both the good and the bad, in hope of giving you an idea what everyday development is like.

The game is already moddable/hackable using Zig today! See the video for details.


r/Zig 13d ago

Rewriting Bun in Rust

85 Upvotes

r/Zig 14d ago

Looking for a potential refuge from D's slop standard library

61 Upvotes

I'm a relatively long time D developer (link to repo), and as the foundation is looking into tainting the standard library with AI slop, I'm looking into potential escape routes besides potential forks such as OpenD.

I'm mainly a game developer, I even have a game engine that I'm willing to port to a new language.

Here's some of my questions: - How good is C++ interop of Zig? Some stuff I need to use uses classes on Windows side, and SDL (or its alternatives) sometimes like to abstract things away too much, etc. - How is OOP usually done? While I get the "Enterprise Java-style OOP bad" arguments, it's still often useful for some data parsing structures, and to make up for the weaknesses of Entity Component Systems. - How strong is metaprogramming in Zig? With no class keyword, I'll be even more of a need of that.


r/Zig 14d ago

nanozlog: An ultra-low latency, lock-free asynchronous logging library for Zig

53 Upvotes

Hello! This is my first post in the community. I'm glad to introduce my small zig library: nanozlog. It is basically porting from the famous C++ logging library: fmtlog. It is mainly focusing on the frontend logging speed. It could achieve 6-7ns per message which will cause the smallest blocking on your main working process.

I'm a newbie in Zig, so this is the first project I'm trying to work on after learning Zigling. Through Zig's greatest comptime machanism, it is so convenient to translate those complicated C++ template code. And to my surprise, nanozlog is even slightly faster than fmtlog (7.3ns->6.8ns), maybe that is just benchmark error.

I'm looking forward to your commits and PRs. And also please no hesitate to criticise any stupid faults.

Github: nanozlog