What was the first functioning program you built with zig and when did you start?

Despite having worked on and with zig for a long time before the first program I built was zig-colors in 2021, a basic program that just printed ANSI Color escape sequences.

2 Likes

tried making a task-manager with tasks as nodes in a graph/canvas with multiple parents & children and tried making the GUI with sdl, gtk then raylib. repo deleted (a habit of mine) but I still want a task manager in a tree-like structure. (thanks for reminding me to rebuild it)

I started with Zigling and Andrew’s talks about Zig, I basically dreamed of using C in prod but Zig sounds more reasonable. ngl, now I’m not satisfied with any other language anymore, Odin might get a pass if I learn it since I suppose it might be easier for teams or something

2 Likes

Oracle SQL*Plus does not allow uploading files as BLOBs to the DB, but I needed such a functionality. I decided to to work with base64 chunks and a few lines of PL/SQL on the DB side and just needed a Client-Side tool to generate such chunks from a given file, with no runtime dependencies, and small size of the executable.

I had experimented with V before, but our AV software didn’t like the compiled executable, so I tried Zig, with the “help” of AI, which generated a mixture of Zig and Rust that didn’t compile, but I was able to fix it within 2 hrs or so, and thought to myself: not bad given that the language is absolutely new to me. The AV didn’t bother, the executable was small and just worked.

Later we decided to not use this solution for other reasons, and now I have also seen the AV complain about Zig-generated executables, but this is just due to the fact that the AV just doesn’t know the new executables, and gives false alarms. I also had that with MSVC generated executables…

Anyway, I decided to learn Zig and use it for hobby projects.

1 Like

writing a parser as one of the best things to learn a language is very based, i totally agree!

1 Like

Mine was a solution to Day 1 of Advent of Code 2023, back on Dec 1 2023 (of course).

My memory when writing that first program was that it felt like the compiler was fighting with me just to get anything done… how things change! Now whenever the compiler picks up something that’s not a typo, it’s often catching a bug that many a C compiler would have allowed (well, at least without -Wall).

5 Likes

I don’t even remember what my first working program was. I’ve cooked up so much zig since 2023 when I started. The earliest I can put my finger on was @mattnite 's synth workshop at SYCL 2023.

2 Likes

I learned Zig by following Crafting Interpreters and translating it from C to zig. My implementation is here.

I started using zig just as 0.10 was coming out. Thankfully I missed Allocgate.

1 Like

My first ever Zig program was an implementation of Conway’s game of life for my undergrad thesis!

I was working on an implementation for some time in rust, but I ended up getting really bogged down in designing an interface to represent the game, so I decided it’d probably be easiest to just start all over, and I have been eyeing Zig for a month or two at that point and decided to go with it, and since then I’ve been working almost exclusively in Zig for my personal projects.

It was also the first graphical program I ever wrote (raylib + raygui)!

4 Likes

To learn Zig, I followed the Writing a Compiler book, by Nora Sandler. Basically a small, working very incomplete C compiler .. so judging by the dates on those pages, May 2025?

The first piece of software I am actually using is 3sl. Which is a terminal based hexdump viewer.

2 Likes

I started writing zig last year when it was still 0.15.1 I believe, the first project I actually managed to finish (…sorta) was this CLI mini database program (kinda like a dumber, simpler SQLite).

I also tried to make a custom JS renderer but that did not go anywhere lol. I’m getting back into zig though after like 5 months of hiatus (work-related) and I plan on doing more of it because I really like the language!

1 Like

A friend of mine sent me a link to https://ziglearn.org/ in July 2020 and I started looking into it. In the beginning, I started several course-like things (Advent of Code, Handmade Hero, Write Yourself a Git), but the first actual program that I remember building was about a year later: a singleplayer command line version of the German card game Doppelkopf.

1 Like

After many attempts, my first functioning program, it is the implementation of the LZSS algorithm for data compression. I found a older Zig implementation and I used as a base and enhanced it with some improvements. The goal was and still is to use the topic I like (data compression) to learn the language.
The community on the telegram channel Telegram: View @ziglang_en is a great help when I struggle with the syntax.

1 Like

First stumbled upon zig when I started digging more into using thi.ng/umbrella for creative coding, about 3 years ago. Was keen to learn more about WebAssembly at that time in a hope for a more performant language — that I could also use to build native programs without the need for a JavaScript/TypeScript runtime. I dis some experiments with Rust (a game of life implementation) before but after all ended up using thi.ng/wasm-api in combination with zig.

The first functional zig program for me therefore was an edge of chaos implementation with thi.ng/wasm-api.

1 Like

It’s at https://codeberg.org/loup-os (kernel is in https://codeberg.org/loup-os/kernel).
Also, a very old x86_64 part is there for people that want a bootloader that can load the “hello world” kernel: https://codeberg.org/sfiedler/zig_os (I know, terrible naming).
Do you have your vim like modal text editor somewhere? I’d love to try it!

1 Like

I’m not sure it was either a port of one of my school project which was a graphic project where you needed to implement a Cpu wireframe representation in 3d. Or a multithreaded lock-step multiplayer netcode both were trash by the way but very interesting to do.

1 Like

I’m not user if there was some other small experiments before hand, but I think GitHub - ibd1279/zigdnsguide: Implementing a DNS server as a Zig tutorial. · GitHub, based on EmilHernvall’s DNS server in rust was my first. I was comparing rust and zig at the time.

I think my follow up was the abandoned lazy tier streaming library that I did to explore comptime.

1 Like

luckily enough my first zig program is the current one, a logging database Ochi:

1 Like

parser, compiler, text editor for sure

don’t have to explain wanting x86 compatibility to me my friend, i want my tools to work even on anything.

also 100% should be able to find hako edit on my github (profile is linked at the top for the zig project)

1 Like

love everyone sharing what they started with, been busy the past week or so and going to try and reply to as many of these as i can.