It's been over a year since I switched to Zig to build all my side/curiosity projects. Surprisingly, switching to a lower-level language has consistently improved the quality of my projects and my love for programming. I find myself being able to get braver and approach programs I never thought I'd be able to build. In the last year, I've been able to build the following:
The projects are in order. My favorite one so far is the one I'm currently doing, but the display driver is a close second. It was a lot of fun working with a datasheet on the Raspberry Pi Pico.
Memory does not have to be complicated
By far, my biggest fear was working with memory—turns out it does not need to be that complicated. There is a simple guide on choosing an allocator based on your needs in the documentation. I find myself reading this whenever I'm not sure what to do with memory. It has been super useful. In the last two projects, the allocations all happen once initially using the Arena Allocator. It gives you a bunch of memory ahead of time which you clear once your program has executed. The handmade hero approach is quite awesome too: just get a whole lot of memory ahead of time (4GB and some more), then just work with this memory.
I'm looking forward to another year of writing Zig. It's most definitely making me a better programmer by helping me get a deeper understanding of concepts I've taken for granted before (like interfaces). I've been able to implement things from scratch, and I do have to say it is a lot of fun. I'd highly recommend it.
Anything I did not like?
The way you cast types in Zig is a bit tedious, if I'm honest. Not sure why it needed to be this way, but at the same time, it's not the end of the world. I'm really digging for something I dislike here. I'm also quite early to the language, so I'm guessing I will be coming across more.
My favorite part?
I'll pick one favorite by far: it's the ease of linking system C libraries into my project. This was especially useful when working with the X11 and PulseAudio libraries as I currently go through handmade hero.