2 ms·
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, d
by ncmncm 5y ago
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.
- pjmlp 5y agoDepends how much modern C and C++ Zig wants to implement in order to understand the types. Generics, lambdas, concepts, templates, exceptions, ....
- ncmncm 5y agoIf Zig doesn't have lambdas yet, that is a clear omission. It would be wise to reserve syntax for it early.
- somethingor 5y agoThat is how Zig works with C code: - https://ziglang.org/learn/overview/#integration-with-c-libraries-without-ffibindings https://ziglang.org/learn/overview/#integration-with-c-libra... - https://ziglang.org/documentation/master/#Import-from-C-Header-File https://ziglang.org/documentation/master/#Import-from-C-Head...
- ncmncm 5y agoOK, that is very cool. It makes Zig seem like a markedly better choice than Rust for adoption in Linux.