Posts in explainer
Make Concepts
- 13 April 2024
There are many resources out there for how to use make and some of them are very good. However, they mostly focus on details of syntax and how to spell the different text manipulation functions. This document is not that. This document is about why Make is the way it is, and how to help it do its job.
Memory Management With Zig
- 01 December 2023
This post is aimed at people who come from languages with automatic garbage collection and want to get a sense for how to approach memory management in a lower level language. I’ll be using Zig (and a bit of Python) to demonstrate, but the concepts apply to C and other languages where you have to care if your data is going on the stack or the heap.
Pointers in Zig
- 18 December 2020
This post is going to explain how pointers, arrays, and slices work in Zig, without depending on knowledge of other languages that use pointers. If you’re trying to learn Zig and your only programming experience is in a language with managed memory, this is for you. If you’re struggling to understand pointers in C, this might help. If you’re coming from C or C++ and just want to know the differences, you might be better off reading the official documentation for arrays, slices, and pointers. zig.guide is another good resource.
Extending C with Zig
- 18 December 2020
This guide was last updated in March of 2024 with an 0.12.0-dev build. Zig is a moving target, and stuff written about it may fall out of date. If you find something broken about this, feel free to let me know.
Interfaces, or: Runtime Polymorphism in Zig
- 26 June 2020
Update: April 2024 - A lot has happened since I originally wrote this article. I may still update it in to cover the current state of things, but Killian Vounckx wrote an update in February of 2022 and Issue 130 has been closed. I’m not porting the original version of this article to the Sphinx site, so if you want to read it, you can find it here.
Wrapping a C Library with Zig
- 13 June 2020
This post is going to look at wrapping a C library in Zig. The library to wrap will be libsodium, a “modern, easy-to-use software library for encryption, decryption, signatures, password hashing and more.”