One day with Zig, Raylib, and jj

submited by
Style Pass
2025-01-01 08:30:04

A couple days ago, I was telling my younger brother how cool Zig (the programming language) was. He was like, “if Zig is so cool, why don’t you … like, use it?” Oof. So I installed Zig, pulled in some neat bindings for raylib, and spent the afternoon writing a little interactive scrabble board demo to make sure that I understood what I was talking about (while he worked on some music for it, which I haven’t yet included):

So that I can stop worrying about this project and lay it to rest, I decided to write a little blog post. The above demo doesn’t really work on mobile, and it may be broken (Wasm, JS, about 1MB in size, etc.), so here’s a screenshot:

Anyway, the code will be is now up on GitHub, it’s like ~500 lines and has like one dependency (raylib-zig) so it shouldn’t be too hard to get the native build working if you’d like to follow along then. The web build is a little hacky and left as an exercise to the reader.

I have been eyeballing Zig for a while. I think I first heard of the language via a talk Andrew Kelly gave at the recurse center … ah yep here it is: Software Should Be Perfect. 6 years ago, wow.

Leave a Comment