What are you working on in Zig?

A game (with custom game engine). Here is short write-up on the progress: Devlog #0
I also plan to implement https://craftinginterpreters.com/ in Zig for the virtual machine interpreter. But that’s less of a toy project and more to learn about building programming languages with the goal of improving Zig.

Things I appreciate with Zig:

  • simplicity
  • less choice paralysis (there is not many ways to implement something)
  • explicit allocators

Things I appreciate less:

  • explicit allocators (it’s uncomfortable because I’m not used to, but it’s great to really think about memory and when you allocate stuff)
  • documentation
3 Likes

My first trick was DOOM fire in zig as a proof-of-concept for a 3D ascii isometric rogue-like. Sadly, frame rate isn’t there in OSX terminal. Now mulling over SDL…trying to figure out if isometric-2d is worth the energy, or is it easier to wait until the Mach Engine is a bit further along!

2 Likes

Terminal.app is notoriously bad. Have you tried Kitty?

1 Like

Actually, yes! Ty for the recommend.

Kitty and the stock VS Code terminal both worked great (90+ fps). iTerm was ok (30+ fps). However, I was hoping for something that didn’t require a special install to use.

At some point, OSX Terminal appears to blocking on write, which slows down the FPS. However, it also is writing asynchronously, which causes it to drop / tear frames. Buffer size didn’t appear to make a difference.

There is likely some sort of secret-decoder ring ANSI sequence that would get it to bit-blast large sequences but a tix to APPL has sat idle!

3 Likes

Hi! In Zig I’m currently working on… Zig. I made some small contributions to the C backend and I intend to do more in the future, at least as soon as Real Life™ leaves me enough time/headspace to contribute.

I also started a bunch of personal, unreleased projects like a reimplementation of a subset of POSIX utilities, and I have a toy language project in its early stages which is mostly intended as a way to teach myself about building compilers from the ground up.

10 Likes

A game with a custom “game engine” with some of the data layout inspired by mach engine (the AECS article) and written in a somewhat literate programming style.

This is something I’ve attempted quite a few times in scheme, c, haskell, idris, &c but didn’t get as far as I’d hoped. Will see how it goes with zig.

6 Likes

Hello!

I have been writing mostly numerical code focused on signal process algorithms.

Recently implemented about 25 FFT algorithms (Stockham, Split-radix and friends) variants for benchmarking. (The clap arguments parser - thanks Hejsil! - has been critical, allowing the use of bash scripts to run the various benchmarkings.)

Also, piping to gnuplot with some rather nice (my opinion) wrappers that make visualization of the data simple to do.

Using both desktop computer as well as a Raspberry Pi, both running Devuan Linux.

Devuan is a favorite! Basically Debian WITHOUT SYSTEMD! Lovely!

6 Likes

I’m doing something probably unique! I’m building a small seed-starting greenhouse which is automated with an STM32 microcontroller which is programmed with zig. Right now I have the physical greenhouse built, and the microcontroller is reading the temperature and turning on a heat lamp to keep the temperature above freezing. I have lots of additional ideas and am working on them!

19 Likes

I’m working on my game in zig and sfml)
https://github.com/TwisteRTanks/TwisteRTanks

3 Likes

Currently working on a pure-zig library to create Terminal User Interface. Repo is currently private but soon i will release v0.1.0 :smiley:

5 Likes

Just some very simple programs here ~cgenie/zig - Various small zig projects - sourcehut git (hello world, SDL2 integration).

1 Like

Hello, I’ve been on ZIG for 3 weeks, and I took as a subject to redo type->ncurses , I don’t leave empty and I’m inspired by what I found on github,
I do a lot of testing to understand the mechanisms of ZIG, and I read a lot of code on the ZIG repository, the documentation is nice, but not for a non-beginner, I’m not on my first try, I’m retirement and I am having fun with this new language…

the project is alive and evolving it is in phase 2 what I write what I see

2 Likes

I have been working on and off on a Zig binding to vcflib, a C++ toolset for bioinformatics: vcflib/src/zig/vcf.zig at master · vcflib/vcflib · GitHub. Not very exciting, but the experience has been rather pleasant overall. Coming from C++ and D, Zig ticks a few boxes for me :slight_smile:. I’ll be writing more Zig code for sure. Currently preparing a FOSDEM talk Zig and Guile for fast code and a REPL. Which is a bit trickier than I thought…

2 Likes

I’ve been learning Linux’s KMS, DRM, GBM systems and interfaces by porting part of kmscube manually to Zig. I have a basic OpenGL ES 2.0 rendering context and display flips for it. Next is creating a basic music synthesizer and then a rendering pipeline and then some visual effects. My goal is to release a 64kB intro for a low-power Linux SBC called Quartz64. Currently my executable with background color display is under 7kB so Zig is definitely serving me better here than Rust would.

2 Likes

I am currently working on zerve, a simple framework for writing web services.

Now I am working to add a Cookie struct to enease cookie handling.

2 Likes

wow, its very interesting for me. I work with time-freqency analysis, theory of waves and DSP. Are your developments posted in any open repository?

1 Like

I already posted a topic on this, but it wouldn’t hurt to post it here!

I’m working on a general tensor library that supports tensors from rank 1 to 63. I’m working on it quite regularly and I am looking for contributors! The goal is to have it working with CUDA/OpenCL by version 2!

If this is something that interests you, then please check out my repo! I’d be interested in talking to you!

1 Like

Hi! I’m working on a Lua scripting environment with musical applications in mind. I’m calling it seamstress. It speaks OSC and MIDI, talks to monome devices, can run Lua coroutines based on a clock, and has a little screen you can draw to. I just recently was able to delete the macOS-specific code around detecting USB devices, so it should run on Linux too. The design is heavily inspired by monome’s norns device, specifically matron which embeds Lua in C and is tightly coupled with a light sprinkling of custom SuperCollider plumbing.

This is my first project in Zig. It began in C, but I ended up feeling pretty daunted by some bugs that heavily impacted stability. A friend suggested Zig, and after discovering @natecraddock’s Ziglua project it felt easier and more exciting to rewrite in Zig rather than try to debug C. As it happens, I’ve needed to learn how to use a debugger after all, but now I do feel like I’m getting the hang of the language.

6 Likes

Hello, there :wave:

I’m not ready to share the code publicly yet. However, I have been reverse engineering the 1996 MSDOS game Fatal Racing (Whiplash in the US). All written in Zig with some C code for libraries. Right now it can deobfuscate the asset files which use a bespoke RLE type algorithm. I converted the MIDI files to WAV using WildMIDI, and combined the VGA palettes and bitmap data saved to PNG using raylib.

I would love to eventually get the game running on the Steam Deck or the Switch.

9 Likes