2 ms·
> Also, if you write a library in Zig, aren’t you limiting your audience? The Zig compiler has a C backend so at worst you could just compile your library to C
by defen 3y ago
> Also, if you write a library in Zig, aren’t you limiting your audience?
The Zig compiler has a C backend so at worst you could just compile your library to C so that anyone with a C compiler can use it. However you can also export C-compatible functions, which is roughly analogous to having an `extern "C"` interface for your C++ library. The consumer would need a Zig compiler, of course, if they wanted to build from source.