r/Zig • • Jan 03 '26

I’m building a concurrency library for Zig

0 Upvotes

I’ve been working on a project called zig-routines a concurrency library for Zig that aims to make it practical to build complex concurrent systems without hiding memory or control flow.

tbh i dont consider me a genius or expert in the field so a lot of opinions and also feedback will help me a lot

https://github.com/Edartruwu/zig-routines

EDIT:

did i use AI for the code?
yes, i also kinda got help from one friend that knows zig much better than me, we are open for contributions and also feedback from people lot smarter than us

why there is not that many commits?
because it was done outside github, then i just downloaded the zip and got it running


r/Zig • • May 09 '26

Zig could have prevented CopyFail?

8 Upvotes

If the Linux kernel were written in Zig, would it have been better? Ik, the answer is obvious with buffer overflows - hallmark of string handling. But how about overrides? Well...(Downvote down to the sewers if ts stupid)


r/Zig • • Feb 18 '26 Bravo

[nullclaw] OpenClaw implementation in Zig

1 Upvotes

I’ve been working on nullclaw — a tiny, fast, single-binary autonomous AI assistant infrastructure written in Zig:

https://github.com/nullclaw/nullclaw

The goal: keep the “full assistant infra” idea (providers/channels/tools/memory/sandbox/tunnels) but make it practical on cheap hardware, small VPS, and low-latency workflows.

No global install needed:

./zig-out/bin/nullclaw onboard --interactive

./zig-out/bin/nullclaw agent -m "Hello, nullclaw!"

If you try it and it breaks on your platform/config, please open an issue — I’m optimizing for portability and reproducibility.

Docs (WIP): https://nullclaw.github.io/


r/Zig • • Jul 08 '22

Why the use of semicolons?

4 Upvotes

Hi guys! I am a Golang developer with eight years of experience in production and I am interested in studying Zig.

Andrew's presentations on async-await in Zig and DOD made me decide to move to Zig for my next side-project and long-term use. My gut says that Zig will be the future language for everything and an alternative to Golang, even though the community is still tiny.

But semicolons are a huge turnoff for me.Do you use it for one liners? And if so, can you show me some examples of one liners?

I don't believe Zig needs semicolons, like Javascript that need to minify the scripts for production.

Update:

Zig's future is so bright that I will ignore semicolons like I ignore Golang's error handling. At least it is not like Rust where the return value equals a line without the semicolon which causes eyestrains when reading the code.


r/Zig • • Sep 05 '26

I have a vibe-coded project where I came across Zig bugs. How to reach out Zig without violating AI policy

0 Upvotes

I have captured few issues here:

Kaappi upstream bugs

But how can I provide these bugs details to Zig upstram without violating AI policy?


r/Zig • • Apr 08 '25

Tired of unused variable errors? Try this trick

0 Upvotes

Instead of writing

_ = variable;

use:

_ = @TypeOf(variable);

or define an ignore function that takes a parameter of anytype and does the same.

This will suppress the error regardless of whether the variable is used or not.


r/Zig • • May 16 '22

A programming language to program with till I die.

4 Upvotes

I've been searching for a programming language to program with till I die. Basically, I'll choose this language and stick with it till I die.

I was practising law earlier and I switched to a career in IT full-time last year. I come from a web development job and have been tinkering with JavaScript for the past one year and have been learning different associated technologies such as React.js, Node.js etc. Before going full-time, I had played a bit with Python and PHP. I had also been tinkering with Linux.

Till two days ago my choice for this till-I-die language has been Rust. I just discovered Zig two days ago. Since then, I've been watching different videos on Zig and sort of been interested (I've been an admirer of C).

I love learning things deeply and would love to dive into systems programming, embedded programming, crypto, building servers before I die. Haha!

Is Zig that language? I know that Zig is in its nascent stage of development. However, I am impressed by the fact that it has travelled six years from its inception.

PS: I'm obsessed with speed and performance.


r/Zig • • Jan 05 '24

Shouldn't Zig and the Zig compiler use the GPL license instead of MIT?

1 Upvotes

I know there's concerns for some projects sometimes about copyleft licenses not always being suitable for commercial use, and I sorta understand that, but I thought that didn't apply to programming languages themselves? And their compilers. Like, I could have sworn that GCC is copyleft, and uses the GPL, which is why it's the compiler of C used for the Linux kernel, but that doesn't make code written with C or compiled by GCC automatically GPL or GPL licensed. The copyleft only applies to code written for and added to the compiler itself, not code that the compiler compiles.

