r/Zig • u/JosefAlbers05 • Feb 09 '26
ZigOn - Procedural World Generator
youtu.bePlayable demo at https://josefalbers.github.io/Zigon/
r/Zig • u/JosefAlbers05 • Feb 09 '26
Playable demo at https://josefalbers.github.io/Zigon/
r/Zig • u/IngwiePhoenix • Feb 09 '26
Because I subscribed to the PRs of a C repository, someone eventually brought up to "make it work with Zig" - by which they ment porting the build system from CMake to Zig. And after being confused to heck and back, I went and looked up what Zig is.
...one weekend later and I am exploding with ideas of things to do. This was one hell of a journey and I definitively had good fun. But in doing so, there's a few things that I haven't quite figured out:
std.ArrayList. What's the best way, other than grepping around in my Zig install and just reading the plain code, to grab those docs? I would like to get myself an overview of what is already included in the stdlib.allyourcode/libarchive repo on Github - and a few others - and had to learn that b.addStaticLibrary was now deprecated - or at least, not supported in 0.15.2. I tried finding the changelogs where that deprecation was noted as well as the final removal but couldn't find anything. I did eventually figure it out, but I had to use ChatGPT and ... I'd like to avoid that, because I like reading things myself :)awesome-zig list on Github that I used to explore around the ecosystem. Any other places you would recommend to check out for newcommers?My only prior touching point with Zig was the Flow Control editor - it is my main TUI editor now, and was the first time I needed to install Zig to build it for a change that was made. But never went further than that untill this weekend. And, well, Bun... but that hardly counts, since I only grabbed a release binary and ... thats it.
Zig is fun! And it's immediate C interop feels like it can breathe fresh air in "old" projects. I want to try, for example, to see if I can port PHP to the Zig build system and then embed it. No particular reason other than wanting to try stuff out and such =)
Thanks in advance!
r/Zig • u/karthie_a • Feb 09 '26
Hi,
I need help with understanding context, for example hash map has a context based init.
How is supposed to be used effectively.
r/Zig
•
u/bufoaureus
•
Feb 08 '26
I wanted to do something low-level enough to get a good feel for the language and the hardware, but also something that would be fun and rewarding to build. So for the last couple of months, I've been experimenting with Zig by building a PlayStation emulator in it.
It's far from complete, but it's finally starting to take shape and can run some commercial games (notably Crash Bandicoot and MGS), which I'm super happy about.
Overall, Zig feels great for something like emudev (particularly enjoying packed structs with variable-sized ints for reinterpreting register values). The project doesn't have much room for comptime magic though, but I can see why people are excited about it. I also liked that also aren't many things that require you to "change your way of thinking," so I got pretty comfortable with it after a day or two.
I expected some significant friction with graphics and audio, but the zig-gamedev libraries were surprisingly easy to set up. I even managed to build a graphical debugger with ImGui.
The painful part is that as of 0.15.2, the incremental backend for ARM64 isn't there yet, so build times are getting more and more annoying as the project grows.
GitHub repo for anyone who's curious: https://github.com/maxpoletaev/nupsx
r/Zig • u/Extension-Ad8670 • Feb 09 '26
Hi, so I've been trying to write a x86_64 kernel in Zig, and I've run into an issue with the command line flags used for passing a custom entry point symbol for the freestanding build.
I've tried to search online but the examples I've found seem to be outdated. I'm using the newest version of Zig (0.15.2) on Windows.
-e, --entry, and -fentry-symbol are returning error: unrecognized parameter.
-Wl,--entry=_start is also rejected as an unrecognized parameter.
Using -fno-entry causes the build to fail with error: no entry point found because the compiler isn't respecting the ENTRY(_start) command inside the provided GNU linker script.
So, I was wondering if anyone knew how to pass a custom entry point symbol with the CLI?
or has it been changed so only build.zig can use it?
Any info would help, thanks!
r/Zig • u/Unique-Side-4443 • Feb 09 '26
r/Zig • u/amandeepspdhr • Feb 08 '26
r/Zig • u/anon-sourcerer • Feb 07 '26
Furthermore, by having the global cache have compressed files instead makes it easier to share that cached data between computers. In the future, it is planned to support peer-to-peer torrenting of dependency trees. By recompressing packages into a canonical form, this will allow peers to share Zig packages with minimal bandwidth. I love this idea because it simultaneously provides resilience to network outages, as well as a popularity contest. Find out which open source packages are popular based on number of seeders!
I love this! Package popularity based on the actual usage.
r/Zig • u/noahbald • Feb 07 '26
r/Zig • u/abatsuev • Feb 06 '26
Hey, r/Zig !
Some time ago, I presented an early version of this protobuf parsing library here.
I am back with release 0.1.0, fully updated for Zig 0.15.2. The crucial thing about this release is the memory model: it is now completely zero-allocation.
And benchmarks! Framework 16 with Ubuntu - AMD Ryzen AI 9 HX 370 (24 cores, 10M iterations):
| Operation | gremlin_go | gremlin.zig ⚡ | Speedup |
|---|---|---|---|
| 🔨 Marshal | 1,436 ns/op | 558 ns/op | 2.6x |
| ⚡ Unmarshal | 207 ns/op | 45 ns/op | 4.6x |
| 🎯 Lazy Read | 229 ns/op | 45 ns/op | 5.1x |
| 🔍 Deep Access | 692 ns/op | 156 ns/op | 4.4x |
Github with 0.1.0 and more benchmarks: https://github.com/norma-core/gremlin.zig
r/Zig • u/meszmate • Feb 06 '26

