Live data from Hacker News

Zig Libc

ziglang.org

61–70 of 196 posts

Re: Zig Libc

#61
post #10

"Abolish ICE" at the bottom. Obviously a Bad Bunny fan, as I am.

The very same day I sat at home writing this devlog like a coward, less than five miles away, armed forces who are in my city against the will of our elected officials shot tear gas, unprovoked, at peaceful protestors, including my wife. https://www.kptv.com/2026/01/31/live-labor-unions-rally-marc... This isn't some hypothetical political agenda I'm using my platform to push. There's a nonzero chance I go out there n…

Don’t do it, your project here on zig is a much larger net positive for civilization than you spending your time at those protests.

<3 zig and want io interface in everything!

Re: Zig Libc

#62

Earlier quoted context omitted.

In the Federal model of US government, state authority overrides centralized government except in the explicit cases enumerated by the Constitution. So yes, of course they mean their local officials, because in this case there isn’t an explicit line in the Constitution explaining why the feds are allowed to invade Minnesota.

The Supreme Court has disagreed with you on the matter of federal immigration constitutional authority for more than a century. There isn’t any “invasion”; that’s a propaganda device.

And yet they didn’t brag about invading other states bordering, let’s see, Canada, just the blue one they had a political spat with.

Re: Zig Libc

#63
post #20
post #17

Earlier quoted context omitted.

Seems like it ought to be able to do inlining and dead code stripping which, I think, wouldn't be viable at link time against optimized static libraries.

It is viable against the IR that static libraries contain when LTO is enabled. LTO essentially means “load the entire compiler backend into the linker and do half of the compilation work at link time”. It’s a great big hack, but it does work.

As I understand it, compiling each source file separately and linking together the result was historically kind of a hack too, or at least a compromise, because early unix machines didn't have enough memory to compile the whole program at once (or even just hold multiple source files in memory at a time). Although later on, doing it this way did allow for faster recompilation because you didn't need to re-ingest source files that hadn't been changed (although this stopped being true for template-heavy C++ code).

Re: Zig Libc

#64
post #10

"Abolish ICE" at the bottom. Obviously a Bad Bunny fan, as I am.

The very same day I sat at home writing this devlog like a coward, less than five miles away, armed forces who are in my city against the will of our elected officials shot tear gas, unprovoked, at peaceful protestors, including my wife. https://www.kptv.com/2026/01/31/live-labor-unions-rally-marc... This isn't some hypothetical political agenda I'm using my platform to push. There's a nonzero chance I go out there n…

Andy stay safe. We gotta all come to realization that none of this is possible if we let our democracy slip away. Millions before us died to preserve it. We owe it to them to put up a good fight.

Re: Zig Libc

#65

This is very exciting for zig projects linking C libraries. Though I'm curious about the following case: Let's say I'm building a C program targeting Windows with MinGW & only using Zig as a cross compiler. Is there a way to still statically link MinGW's libc implementation or does this mean that's going away and I can only statically link ziglibc even if it looks like MinGW from the outside?

This use case is unchanged. If you specify -target x86_64-windows-gnu -lc then some libc functions are provided by Zig, some are provided by vendored mingw-w64 C files, and you don't need mingw-w64 installed separately; Zig provides everything. You can still pass --libc libc.txt to link against an externally provided libc, such as a separate mingw-w64 installation you have lying around, or even your own libc installa…

That's cool. I imagine I could also maintain a MinGW package that can be downloaded through the Zig package manager and statically linked without involving the zig libc? (Such that the user doesn't need to install anything but zig)

That's a good way to sell moving over to the zig build system, and eventually zig the language itself in some real-world scenarios imo.

Re: Zig Libc

#66
post #49

Earlier quoted context omitted.

You must have not tried this with an LLM agent in the past few months.

i tested sonnet 4.5 just last week on a zig codebase and it has to be instructed the std.ArrayList syntax every time.

Try it again. This time do something different with CLAUDE.md. By the way it's happy to edit its own CLAUDE.md files (don't have an agent edit another agent's CLAUDE.md files though [0])

0: https://news.ycombinator.com/item?id=46723384

Re: Zig Libc

#69
post #38

Earlier quoted context omitted.

[flagged]

Are you ok with the size of the budget these agencies control? Are you ok with it being headed by a guy who never has denied he took a $50k bribe from the FBI and wasn't even the initial target of an investigation? I would bet you $1000 that not one of the immigrants being rounded up were even accused of that kind of corruption and crimes. How is this not bald corruption and an insane way to spend tax dollars when pe…

The budget needs to increase because there are a lot of people in the country illegally and in order to get every single one of them out the agency needs to scale up. When people start obstructing officers and being violent that increases the required number of officers even more.
Post reply on HN