TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Ask HN: Why does Zig make Docker irrelevant

12 点作者 mfext超过 2 年前
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 条评论

AndyKelley超过 2 年前
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&#x27;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.<p>If you were going to put a Zig application into a Dockerfile you could use `FROM scratch`.<p>Of course you may have other uses for Docker, that&#x27;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.
评论 #33270817 未加载
评论 #33271316 未加载
pid-1超过 2 年前
- Try to build zig program<p>- Wrong zig version... Ooops<p>Docker is (also) useful because you can declare all your system dependencies, no programing language alone can do that.<p>That said Docker is more or less useful depending on the language. If you need many system libs or external software for test &#x2F; deploy, it&#x27;s a god send.<p>I&#x27;ve been playing with Zig for a few months... Don&#x27;t have a strong opinion, but I generally use containers for dev and CI.
bjconlan超过 2 年前
I think they&#x27;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<p>The &quot;irrelevant&quot; part is questionable and based on the author&#x27;s thinking at the time, not gospel.
steveklabnik超过 2 年前
If I had to guess, many people use docker as a means of cross compilation, but zig has a very strong cross compilation story.
pipeline_peak超过 2 年前
Im not sure, it&#x27;s a weird thing to say. I don&#x27;t t think there&#x27;s anything about the language that even specializes in containers more than any another general purpose one.<p>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.<p>D is the only one of these C++ replacement languages I respect. Unlike Rust, it&#x27;s compatible with C and isn&#x27;t dependent on llvm which I can only suspect adds bloat.<p>Unfortunately, even 20 odd years later I don&#x27;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.<p>I&#x27;m gonna develop a programming language called Chai and the C transpiler wl be called Matcha with some anime girl mascot.
评论 #33269700 未加载
评论 #33270425 未加载