Why does Zig make Docker irrelevant
Maybe a dumb question, but I am curious about zig’s dockerfile readme that says it makes docker irrelevant (see: https://github.com/ziglang/docker-zig). Can some explain what that means?
(
12 comments
| 6 points
| on HN
)
- Wrong zig version... Ooops
Docker is (also) useful because you can declare all your system dependencies, no programing language alone can do that.
That said Docker is more or less useful depending on the language. If you need many system libs or external software for test / deploy, it's a god send.
I've been playing with Zig for a few months... Don't have a strong opinion, but I generally use containers for dev and CI.
Zig is a meme language that will never break obscurity. Last time I checked it transpiles to C which makes it hard to take seriously.
D is the only one of these C++ replacement languages I respect. Unlike Rust, it's compatible with C and isn't dependent on llvm which I can only suspect adds bloat.
Unfortunately, even 20 odd years later I don't see much adoption. Corporate backing helps the most, but I honestly think hipster sounding titles like Zig, Rust, and Go play some part in this.
I'm gonna develop a programming language called Chai and the C transpiler wl be called Matcha with some anime girl mascot.
Zig never did this. Are you thinking of a different language?
The "irrelevant" part is questionable and based on the author's thinking at the time, not gospel.
If you were going to put a Zig application into a Dockerfile you could use `FROM scratch`.
Of course you may have other uses for Docker, that's fine. This text is for people coming from e.g. Go or Python where the reflex is to unconditionally use Docker. When using Zig this should be questioned.
Another good reason for using Docker with Zig is shareability since Zig doesn't have a package manager.
In fact, Zig is used in combination with CGo to create statically linked executables and re-enable cross-compilation: https://dev.to/kristoff/zig-makes-go-cross-compilation-just-...
Same also applies to Rust: https://actually.fyi/posts/zig-makes-rust-cross-compilation-...
> It's still a good idea to Dockerize your apps even if they are statically compiled. If your app has C dependencies e.g. libxml2, it won't run on another system if the required C headers are missing.
You clearly don't understand the meaning of statically linked nor how dynamic linking works. Spend less time concern-trolling and more learning software engineering, friend ;^)