My current little Zig project is a decompiler/compiler for Haken EaganMatrix presets, which are natively well-formed Midi files. Most synthesizers use a proprietary binary format communicated through SysEx, so it’s a closed garden for most. The EM uses an unique elegant protocol which is encoded as normal MIDI messages and publicly documented, meaning it’s an open ecosystem.
The Haken EaganMatrix is the digital synthesizer engine in the Haken Continuum family of instruments, and the Expressiv E Osmose.
My compiler/decompiler will let you express EM presets in plain text, which carries all the benefits of text as a human-human and human-computer interface. Archivable, amenable to source code control, easy to interchange and discuss snippets, and incidentally amenable to AI use (although not the primary motivation).
I just finished rewriting stb_vorbis in zig, my main goal was to fix some issues and adding a few missing features that where required by my sound bank system. These were seeking was broken in edge case, multithreading decoding (of a single stream) and I finally made it a bit faster about ~1.65 times on avx2. The speed up was achieved mostly by rewriting the imdct function using zig @Vector.
which is a high-speed ethernet based industrial fieldbus. I recently acquired the parts for a demo / permanent CI setup that I’m maintaining with some surprisingly brief nixos configs:
(yes that is a powerline ethernet adapter, turns out sometimes a copper cable is easier than learning how to manage a secret like a wifi password)
Its used at my work with HMI etc and data collection with a mix of zig / python.
I also recently contributed to one of my dependencies, which is an easy to use CBOR library called ZBOR: https://codeberg.org/r4gus/zbor
Also working on building containers without the container runtimes with the zig build system (did you know that container images are just tar files?) https://codeberg.org/jeffective/oci
Trying to relive some childhood nostalgia and writing a MUD game engine (the zig part), a canon/world builder tool, and rich web client. This is a project I’ve started and stopped many times before, in various languages, and the zig version is by far the furthest I’ve taken it. 0.16.0 dropped at an opportune time as I shift my focus toward networking.
On the 0.16 side of thing, it was pretty straightforward to make it work for windows. Unfortunatly, I could not get emscripten working after the update: the closest I got, -lidbfs.js was not working.
In another dev thread, I should add better graphics and animations, but the request for mid-level savegame is much higher.
When I can find the time to work on it I am recreating and improving the MS-DOS musikus music training programs in zig using dvui (a really great gui lib). So far I only have the note name trainer, but much more is planned. Currently the sources are private on the universities gitlab, but I plan on releasing them on codeberg some day.
On and off working on a web app that combines the functionality of a few different music-related websites (last.fm, setlist.fm, albumoftheyear.org /RYM, and discogs.com to be specific). I keep finding myself curious about things like “how do my play counts compare to my album ratings”, “of my top 1000 played songs, which do I not own yet” or “what are the highest rated albums that I don’t own” and stuff like that. Eventually I would really really like to make all sorts of music-related Zig programs, like an API for MusicBrainz or a web interface for a local music file collection (just the two that come to mind that I know I’ve had in the back of my head)
I’ve started and restarted a bajillion times (got pretty far with Jetzig initially, took a long break because of school, tried again with httpz, took a break because of school again, and every time I look at it, I always think I could do better if I just restarted lol, so needless to say I don’t have much to show for it) but as the semester is coming to a close, I want to put more of my time into it again. It doesn’t help that I don’t really have any “proper” programming experience outside of my comp sci minor, and I get really caught up in the “how should things best be done” than actually doing. But I love thinking about it, Zig, and programming, so I don’t really mind the snail’s pace.
I also expect I’ll need to do some actual TypeScript programming to go along with it, and I have effectively no TS experience. To that point, I’m not particularly interested in learning it other than to accomplish the goals I have for the project, so once the groundwork for the other parts of the program have been laid out, I expect I’ll slow down again.
wg-forwarder, a tool that I wrote for myself that does seamless switching of the wireguard endpoints.
sortcp, a work in progress tool that was born from idea how to optimize disk fragmentation while copying/saving files. - Currently a project that is more than I can swallow at the moment so I’m taking it slower.
I’m overall new in the programming world and Zig is the first language I decided to really get to know and ended up loving it. I like the level of strictness, explicitness and simplicity. I have a general idea about the things I want to make but the lack of programming knowledge/experience is always pushing me to refactoring and optimizing the code. Should I use switch statements, lookup tables, how to properly sync threads etc. I’m using LLMs to learn and explain things for me which honestly I don’t like and at one point I’d like for people to look at my code and give me some directions at the end.
In case people are interested, I’m trying to optimize thread syncing with timer in the wg-forwarder tool if there is a better way than what I’m currently doing and if adding a management port for runtime data switching is a good idea.
For sortcp, I’m thinking how to optimize if possible my naturalLess() function that works the same for ASCII characters like JS’ ICU standard sort() does in the browsers. And I need to learn what would be FS optimizatios I need to do for BeeGFS, XFS, StorNext, BTRFS and BcacheFS. First step would be how to detect an underlying filesystem of the destination so I have a long way to go…
I’ve been working on a self hosted, open source media server, as in a replacement for Letterboxd for the cinema nerds, for AniList/MAL for the anime/manga nerds, Goodreads for the book nerds. Written in Zig of course.
It’s still very far out so I have refrained from talking about it too much as the database schema is still quite unstable and prone to data loss from “version” to “version”.
The plan is to eventually support a wide variety of metadata providers (currently only supports TMDB and MangaBaka (check them out!!)) and more media types, a flexible plugin system and I’d love to look into how to potentially support federation. I’ll make sure to post about it once I feel more comfortable with the state of it.
I forgot to add zig-diff project.
It was my first project that I started. Basic GNU diff functionality with some additional features. Cleaning commented and empty lines from diff, and basic file printing.
Trecker is a super simple time tracking tool for the command line. I use this every day at work for over a year now, but I’m the only user so there isn’t much documentation
It’s also a bit awkward in this forum because while it started in Zig, it’s actually an Odin project nowadays. In a recent double-twist, I re-implemented it almost completely in Zig again though because I was at a Windows computer without admin rights which rules out setting up Odin (because of Visual Studio stuff), but isn’t a problem for Zig. Since the project is moving very slowly, I might actually keep both versions up to date because who knows when I find myself in need of Zig again
I guess I didn’t talk about the interesting things about that project:
Parsing without associating property. Example user types “100-80g peanuts + 300-200ml mlik”, we have to do the attachment of “20” to “g peanuts”, then do the subtraction of 300-200 and then attach that to “ml milk”, so that attach operation has different speed when done from the left than from the right. Coming up with a system that does that in O(N) was trickier than I expected.
Needlessly fast fzf for food names, idea was the user types “a” then a list of foods pop up below that for fzf matches. I wanted to have deterministic answers, meaning that you always get the best answer first (what most fuzzy finders do is they scan entries and show you their best finds as they go, but I wanted to have the best finds show up first straight away). Currently it can do practically 0 latency on 10M entries with just 1 worker thread. That required a lot of SIMD that I would not be confident doing in C/C++.
An experiment that worked quite well, I used Sokol for graphics, but wrote my own GUI library, and a restriction I placed on it is that the entire layout of the tree must be comptime known. The result is that it doesn’t allocate any memory, ever (it uses a global buffer declared at comptime). and the entire tree is flattened at comptime, it also allowed it to use 1 draw call per shader. I wonder to what degree “comptime” libraries will pop up in zig as the language develops.
An enjoyable application of comptime: The way I did parsing and syntax highlighting, if it weren’t for comptime I would have to probably write each parsing function with 6 different versions, currently I have a setup where I write one “general” parsing function and then another function that takes in the general function and bakes it into all sorts of helper functions.
Feel free to @ me if anyone needs a more in depth explanation (especially if you are solving similiar problems) or code snippets.