Working with arrays and slices in Zig 0.17.0, passing them to functions, nesting them, and using std.ArrayList when you don’t know the size up front.
How std.Io works in Zig, getting an io value, reading the clock, and using async, concurrent, and cancel.
Making HTTP requests in Zig 0.16.0 with client.fetch(), sending headers and a JSON body, and building a reusable client for GET, POST, PUT and DELETE.
How to write to a file in Zig 0.16.0 with the new Io interface, using a stack buffer or an allocator, and why you need to call flush() at the end.
How to read a file in Zig 0.16.0 with the new Io interface, in fixed-size chunks with a stack buffer, the whole file with an allocator, and line by line.
My thoughts and ramblings on coding with AI, why the joy of solving problems is fading for me and what the future might hold for software engineers.
How I use AI when I code, at work and on personal projects, and why I still turn it off from time to time.
Making GET, POST, PUT and DELETE requests in Zig 0.15.2 with client.fetch() from std.http, and why I wrapped it in something reusable.
Serializing and deserializing JSON in Zig with std.json, how the Parsed wrapper handles memory, and what breaks when your JSON doesn’t match your struct.
Different ways to read a file in Zig 0.15.2, in chunks with a stack buffer, all at once with an allocator, byte by byte and line by line.
Writing to a file in Zig 0.15.2 using a buffer on the stack or the heap, getting a writer interface and writing bytes to the file.
Zig 0.16.0 deleted os.argv and os.environ, so now main can take std.process.Init or Init.Minimal to get command line arguments and environment variables.