The problem has nothing to do with objects. The problem is, how do you type check something like sprintf without ad hoc type rules?
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...