Demo thread! Share screenshots, videos, sound clips, asciinema recordings, link a blog post you made, or just explain what hobby project you’ve been working on lately. Ambitious, well-scoped, or anywhere in between, your efforts are welcome in this thread.
The original is by far my favorite thread on all of ziggit:
However I think it will be nice to make a new thread at the beginning of every month, because it gives people who already posted before to share updates, however small, and it encourages new people to join in for the first time.
I think that’s a very good idea to make a new thread at the beginning of every month!
I’m currently not doing that much stuff in Zig (at some point I’ll have to continue my OS programming though), but currently I’m building a (more or less) collaborative Forth for the web with a friend of mine.
The front-end has the Forth interpreter (of course I wrote everything in Vanilla JS) and submits the user input to the back-end (the back-end is written by my friend). Then, the front-end continuously asks the back-end for new input (from different clients). That way, all collaborators should get the input in the same order, and the client-side interpreter behaves the same on all clients.
It’s not ready to be shared yet, but we plan to make it public once the (client side) interpreter can do all Forth 2012 Core words and once my friend made sure the back-end is reasonably secure.
Also, the cool stuff about those crazy ideas is that it wouldn’t be fun to use LLMs for implementing them (and they are a nightmare, ethically); so I’m just spending evenings with implementing one or another word for the Forth 2012 Core spec/glossary and having fun.
I just released preuve.h is a simple and ergonomic unit tests framework.
While this project is in C11, it has been greatly influenced by the Zig project.
Other than that, I have a “research project” to better understand Zig’s concurrency and IO interface. If any of you have reading recommendations about concurrent programming, wait-free/non-blocking synchronization primitives and non-blocking IO, feel free to send them my way!
Posted this update on the previous thread a couple days ago, will repost here with some more info.
Project is a keyboard based cross platform calorie tracker in zig using Sokol I am staking my life on.
Currently, it’s actually functional and I love using it every day personally.
The Idea is you log what you ate with 100% accuracy in seconds if you try to go fast.
The GUI needs a lot of work, which is what I am focusing on now, but you can see a lot of the features working! (The over-engineered fuzzy finder which I could talk all day about, the syntax highlighting and error messages etc)
The font rendering on this demo is purely MTSDF, however I couldn’t make it look as good as I wanted for small font sizes.
I also didn’t want to take another dependency to do rasterization of .ttf files at runtime. Current builds have 7 bitmaps (8, 12, 16, 20, 24, 28, 32) and use bitmap font rendering for those font sizes, and MTSDF for the ones higher.
I Also need to find a corner to put my macsot (The dinosaur in my profile pic). I also need to give him a moustache, a hat and a spatula.
Supported platforms are Linux, Windows, Mac and WASM. The WASM version will be embedded in the website that will do the sales pitch.
If you go to any other calorie tracker, you have to accept cookies, answer a personality quiz, get an interview, make an account, maybe even give your credit card before you see how it looks.
With the WASM demo people can try it on the website and decide if they like it.
Data is saved on human-readable .txt files and I will at some point provide a library that parses it if people want to write their own stuff to work on those files, everything works offline.
I have been working on a suite of audio decoder libraries written from scratch in pure Zig and no reliance on C libraries, that will eventually be part of a larger project to bring them together under a single interface. The end goal is a library where you can just throw any common audio file at it, and read PCM samples of your preferred data type out without having to even think about the source format or encoding. Essentially libsndfile, but decoding capabilities only, and zero dependencies that weren’t built in-house.
Thus far, I have implemented FLAC, QOA, and WAV/AIFF (raw PCM, alaw, mulaw, MS-ADPCM, IMA-ADPCM, etc). My design goal is that each part of it as modular as possible, and can be used as a standalone and reusable component. For example, the IFF/RIFF container format is its own project, so can be used for both WAV, but also for SoundFont2 files when I eventually get to MIDI. The same goes for ID3 metadata, Ogg container, etc.
It is still in its early stages, but has been my labor of love for the past few weeks.
I started learning zig last month and I try to write a game as my first project using zig together with raylib and flecs.
Currently I’m trying to do map generation. I have a noise based map generator with varying temperatures. Everything is rendered by a custom tile map shader.
The map can be rendered in different resolutions.
This is a 262144 x 262144 tile map rendered on just 4 textures.
Sorry. I had to remove this image because I only can put one image in the post
And here it is zoomed in: Sorry. I had to remove this image because I only can put one image in the post
And this is the finest resolution. This represents 4096 x 4096 tiles rendered on 16 textures (less than 0.02% of the total map)
I have used a lot of languages. I have the most experience with java and go. Two years of experience with rust.
I had lot of fun so far writing code with zig. It reminds me of the time when I started programming with c, but without the big pain points.
The thing I really enjoy the most when working with zig is that I always know whether something is on the stack or on the heap.
I also like the leak detection with the allocator that is used in debug mode and in tests.
My goals for the next month or two is to improve the map generation, maybe place trees.
And create a better texture for the tiles!
And after that I want to add resources and buildings that harvest the resources.
Started with coding a “tuner” - calibrating about 100.000 heuristic values - to hopefully produce the next big boost for my chess engine. Have to dive into the math behind it now.
I’ve been working on a mandelbrot set renderer (yes very original), with a focus on deep zooms (beyond f64 precision) and responsive exploration. It renders on the GPU using vulkan, uses glfw for windowing, dear imgui for gui, gmp for reference calculation (high precision orbit to use for deep zooms via perturbation theory), and glslang for shader compilation.
The biggest accomplishment so far for me has been foviated rendering around the cursor, where the mandelbrot set is rendered in low detail at first and then in increasing detail starting around the cursor. The already rendered parts of the image are also preserved (and not recalculated) when moving around / zooming, so the max iteration bailout can be increased quite high before becoming laggy (~16,000 iterations on my laptop).
I’m currently working on improving the gui and adding more hot-switching of various parameters for a better testing/user experience.
I’m working on a embedded systems programming framework with std.Io implementation for async stuff. Kind of what Embassy is for Rust.
I’ve been working on it for ~1 month now. It isn’t ready for use yet (you can blink some LEDs in some boards though) and I’m aiming for supporting STM32s first (Arm Cortex-M).
So far I’m enjoying it very much. Specially learning Zig and Zig’s compiler more in depth and the std.Io interface looks neat at the moment.