I’m dealing with an interesting challenge. I’d like to port one of my libraries, which is included in most Linux distros, from C++ to Zig. However, I realized that given that Zig is not packaged for distros like Debian, if I port it, I’m basically asking for the package to be removed. I don’t want that. What are the options? Packaging Zig into Debian seems like asking for trouble, given that it will be out of date in a few months, but the Debian release cycle is in years. Is there a C backend in Zig I could export the my code to? What other options do I have?
There is definitely a wider issue of a fast moving language/compiler being packaged in a more slowly moving distro, but I think it applies more to people learning the language and starting new projects. If the zig version of your package were to be released in Debian, wouldn’t it be getting released in the same cycle as the zig package, and therefore broadly in sync?
There is a c backend, but a backend is not a translator, it will output post comptime, target specific, and ugly c.
The problem I see is not with my package, but with having an ancient version of Zig in Debian. I don’t think anyone wants that. Not Zig developers, because they will receive invalid bug reports, not Debian developers, because they receive constant complaints about being ancient, not app developeras, because the Zig version doesn’t match their app.
I think that basically means that I can’t really use Zig in a project, that I want packaged in Linux distros, which is a shame.
That zig version would not really be meant to be installed by users; it would just be the requirement for packaging any other program or library written in zig.
This is also how it works with the rust compiler and lots of rust libraries; their debian packages are only needed as dependencies during packaging and you are not supposed to install them as a user/developer of other software.
As a developer you would just use the current version of zig. When what you have released is packaged, the then current version of zig would also be packaged and would match.
You would be asking to package zig itself in addition to your library, unless some other software written in zig is packaged for debian before, and zig along with it.
Hm, it seems that there is some external effort to package Zig for Debian
Unfortunately, it targets the non-free archive, due to the WASM binary.
Guess I’ll wait porting my project.
Hm, I remembered that the booststrap process uses wasm2c, maybe if the c version was distributed as zig1 sources, Debian wouldn’t have a problem with the WASM binary.
I misunderstood the problem, they need a patchable source.