What Zig felt like, coming from Rust
For the past seven years, I've been a Rust developer, focusing primarily on open source projects. I've developed a solid grasp of the language and its ecosystem, gravitating towards the functional side with clean functions and expressive types. Recently, I've been curious about other languages, and Zig has been on my radar as a candidate C successor, offering lower-level, lighter-weight features.
My experience with Zig began with a project, leading to various observations that may seem naive or obvious to those familiar with Zig. I decided to reimplement JSONPath, a query language for JSON, in Zig, comparing it to the Rust version. One of the most surprising aspects was the near-total lack of IDE support in Zig compared to the extensive tools available for Rust.
This forced me to work more from the command line, ultimately leading me to a helix + alacritty + zellij setup. Zig's build system offers surprising ease, with build.zig handling configuration with surprising simplicity. I settled on a flat structure, with files and folders nested only when necessary, as Zig encourages a more compact, flat approach.
This contrasted sharply with my usual Rust practice of reaching for folder structures early in larger projects. When it came to testing, Zig offered similar options to Rust, but I found the flat structure and manual memory management in Zig led to different, albeit similar, challenges. Overall, the experience highlighted how project size and complexity can influence organizational decisions, regardless of the language used.
Written by urgent.news from Hacker News's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.