The author, who has spent seven years working as a Rust developer on open‑source projects, describes reimplementing a JSONPath library (RFC 9535) in Zig after previously building it in Rust. According to the post, the goal was to bring the same functionality to Zig under the name zig‑jsonpath, using the existing Rust crate jsonpath‑rust as a reference. The author notes that the experience with Zig began with this project, so some observations may appear naive to seasoned Zig users and were shaped by habits carried over from Rust. Regarding IDE support, the author says the near‑total lack of advanced features beyond syntax highlighting and basic autocompletion was surprising but ultimately useful, pushing a return to command‑line work. The build system, handled by build.zig, allowed commands such as zig build test and zig build compliance to run tests and suites, which the author found refreshing after accepting the terms. This experience prompted a broader shift to a helix + alacritty + zellij setup. On project layout, the author observes that Rust encourages a deep folder hierarchy, whereas Zig “nudges you toward flat.” In the Zig version of the library, the source tree consists of only five files (root.zig, parser.zig, model.zig, model_query.zig, query.zig), compared to a more fragmented Rust layout with multiple sub‑directories. The author explains that keeping related code in a single file reduces import friction and makes navigation easier, though they acknowledge that very large projects may still need a real hierarchy. Concerning testing, the author states that Rust provides convenient inline unit tests and optional integration tests, while Zig requires more verbose setup. After configuring tests explicitly in build.zig, the author found the process workable but still felt that writing and managing tests feels easier in Rust, attributing much of the extra friction to Zig’s manual memory management rather than the testing framework itself. Finally, the author highlights the difference in programming paradigms. Rust draws heavily on functional concepts such as zero‑cost iterators, lazy evaluation, ADTs, pattern matching, monadic types, traits, and closures, which the author used in the Rust implementation. In Zig, the lack of those abstractions pushed the author toward in‑place mutation and imperative patterns, although sum types remain comparable. The post concludes that the experiment offered useful insights into language‑driven habits and encouraged the author to question whether file‑organization choices stem from genuine project needs or simply from habit.

Key facts
- The author spent seven years as a Rust developer before trying Zig.
- The project reimplemented a JSONPath library (RFC 9535) from Rust to Zig.
- Zig’s IDE support is limited to syntax highlighting and basic autocompletion.
- The author used build.zig commands such as
zig build testandzig build compliance. - Zig encourages a flat source layout compared to Rust’s tendency toward nested folders.
- Testing in Zig required more verbose setup than Rust’s inline unit tests.
- Zig pushes developers toward in‑place, imperative code rather than Rust’s functional idioms.
