It would be better if a C or C++ header sufficed to declare things so they may be called directly from Zig, without need for matching declarations in Zig. Or, do they? For it to be useful, types would need to be imported, too. That would need destructor and overloading support. Which is doable.
Re:Zig 0.8.0 Release Notes
by somethingor on Saturday June 05, 2021 @05:36AM
(#27403571)
That is how Zig works with C code:
- https://ziglang.org/learn/overview/#integration-with-c-libra...
- https://ziglang.org/documentation/master/#Import-from-C-Head...
OK, that is very cool. It makes Zig seem like a markedly better choice than Rust for adoption in Linux.
Depends how much modern C and C++ Zig wants to implement in order to understand the types.
Generics, lambdas, concepts, templates, exceptions, ....
C++ did it first, having been born at same place as UNIX and C, all major C compiler vendors quickly added it into the box.