Hacker News new | ask | show | jobs
Ask HN: Why does Zig make Docker irrelevant
12 points by mfext 1345 days ago
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?
5 comments

I wrote that text. People were unnecessarily trying to use Docker in order to build their Zig applications and so this is a dramatic way to point out that you don't need to do that because you can make them statically compiled and thus run in any Linux environment. That GitHub repository is only for creating Drone CI images.

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.

Interesting, I understand now thanks to your reply and a couple others. I’ve been living in an interpreted echo system for too long (nodejs, python) I suppose, so I was looking through a runtime-focused lense where Docker shines so the word choice seemed radical. This is a cool project, thank you for taking the time to respond!
Isn't go statically compiled by default also..?
- Try to build zig program

- 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.

I think they're getting at the fact that you can create statially linked binaries without dependencies beyond posix or LSB (much like go). Compiling said code probably will require some well defined version of the compiler (which is trivial to containerize) as noted by pid-1 and why the linked project exists

The "irrelevant" part is questionable and based on the author's thinking at the time, not gospel.

If I had to guess, many people use docker as a means of cross compilation, but zig has a very strong cross compilation story.
Im not sure, it's a weird thing to say. I don't t think there's anything about the language that even specializes in containers more than any another general purpose one.

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.

> Last time I checked it transpiles to C which makes it hard to take seriously.

Zig never did this. Are you thinking of a different language?

You're right, my mistake
I think by your definition that D is also a much older meme language than zig...