Hacker News new | ask | show | jobs
by lionkor 1128 days ago
Doing it without glibc is not practical
2 comments

It's just DNS isn't it? Many apps don't even need DNS, so there should at least be an option to build fully static binaries.
why?
Because otherwise you need to implement almost everything yourself - memory allocation, input, output, etc. and anything more complex (like asking for the width of the terminal) requires you to get into Kernel structs, copy them out, translate, and basically copy paste glibc code anyways. And thats just linux.
There are alternative C libraries that are worth considering, e.g. Zig (which is what Bun itself is written in, afaiu) supports using [musl](https://musl.libc.org) as an alternative to glibc, and musl can be statically linked as well (by contrast to the glibc quasi-static-linking).