<aside> 💡 In the long dark of Winter 2024, I went down a programming rabbit hole. It wasn’t at optimal mental health, I don’t think this particularly helped, but I learned a lot.

This is the story of one programmer Quietly Going Insane With Tools & Automation:

Quietly Going Insane With Tools & Automation

Strings, Actually, Do Not Exist

Suffering: The First Two Weeks Of Zig

</aside>

I’ve been lied to my entire career.

Strings, actually, do not exist.

I thought they existed.

Half the job is coercing json into strings ‘n back to jank the desired result.

I was wrong.

Arbitrary Slices of Bytes

Naturally, in Zig, “Strings” are just arrays of integers.

// This resolves to `comptime int`?
const foo = "bar";

https://media0.giphy.com/media/l0IypeKl9NJhPFMrK/giphy.gif?cid=7941fdc6zamg84ed9w1x6k2a3sdefegucfuurxyaokdau6e0&ep=v1_gifs_search&rid=giphy.gif&ct=g

There is no God.

There are no Strings.

We're all just arbitrary slices of null terminated bytes.