Like, while the main compiler for Rust is RustC, in order for Rust to be accepted into the Linux kernel they had to make GCC-Rust, a module or addition or variant of GCC that uses the same GPL licensing as the rest of GCC. The goal of the Linux project is for it and its dependencies like the compilers to be GPL'd and copyleft. And plenty of companies like IBM and Google and Amazon are still able to get away with using the Linux kernel commercially and not releasing all of their code for those products, just the code they contribute to the kernel and compilers themselves.

Andrew Kelley's stated goal for Zig is to maintain and in some instances replace C, and the Linux kernel is probably one of the biggest and most used pieces of software around that uses pure C. And yes also now Rust.

If nothing else, since Zig and the compiler were initially created by Kelley, why wasn't it, like, dual-licensed, where it could use the GPL or MIT depending on what the user preferred? And then keep the main branch dual-licensed like that? So it could actually potentially be used for the kernel?

Like, I dunno if Linus Torvalds would accept it, and kinda doubt it, but the fact that Zig isn't part of GCC and doesn't have a GPL licensed compiler makes it not even an option. And that seems a little shortsided to me when the goal is to remove the bad parts of C?

I like the Zig language itself, but I don't understand this decision.


r/Zig • • Dec 13 '25

Zig comptime?

2 Upvotes

r/Zig • • Aug 15 '26

Logs compression algorithm built in zig 0.16

0 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 • • May 27 '26

Zig Language Features

0 Upvotes

Does anyone know if Zig has any more planned language semantics to be introduced pre 1.0?

A couple things I’d personally love to see:

#1
make()
free()
destroy()
into the global namespace ala Odin / Golang

#2
std.mem.Allocator
std.Io
const std = @import(“std”) avail by default

Same as above but less passionate about these

#3:
.tag = val instead of .{ .tag = val } syntax for tagged unions

#4 Default function params
* potentially for implicit allocator use ala Odin

I understand that a lot of the goal of Zig is to make things as explicit as possible, I find that there is a lot of unnecessary typing in the syntax and in function signatures that makes the language a little more verbose than I’d like. Curious if any of these are either planned / maybes / or never gonna happen.


r/Zig • • Aug 28 '25

Help Needed!! , In Zig 0.15+ how can i serialize and deserialize object. Guys can you explain me, i just stuck here...... and how are you handling your http request and response(Zig -.15+).....

0 Upvotes

r/Zig • • Dec 22 '24

Zig Docker image - rant

0 Upvotes

Alright, let’s talk about the absolute absurdity that is the lack of an official Docker/OCI image for Zig. It’s 2024, and somehow, a modern programming language has decided to give Containers the cold shoulder. Sure, there’s the (abandoned) ziglang/docker-zig, but even they don’t want you to take it seriously. And that cringe-worthy line?

“Zig makes Docker irrelevant.”

Excuse me? That’s like saying, “Oh, you don’t need a seatbelt because this car is probably crash-proof.” The hubris is off the charts.

Docker is the gold standard for consistent, portable development environments. It’s not some unnecessary fad - it’s how real-world teams build and ship software. Need a specific Zig version in your CI pipeline? Want to avoid wrecking your local dev setup by installing yet another version? Docker’s the answer.

But no, Zig’s official stance is basically, “Nah, you don’t need that.” As if every Zig developer operates in some idealized vacuum where build environments magically align across machines. And don’t even get me started on the irony of saying “you probably don’t need a Docker image” in the same breath as maintaining a half-hearted one. Like, if you’re going to be smug, at least commit to it.

Zig is cool. It’s fast, it’s low-level, it’s got some genuinely clever ideas. But refusing to embrace a basic tool like Docker reeks of gatekeeping. Just admit it - an official Docker image is useful. It’s not asking for the moon here, just the bare minimum to make the language feel practical for things that benefit from the presence of OCI/Docker image - Coud deployments, CI/CD builds, devcontainers…

Edit: I initially wrote Docker, because most of people know what is Docker, and not necessarily OCI. I could have written OCI and mentioned other container tools, but Docker was here for clarity and simplicity.


r/Zig • • Sep 25 '24

noisy syntax

0 Upvotes

