Top
Best
New

Posted by dariubs 6 hours ago

Zig by Example(github.com)
186 points | 90 commentspage 2
mustaphah 2 hours ago|
You would probably be better off reading learnxinyminutes.com/zig/
atique29 3 hours ago||
My gut feelings had me check the Zig version. "Examples target Zig 0.14." Ah there we go
noelwelsh 5 hours ago||
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.
fallingmeat 6 hours ago||
lots of people into zig this morning apparently!
dominotw 5 hours ago|
I am really looking into zig now because founder seems like a cool dude.
aselimov3 5 hours ago||
Is this much different than ziglings?
voidUpdate 4 hours ago|
This is essentially just a textbook of zig examples. Ziglings is an interactive exercise
baalimago 5 hours ago||
I'm missing the concurrency model.
Zambyte 4 hours ago||
For what it's worth, the concurrency model is very similar to the one in Go. Zig has std.Io.Queue instead of channels, std.Io.async and std.Io.concurrent instead of the go keyword, and switch over std.Io.Select instead of the select keyword. There are lots of resources on concurrency in Go, and the learning semantics would carry nicely over to Zig.
porteghal 3 hours ago||
just read it fast and easy! for a starter like me? amazing!
Thanemate 2 hours ago||
3 commits? Really? Why don't I just ask Claude or chatGPT instead?
miroljub 5 hours ago|
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.

anonfunction 4 hours ago||
One of the preeminent Zig software projects, Tigerbeetle[1], has a great website[2] and markdown file[3] for what they call TigerStyle.

It's honestly a great read as a human but also I packaged it as a skill and saw coding agent improvement, especially around memory usage.

1. https://tigerbeetle.com/

2. https://tigerstyle.dev/

3. https://github.com/tigerbeetle/tigerbeetle/blob/main/docs/TI...

voidUpdate 4 hours ago|||
If you worked through this and learnt to use zig, your token usage would be even lower!
short_sells_poo 4 hours ago|||
Don't be ridiculous. Learning? That's for the dinosaurs. Just throw an llm at the problem!
all2 4 hours ago||
Both is good. I do both, and to get reasonable output from an LLM I _have_ to do both.
miroljub 4 hours ago|||
What's wrong with learning by reviewing the LLM generated code and asking questions interactively? Works for other languages.
all2 4 hours ago|||
Best bet is tight integration with a language server and the zig docs as MD locally. You may also pull in the zig source code as canonical reference for best practices.

From there you can derive a set of tools and references that you can build skills on.

Any LLM can scratch together an MCP server, its basically FastAPI + functionality. Your goal, then, is to identify the subset of tools and data required to get 'good' output.

If you want to test your MCP server implementation, grab the source of several popular zig projects, rewind their git history, and have your LLM of choice attempt to address PRs for issues on those repos. Compare LLM solutions with the repo solutions, grade on token spend, LOC produced, variance from Zig best practices, and so on.

brodo 4 hours ago||
Wrapping this [1] in a skill will help a lot: Also add this [2] and `zig fmt` to your buid.zig.

[1]: https://github.com/rockorager/zigdoc [2]: https://github.com/rockorager/ziglint