DEV Community

Quinn Henderson
Quinn Henderson

Posted on

Notes from building a tiny scanner in Zig

I've been writing small security tools for years, mostly in Python. This month I tried rebuilding one in Zig, mostly as a learning exercise.

The tool is boring: it fetches a URL and checks a handful of security headers. ~300 lines. What surprised me:

  • The error union type makes failure paths explicit, which is exactly what you want in a scanner.
  • No hidden allocations. I know where every buffer lives.
  • comptime is genuinely useful for building header tables at compile time.

The downside is ecosystem maturity. I spent an afternoon on TLS config that would've been one line in Python.

Verdict: not replacing my Python toolkit yet, but I understand memory and error flow much better now. Next I want to try a small fuzzer where the performance actually matters.

Top comments (0)