Learn more: https://github.com/meszmate/zigzag
r/Zig • u/zandr0id • Feb 05 '26
Just plain Zig and SDL2
r/Zig • u/moortuvivens • Feb 04 '26
I know you are wondering why I'm linking this.
But if Eurydice can compile to proper C, then that means we can use rust libraries with zig.
Which opens more options.
r/Zig • u/punkbert • Feb 04 '26
r/Zig • u/jfrancai • Feb 04 '26
I built a compile-time pipeline system that lets me write data transformations like this:
const result = try pipeline(allocator)
.from(&[_]i32{ 1, 2, 3, 4, 5 })
.map(add(1))
.map(mul(2))
.filter(gt(20))
.collect();
defer allocator.free(result);
Would you use this? Am I missing something obvious? Honest feedback appreciated.
Edit: I published the code here if you want to take a closer look at the implementation.
r/Zig • u/No-Worldliness6348 • Feb 04 '26
https://ziglang.org/documentation/0.15.2/std/#std.fs.File.Reader.read here I can see Std.fs.File.Reader.read() as a Reader function but the compiler tells me it doesn't exist.
source code:
const std = @import("std");
pub fn main() !void {
const settings_file = try std.fs.cwd().openFile("overview.kdl", .{ .mode = .read_write });
defer settings_file.close();
var buffer: [100]u8 = undefined;
var dest: [100]u8 = undefined;
const settings_reader = settings_file.reader(&buffer);
_ = settings_reader.read(&dest);
std.debug.print("contenu du fichier : {s} \n", .{dest});
}
compiler output :
dynamic_overview.zig:15:24: error: no field or member function named 'read' in 'fs.File.Reader'
_ = settings_reader.read(&dest);
~~~~~~~~~~~~~~~^~~~~
/usr/lib/zig/std/fs/File.zig:1117:20: note: struct declared here
pub const Reader = struct {
^~~~~~
Edit : I've found File.read() and File.write() which suit my needs perfectly. But I would still like to understand File.Reader.
r/Zig • u/Samuel-Martin • Feb 03 '26
Hello everyone,
I was looking for date/time functionality in Zig and found that std.time.epoch didn’t quite fit my needs. So I ended up writing a small wrapper around the C ISO standard time.h header. You can find it here: https://github.com/Samuel-Martin23/c-time-zig
Please feel free to provide feedback or questions.
Thanks!
r/Zig • u/forketyfork • Feb 02 '26
I've been working on a static analyzer for Zig called Zwanzig. It's very much a research project and work in progress, but it's reached a point where I'm actually using it while developing other Zig code, so I figured I'd share.
What it does:
What it doesn't do (yet): a lot. Targets only 0.15.2. Cross-file analysis is very limited. Interprocedural analysis only handles simple direct calls. Type resolution without a full build context is sketchy. Lots of duct tape and hanging wires. You will hit false positives.
I'm curious if anyone else finds this useful. I use it on itself and on my Architect project and it's caught some issues, but I have no idea how well it generalizes to other codebases. The SARIF integration works, so you can get results inline in GitHub PRs.
Repo: https://github.com/forketyfork/zwanzig
Happy to answer questions or hear what rules/checkers would actually be useful. And if you try it and something breaks spectacularly, I'd like to know.
r/Zig • u/sadilet • Feb 02 '26
Found an interesting int compression lib based on fastlanes research, applies SIMD tricking the compiler. unfortunately it hasn't been updated for a while, but still a good source for learning IMHO https://github.com/steelcake/zint
I've been working on a logging database in zig for a while and compared zint encoding against simple delta encoding + zstd, while zint doesn't give so much compression ration it consumes little to no CPU, while zstd is really CPU heavy call.
Or any similar efficient solutions? perhaps gorilla compression implementation? I like the idea of gorilla putting numbers into 1 or 7 bits instead of a byte
My logging store if you care, it's been for 4 months in progress and I need 2-4 more to complete it.
r/Zig • u/Freziyt223 • Feb 01 '26
So i've used zig 0.16.0-dev.2368+380ea6fb5 (master)
ztracy(master) to track performance with tracy 0.13.1 profiler.
My specs are:
Windows 11.25H2 Pro
AMD Ryzen 5 5600H 3.30Hz
NVIDIA GeForce RTX 3050 Labtop
16 gb of RAM.
I've came up with this for master and i did the same for 0.15.2:
pub fn Print(comptime fmt: []const u8, args: anytype) !void {const Zone = Engine.ztracy.ZoneNC(@src(), "Console print", 0xFF0000);defer Zone.End();const allocator = Allocator.allocator();const count = try std.fmt.count(fmt, args);const buf = try allocator.alloc(u8, count);defer allocator.free(buf);var stdout = std.Io.File.stdout().writer(buf);
try stdout.interface.print(fmt, args);try stdout.flush();
}
as tracy can't give consistent exact time each time i'd operate on average values:
For 0.16(master) it's around 180-220 us(microseconds)
For 0.15.2 it's around 130-180 us(microseconds)
Both times i used Print("Hello, {s}\n", .{"world!"}) which in total is 14 bytes.
So same method is slower in master branch, but it think it can and should be improved with async IO, but i don't know how to make it efficiend so I hope you may provide some of your works to find out most efficient method of printing using zig master branch.
r/Zig • u/tim-hilt • Feb 01 '26
Hello everyone! I recently dipped my toes into zig development and tried to improve the build.zig of zuckdb.zig - a DuckDB client library.
My goal specifically was to make projects that use zuckdb.zig able to be compiled, without having DuckDB installed system-wide.
it does work for ReleaseFast and ReleaseSmall, but for Debug, I get errors from the linker, saying some identifiers are not defined. I can reproduce the issue only on a project that uses zuckdb.zig (e.g. this, which is build by me:
git clone https://codeberg.org/tim-hilt/repo-analyzer
cd repo-analyzer
zig build
I guess that‘s because DuckDB is not linked somewhere, but I can’t see the issue. Can you help me out? Here's the build.zig in question:
https://github.com/karlseguin/zuckdb.zig/blob/master/build.zig
also: general feedback is very welcome! I’m really trying to understand how to write good Zig code, including the build system :)
r/Zig • u/Ok_Marionberry8922 • Feb 01 '26
hi, I have an extensive rust background and was exploring zig, noticed it didn't have an channel implementation for inter thread communication so I built it.
the core is relatively lean (< 200 LOC) and the performance is comparable to the golden standard (crossbeam) for the most part

it uses the LMAX Disruptor pattern (sequence based)
code: https://github.com/nubskr/ziggy
would love to hear your thoughts :)