Skill Issue logo

Skill Issue

Subscribe
Archives
February 14, 2025

Zig-zagging

Hey folks. Sorry I missed last week. I was completely knocked out by a brutal flu that's been going around. I lost 8lbs and my lungs still aren't fully cleared. No fun.

I've decided not to do the 7DRL Challenge in Nim. Nothing against Nim, but I just don't have the time this month to get up to speed on it. It's a somewhat esoteric language and I'm already pretty comfortable with game development in C.

Instead, I've been throwing together a skeleton for the game using SDL and Flecs. One important piece that I needed to sort out was cross-compilation. Compiling a game to run on my computer is no problem, but I need to be able to provide builds for macOS, Windows, and Linux that run standalone.

To solve that, I started looking at the Zig toolchain. While Zig is a language itself, it ships with an excellent (and very strict) C compiler. This allows projects written in both Zig and C to take advantage of its excellent cross-compilation story.

By using a port of SDL3 to the Zig toolchain, I'm able to build executables for macOS, Windows and Linux from my MacBook simply by specifying the target architecture. No complex cross-compilation setup required. The Zig toolchain does all the heavy lifting for me.

Over the last week I've written a bunch of Zig to see if I think I could write my 7DRL in it. I've not hit any hurdles. It was easy to call out to the SDL3 C API from Zig and get something basic working. There are bindings for Flecs that seem well-maintained.

Over the next couple of weeks I'll continue working on my scaffold project. I may still fall back to C if I run into any hurdles or challenges. I don't want to spend too much time learning (or fighting) the language given my time constraints. That said, as someone with some C experience, I've found it a breeze to get up to speed on. I'm optimistic.


Somehow I missed that Chelsea Wolfe dropped a new album last year. Since my music recommendations have been somewhat extreme lately, I'll give you something much more melodic this week: Everything Turns Blue. It's still spooky, though.

Don't miss what's next. Subscribe to Skill Issue:
GitHub Bluesky X LinkedIn
Powered by Buttondown, the easiest way to start and grow your newsletter.