I think a simple solution would be to just write out a picture for every animation frame and then you could use ffmpeg to stitch those together into a gif.
I’m working on a controller for a custom PVD (Physical Vapor Deposition) setup do Thin Film Deposition processes in a lab
The zig part of the program is tasked with talking to the hardware, exposing an interface over SCPI and ensuring guarantees like interlocks, maximum running hours for each device, ect.
Zig really turned out to be the perfect solution for this task - python doesn’t have many hardware vendor libraries, and thanks to zig’s excellent C interop i can use battle tested libraries like libscpi or nanomodbus. Additionally thanks to the new IO interface it is trivial to write tests for the hardware communication (as it is abstracted over Io.File). io.concurrent and Io.Queue make splitting each piece of hardware code into its own task very easy, while tagged unions are great at expressing the FSMs that are at the core of each device. The program also does zero allocations after startup!
Currently working on implementing a board game in zig + godot. I originally had the backend built in rust with websockets and protobufs. However, I lost the plot and am simplifying the design. Unfortunately don’t have anything flashy to show yet. But here is a screenshot from the Godot client, no backend is hooked up, so players are not showing up on eachothers view.
I have been using Zig both at work (as a developer/meteorologist) and at home for some side projects!
At work, I wrote a binary format decoder for meteorological data. The BUFR format is heavily templated, and I was able to use Zig’s comptime and reflection to handle the decoding of template metadata in a neat way. I also used Zig to write a build-time step that reads the WMO BUFR tables and converts them to valid Zig code. At the time I wasn’t aware of ZON, so in the future I plan to migrate that direction.
For reference, most BUFR decoding libraries are still in FORTRAN. There is a pure python library, but naturally, it’s slow. I don’t have a public repo for it yet but I am using my Zig BUFR decoder to do client-side data decoding in the browser via WASM. It was a challenging but enlightening project.
For a side project, I’ve been working on building a WASM-freestanding interface to the zfp compression codec. The zfp algorithm/codec is designed for 1D-4D contiguous arrays from simulation data, and can operate in fixed-rate, fixed-precision, or fixed-accuracy modes. It’s really great for meteorological data because you can enforce a maximum error bound on a field, and since it compresses in spatial blocks, is really good at preserving gradients in the data.
Weaponizing my annoyance with NixOS’s laxness wrt duplicate packages × my tiny SSD to dig down and do my best to reduce the number of different versions of the same package being present in one’s system.
Currently working on an immediate TUI backed by termbox2. It was supposed to be a demo using termbox2, but I started to do more and more things and I decided to make it a now a library.
Progress is slow but I’m learning a lot about utf-8 code points, layouting, layers and how to design a good API and of course, zig! The main point is to be juicy to human eyes read and editing should be simple without losing extensibility.
off-topic to this thread, but the proposal of nix flakes is precisely that each one carries its own closure. they are not duplicates. the symbolic name is secondary to the hash. this wasn’t the case with nix channels and was one of the reasons flakes were invented.
Because I do work a lot with S3 object storage systems at my job, I’m working on a CLI client for the Zig S3 client library z3 for which I’m a co-maintainer.
Since the S3 API is rather complex and many API calls are not needed very often, for now, the CLI will cover only some basic functionalities which I use at a daily base. However, its still a lot of work because the CLI needs enhanced argument parsing due to the many parameters even a default S3 call needs. Nevertheless, its really fun designing and building such a complex CLI tool!
I use my custom CLI arg parser/lexer for processing the args. As always, parsing args is kind of boilerplate code, but its very straightforward and efficient.
Because I realy much fell in love with zig’s comptime, I decided to write a command line argument parser inspired by the clap crate in Rust.
You can define a struct and just let the parser populate it’s fields: