[1]: https://willcrichton.net/notes/type-safe-printf/
[2]: https://hackage.haskell.org/package/formatting
Zig does it the right way - it's defined in zig itself, no special cases in compiler like in Rust.
This is not meant as an argument against what you’re saying, because I know you were just giving an example, but I found this and thought you may find it interesting: https://www.hacklewayne.com/a-truly-strongly-typed-printf-in...