We have Traits at Home
Summary
The article explores Zig language abstractions by comparing dynamic interfaces with comptime duck typing and proposes Trait-based compile-time contracts. It provides code-patterns and guidance for implementing traits in Zig, including helper utilities like impl and getTrait, and discusses tradeoffs between performance, explicit control, and potential code bloat.