Zig

Using libsndfile in Zig

24 Jan 2025

Continuing on my journey learning Zig and audio programming, and also making a good follow-up to the time I wrote Zig to manually generate a WAVE file, today I decided to generate a WAVE file using libsndfile.

Continue reading →

Parsing command-line args in Zig using only stdlib

24 Dec 2024

In my Zig learning journey, for some problems I have found the standard library documentation a bit too curt. Some solutions to common problems are documented in other non-official sources.

Continue reading →

Debugging Zig: with lldb and inside Neovim

10 Aug 2024

Today I learned how to use a debugger to debug Zig programs.

The lldb way (gdb style)

First, I learned how to use lldb, the debugger provided by the LLVM project.

Continue reading →

Generate WAVE file in Zig, choosing the bit depth

04 Aug 2024

In the last post, I told you how I learned the basics of generating a WAVE file, both in Python and Zig.

Continue reading →

How to create a WAVE file

29 Jul 2024

Today I set out to learn how to create a WAVE file.

I had recently gone through an article about reading and writing wave files in Python, which whet my appetite to do somewhat the same in Zig.

Continue reading →

Zig exercise: using std types to implement a basic shell calculator

21 Jul 2024

Today I decided to get some practice using Zig’s data structures from the standard library, building an old friend: a bc style calculator, implementing the algorithms to evaluate reverse Polish notation expressions and converting from infix to that notation.

Continue reading →

Simple stdin/stdout text processing with Zig

20 Jul 2024

In my Zig learning journey, I’ve managed to not use allocators for anything yet.

I’ve watched this great video of Dude The Builder explaining the basics of allocators in Zig. Side note: I am finding the videos from this Youtube channel really great, indispensable to understand how to use the stuff from the standard library.

Continue reading →

About Zig structs and using @ptrCast for getting Zig data in C callbacks

16 Jun 2024

In the previous post, I went about my experiments with Zig and the FluidSynth Sequencer API.

I wasn’t fully happy with my Zig code, because I was resorting to global variables and didn’t quite know how to organize it.

Continue reading →

The basics of the FluidSynth Sequencer API

15 Jun 2024

Today I learned the basics of the FluidSynth Sequencer API. It is not super complicated, but it took me some time to understand the concepts, as not everything is explained in great detail. As often is the case when learning a new API, the best way to learn it is to read through the code of the provided examples, and check the API reference docs as needed.

Continue reading →

How to call fluidsynth C API from Zig

05 Nov 2023

I find quite cool how quickly you can start using a C library from Zig! No need to write bindings or to fiddle with a FFI, it provides direct integration with C libraries.

Continue reading →