1000 Days of code: Zig Edition
It has been a minute, but I am back, I had my last post I believe in 2022, over the years things have happened, I have grown older but my love for programming is still there. This time round I embark on my most ambitious coding challenge yet: 1000 Days of Zig. Zig is a general-purpose programming language and build system that aims to be a better C. It provides low-level control, excellent C interoperability, and a focus on robustness and optimal performance.
Why Zig?
I always root for the underdog, in a world of rewrite everything in Rust I feel Zig can still thrive, besides Zig there are other interesting system programming languages that have come up over the last decade or so Nim, Odin, D, Carbon all aiming to replace C and C++, Rust has been he most successful among the crop of the new systems programming languages that have come up. Zig to me seems a little different, it is not all out to replace C but rather complement it:
- No hidden control flow - What you see is what you get
- No hidden memory allocations - Explicit allocator pattern
- First-class C interoperability - Import C headers directly
- Cross-compilation as a first-class feature
- Comptime - Powerful compile-time code execution
- A focus on robustness and maintainability
Goals for This Journey
Over the next 1000 days, I aim to:
- Master the Zig language - From basics to advanced concepts
- Build real-world projects - Practical applications and tools
- Understand systems programming deeply - Memory management, concurrency, low-level optimizations
- Contribute to the Zig ecosystem - Open source contributions
- Create useful libraries - Build reusable Zig packages and use Zig to supercharge my Ruby gems I will work on in future.
- Start a Zig user group in Kisumu - Do a zig day where I can get other zig enthusiasts to start hacking together on zig.
- Try to get Zig into Ruby - This is a long stretch but I aim to build something in Ruby language that can be made faster using Zig or possibly improve the existing C code in C ruby using Zig.
Deliverables
- Almost Daily blog posts documenting my learning journey
- A collection of Zig projects and experiments
- Open source contributions to Zig and its ecosystem
- Mastery of systems programming concepts
Extra Goals (Stretch Goals)
- Build a web server from scratch in Zig
- Create a programming language or interpreter in Zig
- Contribute to the Zig compiler itself
- Build a game or game engine component in Zig
- Present at a conference about Zig
This is going to be an incredible journey. Follow along as I dive deep into Zig and systems programming!
References
Comments