Potato Blog


How To Learn Zig

Here are some resources I’ve found to be useful in my journey.

  • Official Documentation: The primary resource I keep open while learning zig is the official documentation. It’s not best used alone, but as a reference. Patterns arise over time and we as individuals conflate language principles and become opinionated about how things should be used. The official documentation can serve as a good source to realign the core principles and help keep things simple.
  • Introduction To Zig: Zig, being a relatively new language, doesn’t have an official book, since the language is expected to change quite a bit before it’s 1.0 stable release. Syntax-wise, however, most of the language is expected to stay the way it is today. This makes it okay for developing a tool or a product, but difficult to release a book (especially in paper form) this soon. This book stands out above the rest, is actively maintained, open source, and freely available to read online.
  • Ziglings: Some people learn better by getting hands on, through trial-and-error. Changing things around in code, learning why things break and fixing the problems. I find this approach useful and highly recommend Ziglings if you’re that person. Ziglings teaches zig starting from novice concepts to advanced. It strictly stays within the realm of helping the user learn zig (not programming in general) via a series of small programs you’ll have to fix. Each program is quite entertaining and I loved going through them all.
  • Dude the Builder: If watching a video or simulating a bootcamp is your thing, Dude the Builder is your guy. He has a Zig Master series on YouTube that walks you through zig. He starts from installation through advanced concepts and explains things in a way that is easy to understand. He’s an incredible resource.
  • Ziggit.dev: An open, community-driven forum for Zig. There are lots of active users here and many topics to peruse. If you have questions, beginner or expert, there’s someone here that can help. Or you can learn by osmosis reading posts and learning from others.
  • Openmymind.net: Finally, the most useful resource to me personally is this series by Karl Seguin. His blog is a treasure trove of zig learning material, but as a starting point, I found his Learning Zig series to be a great starting point to learning about zig and how to develop with it.

Languages are tools, use the one best for the job, no one size fits all, not everything is a nail.

What makes zig a good language?

  • Cross platform compilation support
  • C interoperability
  • Fine control of memory allocations

Zig’s C interoperability makes it easy to import libraries like glibc to interact with operating systems at a low level. Combine this with it’s cross-platform compilation ability and it makes for some fun times.

I hope you find this useful.