i'm sure this is not the top of anybody's list of possible zig improvements, but this syntax is noisy, right? would odin's/jai's way of declaring consts/vars be ok with you with :: and := operators? and something equally terse for visibility modifiers so there's just much less code overall to parse visually and what's important pops more?

I think this Jai code looks GREAT. I have ZERO problem seeing if sth is a constant or a variable. and the name pops right there.

EDIT: I'm getting feedback that `::` and `:=` are too hard to parse apart, and especially might be so for folks with dyslexia and such. fair enough. I have to say, in the interest of making this Zig code less wordy, I'd love to see something like what Vlang has done, where `:=` is the init operator, and you just add a `mut` keyword in front of the ident if you want the thing to be mutable. so

mut friendly := true
friendly = false

troll := false
troll = true // compile error

r/Zig • • Mar 01 '24

Ideating Zig Use Cases

0 Upvotes

I just wanted to start a thread exploring what potential use cases are for Zig that highlights its use cases best and discussing what its potential value is made a map of potential use cases.

  1. Blockchain - can it replace selenium (just got an idea from tiger beetle success)

  2. High Frequency Trading - is it really applicable?

My intent is to stir up ideas from the community for best use cases that people are willing to pay for.


r/Zig • • Jul 14 '24

Why Zig

1 Upvotes

why should I learn zig? this one is a genuine question.


r/Zig • • Feb 27 '26

Unofficial Claude Code SDK

4 Upvotes

I decided it made sense to port the Claude Code SDK to Zig. The world is moving towards autonomous agent solutions, and Zig should not be left behind. Perhaps this will be useful not only to me, but to someone else as well.

https://codeberg.org/duhnist/claude-code-sdk-zig


r/Zig • • Jul 31 '25

Why not distribute Zig through torrenting ?

0 Upvotes

Instead of using community mirrors you have to verify your downloads from and since the purpose of mirrors is to have the project remain nimble on ressources so that they can be spent on developper time, why not use torrent ?

Torrenting will ensure that you get the intended file and distribute the effort on every downloader

Of course, someone could start their own torrent but then it could be malicious. An official torrent file would solve that

Upvote if you want a torrent page !

P.S : I know Fedora does it for their images for example


r/Zig • • Jan 31 '25

What is zigs market

0 Upvotes

I've had a couple of casual looks at Zig but I'm still unclear who zigs target market is, what problem is it trying to solve?

Rust has a very specific problem it's trying to solve (memory saftey without gc) but Zig doesn't seem to offer any improvements over c.

What an I missing?


r/Zig • • Jul 29 '26

An up to date LLM for Zig v0.16

0 Upvotes

Even at the risk of making myself (once again) very unpopular: Is there actually an LLM out there that can help me create source code for Zig v0.16? Most of them are still at version 0.12. I’d like to try out some graph theory problems with Zig, but I have neither the time nor the inclination to write the entire test suite myself. That would be the perfect task for an LLM. So far, I haven’t even been able to force an LLM to understand that you no longer initialize an ArrayList with `init(allocator)`, but with `.empty`.


r/Zig • • Oct 02 '22

Idea: generic integer

0 Upvotes

If you can do this:

var s = "hello";

Why can't you do this?

var i = 5;

Proposal: make this a "generic_int" with the following sematics:

This type of integer is guaranteed to either behave identically to a comptime_int or panic on overflow. Its size is undefined and unknowable at compilation time, but implementation is guaranteed to be >= isize. Saturating and wraparound operators are not applicable.

It's essentially a "runtime comptime_int".

It should be particularly useful for counters and indices in loops. Sure, you can just use isize for a generic ints, but I think this can make code cleaner.


r/Zig • • Sep 10 '25

Encontrei poucos drivers SQL

0 Upvotes

Eu estava construindo um backend quando cheguei na parte de manipular dados no banco de dados. Encontrei poucas opções para drivers mySQL, na verdade apenas uma compatível com 0.15.1.

De que maneira vocês costumam utilizar banco de dados em zig garantindo performance e interoperabilidade?


r/Zig • • Jan 18 '22

Is zig faster than rust in performance?

0 Upvotes

If it is then why and how!


r/Zig • • May 18 '26

I Built a Custom Mailserver - and Database From Scratch. Here's What Happened. :: Tom J.

Thumbnail tomj.pro
9 Upvotes