Zig by Example
dariubs
217 points
99 comments
June 08, 2026
Related Discussions
Found 5 related stories in 98.5ms across 10,002 title embeddings via pgvector HNSW
- Zig Zen Update tosh · 121 pts · June 06, 2026 · 67% similar
- Getting Ziggy with It – Re: Factor birdculture · 12 pts · March 20, 2026 · 64% similar
- Functional programmers need to take a look at Zig xngbuilds · 54 pts · April 30, 2026 · 64% similar
- Ziggit: A Reimplementation of Git in Zig jedisct1 · 13 pts · April 02, 2026 · 64% similar
- Writing a C Compiler, in Zig (2025) tosh · 150 pts · April 23, 2026 · 62% similar
Discussion Highlights (19 comments)
shaftoe444
Examples target Zig 0.14. Been some significant changes since then, not least to printing and formatting (see writergate).
fallingmeat
lots of people into zig this morning apparently!
code-blooded
I just looked this up yesterday so sharing some more up-to-date resources for those interested in Zig: - Learning Zig by Karl Seguin: https://www.openmymind.net/learning_zig/ - https://zig.guide/ - Free project-based online book Introduction to Zig by Pedro Park: https://pedropark99.github.io/zig-book . - Ziglings, almost working programs you need to fix: https://codeberg.org/ziglings/exercises
fallingmeat
for those new, start with why: https://ziglang.org/learn/why_zig_rust_d_cpp
aselimov3
Is this much different than ziglings?
pezgrande
I like Zig but stopped learning it when I realized that all project based on it requires a specific version of the compiler to build.
noelwelsh
Very brief. I'm not sure what this adds over reading the language documentation (which itself is not great). As it's entirely organized by language features it doesn't really talk about any larger scale design decisions, which is where I think language proficiency is really found.
miroljub
Looking for a resource (MCP, CLI, Skill, ...) that would improve Zig support in LLMs. Currently, doing something with Zig as a target language would spend many more tokens and produce subpar results.
baalimago
I'm missing the concurrency model.
jdw64
Is Zig just a trend, or will it become a solidly established language? After all, learning something is an investment of time. With Zig, it doesn't seem to have the same kind of industry pressure as Rust. There's talk in open source circles about AI-related issues, and on Hacker News people say good things about Zig. The allocator concept looks great. But there's also a possibility that it won't become mainstream, like the D language. I personally like D and think its compiler is beautiful, but being linguistically good is different from being industrially adopted. So should I learn Zig, or wait a bit longer? For now, I have a basic grasp of C#, a little Python, a little C++, and a little TypeScript. I also know Java to some extent, but honestly, what I mostly build is CRUD app assembly. To go deeper, I think I need to dig into a systems language. But I'm not sure whether to invest in Zig or Rust.
stephc_int13
Encapsulating arguments inside .{} seems superfluous and noisy. I'm sure this can be rationalized in some way, to either simplify parsing or solve some rare ambiguity, but I just don't see it. I know this is a minor thing and can be considered as nitpicky, and I expect some friction with syntax when learning a new language, but I just can't stand things I see as gratuitous. Same with the forced use of _ = foo(.{}); to avoid compiling errors...
yrds96
This is outdated and AI generated. If you want a good source of zig learning material interactive and by examples please check out ziglings: https://codeberg.org/ziglings It's writen and tested by humans, which is essential for learning purposes. It's listed in the official zig website, by the way. This project is always up to date to the latest zig release.
b33j0r
Do not use this, I recommend ziglings if anything besides what Loris would say: you have to read code. The builtins don’t even compile in these examples. This is 2 years out of date at least.
tapirl
Having quick viewed all the chapters, the examples are too simplistic to fully demonstrate Zig's syntax and semantics.
porteghal
just read it fast and easy! for a starter like me? amazing!
atique29
My gut feelings had me check the Zig version. "Examples target Zig 0.14." Ah there we go
mustaphah
You would probably be better off reading learnxinyminutes.com/zig/
Thanemate
3 commits? Really? Why don't I just ask Claude or chatGPT instead?
synergy20
does zig still matter in the AI era? i was learning zig on and off and now have no motivation to learn it anymore.