NHacker Next
  • new
  • past
  • show
  • ask
  • show
  • jobs
  • submit
Zig Libc (ziglang.org)
OsamaJaber 1 days ago [-]
250 C files were deleted. 2032 to go. Watching Zig slowly eat libc from the inside is one of the more satisfying long term projects to follow
LexiMax 24 hours ago [-]
That's something I've always admired about Zig.

A lot of languages claim to be a C replacement, but Zig is the second language I've seen that seemed like it had a reasonable plan to do so at any appreciable scale. The language makes working with the C ABI pretty easy, but it also has a build system that can seamlessly integrate Zig and C together, as well as having a translate-c that actually works shockingly well in the code I've put through it.

The only thing it didn't do was be 99% compatible with existing C codebases...which was the C++ strategy, the first language I can think of with such a plan. And frankly, I think Zig keeping C's relative simplicity while avoiding some of the pitfalls of the language proper was the better play.

WalterBright 22 hours ago [-]
D can import C files directly, and can do C-source to D-source translation.

D can compile a project with a C and a D source file with:

    dmd foo.d bar.c
    ./foo
audunw 19 hours ago [-]
Do you have to bring up D in every Zig related post?

I do like D. I've written a game in it and enjoyed it a lot. I would encourage others to check it out.

But it's not a C replacement. BetterC feels like an afterthought. A nice bonus. Not a primary focus. E.g. the language is designed to use exceptions for error handling, so of course there's no feature for BetterC dedicated to error handling.

Being a better C is the one and only focus of Zig. So it has features for doing error handling without exceptions.

D is not going to replace C, perhaps for the same reasons subsets of C++ didn't.

I don't know if Zig and Rust will. But there's a better chance since they actually bring a lot of stuff to the table that arguably make them better at being a C-like language than C. I am really hyped to see how embedded development will be in Zig after the new IO interface lands.

cma256 19 hours ago [-]
He doesn't have to, he _gets_ to! Its knowledge exchange. Take it as a gift and not self-promotion. There's no money in this game so don't treat it like guerilla marketing. Treat it like excited people pushing the limits of technology.
cyber_kinetist 13 hours ago [-]
I think the history of D having a garbage collector (and arguably exceptions / RTTI) from the beginning really cemented its fate. We all know that there's a "BetterC" mode that turns it off - but because the D ecosystem initially started with the GC-ed runtime, most of the D code written so far (including most of the standard library) isn't compatible with this at all.

If D really wants to compete with others for a "better C replacement", I think the language might need some kind of big overhaul (a re-launch?). It's evident that there's a smaller, more beautiful language that can potentially be born from D, but in order for this language to succeed it needs to trim down all the baggage that comes from its GC-managed past. I think the best place to start is to properly remove GC / exception handling / RTTI from the languge cleanly, rewrite the standard library to work with BetterC mode, and probably also change the name to something else (needs a re-brand...)

WalterBright 11 hours ago [-]
My post was not about betterC, it was about the super easy interoperability of C and D. This capability has been in D for several years now, and has been very popular as there's no longer a need to write an adapter to use C source code. The ability to directly compile C code is part of the D compiler, and is known as ImportC.

One interesting result of ImportC is that it is an enhanced implementation of C in that it can do forward references, Compile Time Function Execution, and even imports! (It can also translate C source code to D source code!)

bachmeier 18 hours ago [-]
This is, like, the most ironic comment ever posted on HN. An article about cat nutrition could hit the front page and the Rust fanbois would hijack the conversation.

In this case, however, Walter was not the one that brought up D. He was replying to a comment by someone promoting Zig with the claim that only Zig and C++ have ever had a strategy to replace C. That is objectively false. There's no way to look at what D does in that area and make that sort of claim. Walter and anyone else is right to challenge false statements.

LexiMax 13 hours ago [-]
> claim that only Zig and C++ have ever had a strategy to replace C

What I actually said was that it was the second language I have seen to do so at any appreciable scale. I never claimed to know all languages. There was also an implication that I think that even if a language claims to be a C replacement, its ability to do so might exceed its ambition.

That said I also hold no ill will towards Walter Bright, and in fact was hoping that someone like him would hop into the conversation to try and sell people on why their language was also worthy of consideration. I don't even mind the response to Walter's post, because they bring real-world Dlang experience to the table as a rebuttal.

On the other hand, I find it difficult to find value in your post except as a misguided and arguably bad-faith attempt to stir the pot.

mg794613 14 hours ago [-]
No, he never stated that "claim that only Zig and C++ have ever had a strategy to replace C", you made that up. And "Walter was not the one that brought up D" , he actually was.

Did the text get changed? because it seems you claim exactly the opposite of what is in about ~5 sentences, so it also can't be credited to "misunderstanding".

But didn't find any "D evangelism" comments in his history (first page), but then again, he has 78801 karma points, so I am also not going to put energy in going through his online persona history.

GoblinSlayer 14 hours ago [-]
C++ is more C-like than Zig and Rust, so it's more likely to become a C replacement.
LexiMax 13 hours ago [-]
I do feel like allowing for in-place source upgrading was critical to C++'s early successes. However, I feel like this ultimately worked against C++, since it also wed the language to many of C's warts and footguns.
WalterBright 11 hours ago [-]
C++ cannot seem to let go of the preprocessor, which is an anchor hurting the language at every turn.

BTW, in my C days, I did a lot of clever stuff with the preprocessor. I was very proud of it. One day I decided to replace the clever macros with core C code, and was quite pleased with the clean result.

With D modules, imports, static if, manifest constants, and templates the macro processor can be put on the ash heap of history. Why doesn't C++ deprecate cpp?

jibal 16 hours ago [-]
This is a bad comment in so many ways.

Walter's short limited comment was quite relevant.

LexiMax 14 hours ago [-]
> C-source to D-source translation.

I'm not so familiar with D, what is the state of this sort of feature? Is it a built-in tool, or are you talking about the ctod project I found?

In most languages, I've found that source translation features to be woefully lacking and almost always require human intervention. By contrast, it feels like Zig's `translate-c` goes the extra mile in trying to convert the source to something that Zig can work with as-is. It does this by making use of language features and compiler built-ins that are rather rare to see outside of `translate-c`.

Obviously the stacks of @as, @fooCast, and @truncate you are left with isn't idiomatic Zig, but I find it easier to start with working, yet non-idiomatic code than 90% working code that merely underwent a syntactic change.

WalterBright 11 hours ago [-]
It's hardwired into the D compiler binary. It will even translate C macros into D code!

Well, most macros. The macros that do metaprogramming are not translatable. I read that Zig's translator has the same issue, which is hardly surprising since it is not possible.

So, yes, the translation is not perfect. But the result works out of the box most of the time, and what doesn't translate is easily fixed by a human. Another issue is every C compiler has their own wacky extensions, so it is impractical to deal with all those variants. We try to hit the common extensions, though.

If you just want to call C code, you don't have to translate it. The D compiler recognizes C files and will run its very own internal C compiler (ImportC) to compile it. As a bonus, the C code can use data structures and call functions written in D! The compatibility goes both ways.

AndyKelley 11 hours ago [-]
I've always admired your work, Walter. Keep it up!
WalterBright 11 hours ago [-]
Thank you for the kind words, Andy!
WhereIsTheTruth 19 hours ago [-]
This is the smart choice

You keep compatibility with C, can tap into its ecosystem, but you are no longer stuck with outdated tooling

D gives you faster iteration, clearer diagnostics, and a generally smoother experience, even if it doesn't go as far as Rust in terms of safety

I wish more languages would follow this strategy, ImportC is great, let's you port things one step at a time, if required/needed

Let's be honest: who wants to write or generate C bindings? And who wants to risk porting robust/tested/maintained C code incorrectly?

WalterBright 11 hours ago [-]
> who wants to write or generate C bindings?

Not me, and not anyone else. Many D users have commented on how ImportC eliminates the tedium of interfacing to me.

And with D, you don't have to write .h interface files, either (although you can, but it turns out pretty much nobody bothers to).

tiffanyh 1 days ago [-]
Does this mean long term Zig won’t run on OpenBSD?

Because doesn’t OpenBSD block direct syscalls & force everything to go through libc.

https://news.ycombinator.com/item?id=38039689

AndyKelley 1 days ago [-]
This affects static libc only. If you pass -dynamic -lc then the libc functions are provided by the target system. Some systems only support dynamic libc, such as macOS. I think OpenBSD actually does support static libc though.
winterqt 1 days ago [-]
> I think OpenBSD actually does support static libc though.

How does that work, with syscalls being unable to be called except from the system’s libc? I’d be a bit surprised if any binary’s embedded libc would support this model.

mananaysiempre 1 days ago [-]
For static executables, “the system’s libc” is of course not a thing. To support those, OpenBSD requires them to include an exhaustive list of all addresses of syscall instructions in a predefined place[1].

(With that said, OpenBSD promises no stability if you choose to bypass libc. What it promises instead is that it will change things in incompatible ways that will hurt. It’s up to you whether the pain that thus results from supporting OpenBSD is worth it.)

[1] https://nullprogram.com/blog/2025/03/06/

oguz-ismail2 1 days ago [-]
> How does that work, with syscalls being unable to be called except from the system’s libc?

OpenBSD allows system calls being made from shared libraries whose names start with `libc.so.' and all static binaries, as long as they include an `openbsd.syscalls' section listing call sites.

GoblinSlayer 11 hours ago [-]
Can't you just have one syscall(2) to rule them all? https://man7.org/linux/man-pages/man2/syscall.2.html
oguz-ismail2 2 hours ago [-]
You can. There is a thread-unsafe implementation here <https://gist.github.com/oguz-ismail/72e34550af13e3841ed58e29...>. But the listing needs to be per system call number, so this one only supports system calls 1 (_exit) and 4 (write). It should be fairly easy to automatically generate the complete list but I didn't try it.
AndyKelley 1 days ago [-]
Sorry I got mixed up with FreeBSD: https://codeberg.org/ziglang/zig/issues/30981 (original github link has more information)
pretendgeneer 1 days ago [-]
Not all of libc is syscalls. E.g. strlen() is zib libc but open() goes to system libc.
tialaramex 20 hours ago [-]
Good point. C's "freestanding" mode, analogous to Rust's nostd, does not provide any functions at all, just some type definitions and constants which obviously evaporate when compiled. Rust's nostd not only can compute how long a string is, it can unstably sort a slice, do atomic operations if they exist on your hardware, lots of fancy stuff but as a consequence even nostd has an actual library of code, a similar but maybe less organized situation occurs in C++. Most of the time this is simply better, why hand write your own crap sort when your compiler vendor can just provide an optimised sort for your platform? But on very, very tiny systems this might be unaffordable.

Anyway, C doesn't have Rust's core versus std distinction and so libc is a muddle of both the "Just useful library stuff" like strlen or qsort and features like open which are bound to the operating system specifics.

mastermage 22 hours ago [-]
That just reminds me anyone know whether rust has something similar? Not wanting to start any Rust v. Zig debate. I am just wanting to be even more independant when it comes to some of my Rust projects.
erk__ 21 hours ago [-]
There is a couple libc implementations:

- c-ward [0] a libc implementation in Rust

- relibc [1] a libc implementation in Rust mainly for use in the Redox os (but works with linux as well)

- rustix [2] safe bindings to posix apis without using C

[0]: https://github.com/sunfishcode/c-ward

[1]: https://gitlab.redox-os.org/redox-os/relibc/

[2]: https://github.com/bytecodealliance/rustix

generichuman 1 days ago [-]
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?

AndyKelley 1 days ago [-]
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 installation if you want to mess around with that.

Both situations unchanged.

generichuman 1 days ago [-]
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.

dnautics 1 days ago [-]
do you suspect it will be possible to implement printf??

while we're talking about printf, can i incept in you the idea of making an io.printf function that does print-then-flush?

Cloudef 23 hours ago [-]
It's completely possible to implement printf. here is my impl (not 100% correct yet) of snprintf for my custom libc implemented on top of a platform I'm working on <https://zigbin.io/ab1e79> The va_arg stuff are extern because zig's va arg stuff is pretty broken at the moment. Here's a C++ game ported to web using said libc running on top of the custom platform and web frontend that implements the platform ABI <https://cloudef.pw/sorvi/#supertux.sorvi> (you might need javascript.options.wasm_js_promise_integration enabled if using firefox based browser)
dnautics 22 hours ago [-]
yeah I just thought there are "compiler shenanigans" involved with printf! zig's va arg being broken is sad, I am so zig-pilled, I wish we could just call extern "C" functions with a tuple in place of va arg =D
Cloudef 22 hours ago [-]
The only thing C compilers do for printf, is static analyze the format string for API usage errors. Afaik such isn't possible in zig currently. But idk why'd you downgrade yourself to using the printf interface, when std.Io.Writer has a `print` interface where fmt is comptime and args can be reflected so it catches errors without special compiler shenigans.
dnautics 12 hours ago [-]
I'm thinking: do a translate-c and then statically catch errors using my zig-clr tool.
jzelinskie 1 days ago [-]
Cool idea, for sure, but I can't help but wonder: for the code that's been ported, is there a concern that you'd have to perpetually watch out for CVEs in glibc/musl and determine if they also apply to the Zig implementations?
AndyKelley 1 days ago [-]
Yes but we already have to do that for our own standard library. For shared codepaths (e.g. math) it's strictly fewer potential bugs.
meisel 1 days ago [-]
> It’s kind of like enabling LTO (Link-Time Optimization) across the libc boundary, except it’s done properly in the frontend instead of too late, in the linker

Why is the linker too late? Is Zig able to do optimizations in the frontend that, e.g., a linker working with LLVM IR is not?

ibejoeb 1 days ago [-]
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.
comex 1 days ago [-]
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.

ibejoeb 1 days ago [-]
Right, but I think that's what the question of "Why is the linker too late?" is getting at. With zig libc, the compiler can do it, so you don't need fat objects and all that.

---

expanding: so, this means that you can do cross-boundary optimizations without LTO and with pre-built artifacts. I think.

DannyBee 15 hours ago [-]
Calling this "properly" is a stretch at best.

I will say first that C libc does this - the functions are inline defined in header files, but this is mainly a pre-LTO artifact.

Otherwise it has no particular advantage other than disk space, it's the equivalent of just catting all your source files together and compiling that. If you thikn it's better to do in the frontend, cool, you could make it so all the code gets seen by the frontend by fake compiling all the stuff, writing the original source to an object file special section, and then make the linker really call the frontend with all those special sections.

You can even do it without the linker if you want.

Now you have all the code in the frontend if that's what you want (I have no idea why you'd want this).

It has the disadvantage that it's the equivalent of this, without choice.

If you look far enough back, lots of C/C++ projects used to do this kind of thing when they needed performance in the days before LTO, or they just shoved the function definitions in header files, but stopped because it has a huge forced memory and compilation speed footprint.

Then we moved to precompiled headers to fix the latter, then LTO to fix the former and the latter.

Everything old is new again.

In the end, you are also much better off improving the ability to take lots of random object files with IR and make it optimize well than trying to ensure that all possible source code will be present to the frontend for a single compile. Lots of languages and compilers went down this path and it just doesn't work in practice for real users.

So doing stuff in the linker (and it's not really the linker, the linker is just calling the compiler with the code, whether that compiler is a library or a separate executable) is not a hack, it's the best compilation strategy you can realistically use, because the latter is essentially a dream land where nobody has third party libraries they link or subprojects that are libraries or multiple compilation processes and ....

Zig always seems to do this thing in blog posts and elsewhere where they add these remarks that often imply there is only one true way of doing it right and they are doing it. It often comes off as immature and honestly a turnoff from wanting to use it for real.

pjmlp 14 hours ago [-]
Yeah, like their solutions to detecting use after free are hardly any different from using something like PurifyPlus.
gary_0 1 days ago [-]
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).
account42 16 hours ago [-]
It's hardly a hack when its how most languages work in the first place.
nesarkvechnep 1 days ago [-]
"Furthermore, when this work is combined with the recent std.Io changes, there is potential for users to seamlessly control how libc performs I/O - for example forcing all calls to read and write to participate in an io_uring event loop"

This is exciting! I particularly care more about kqueue but I guess the quote applies to it too.

anitil 1 days ago [-]
There are so many scary parts of libc, this is a really exciting project
LarsKrimi 1 days ago [-]
There are many useful functions too. Like "memfrob" and "strfry". I hope the Zig libc makes those available too

Just joking of course. Those are sadly only in glibc.. :)

voidUpdate 21 hours ago [-]
Does anyone know if there is a timeline on when Zig might achieve 1.0? I've been interested in the language for a while, but I'm a bit concerned about writing anything important in it when it seems to be evolving so much at the moment
Zambyte 15 hours ago [-]
Nobody knows, but for what it's worth, existing large projects that are used in production environments have been fairly good at keeping up with Zig releases. See: Bun, Ghostty, and Tigerbeetle for good examples of this. Because the semantics of Zig are relatively simple, porting to the latest version is usually as simple as bumping your compiler version, trying to build, making a fairly mindless, mechanical change, and repeating until it builds.

The biggest thing holding me back from using Zig for important projects is the willingness of my peers to adopt it, but I'm just building projects that I can build myself until they are convinced :)

jibal 15 hours ago [-]
There's no timeline for 1.0

You might find this interesting: https://www.youtube.com/watch?v=x3hOiOcbgeA

1 days ago [-]
squirrellous 1 days ago [-]
I’m sure this has crossed someone’s mind but why isn’t this called zlibc? :-)
kibibu 1 days ago [-]
Perhaps to avoid confusion with zlib?

https://www.zlib.net/

account42 16 hours ago [-]
Well we also have glib and glibc.
lioeters 1 days ago [-]
I rather like "libz".
13 hours ago [-]
cies 1 days ago [-]
Super cool project.

I expect a lot of C code may be quite mechanically translated to Zig (by help of LLMs). Unlike C->Rust or C->C++, where there's more of a paradigm shift.

Retro_Dev 1 days ago [-]
There's solid reason for the translation here; the Zig core team is aiming to eliminate duplicated code and C functions, and avoid the need to track libc from multiple sources. In the future, LLMs could serve as part of this, but they are currently quite terrible at Zig (as far as I understand it, it's not a lack of Zig code samples, it's an imbalance of OLD Zig to NEW Zig, as Zig changes quite frequently).

You would need to consider if it is even worth it translating your C code. If the paradigm is identical and the entire purpose would be "haha it is now one language," surely you could just compile and link the C code with libzigc... In my opinion, it's not worth translating code if the benefit of "hey look one language" requires the cost of "let's pray the LLM didn't hallucinate or make a mistake while translating the code."

dnautics 1 days ago [-]
> they are currently quite terrible at Zig

hard disagree (example elsewhere)

LAC-Tech 22 hours ago [-]
Does Zig does have the man power to keep these up to date?

I think we either need to make operating systems not in C, or just accept that at some level we rely on C.

stevefan1999 18 hours ago [-]
Not C. PDP-11
xrd 1 days ago [-]
"Abolish ICE" at the bottom. Obviously a Bad Bunny fan, as I am.
AndyKelley 1 days ago [-]
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 next weekend to peacefully protest, and get shot like Alex Pretti.

Needless to say, if I get shot by ICE, it's not good for the Zig project. And they've brought the battle to my doorstep, almost literally.

Abolish ICE.

lvl155 1 days ago [-]
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.
1 days ago [-]
xrd 1 days ago [-]
My 85 year old mom lives in Portland and she attends rallies frequently. If you know of any way to support you or other local people doing this work, I'm very interested. My email is on my profile page.

I have a friend who is in Minneapolis. He's involved in caravans which are tracking ICE. He wasn't the driver in the last one. But, the ICE vehicle they tailed suddenly started going in a very direct path, instead of randomly driving. The driver figured it out first. They drove to the driver's house and then stood outside of their car for ten minutes staring at his house. Cars in Minnesota have their license plates on both the front and the back.

Is there any justification for that kind of intimidation? Did any of the Trump supporters vote for that? I hear about paid agitators on the left but not that kind of compensated actors. Is his name in a database now once they did the lookup?

ghthor 1 days ago [-]
[flagged]
hakrgrl 1 days ago [-]
[flagged]
hakrgrl 1 days ago [-]
[flagged]
throwawaypath 1 days ago [-]
[flagged]
AndyKelley 1 days ago [-]
The Department of Homeland Security was created in 2003. We didn't need it then and we don't need it now.

Why waste tax dollars on ineffective, privacy-violating security theater when we could spend it on education and health?

throwawaypath 1 days ago [-]
You didn't answer or even address a single question I asked. I'll ask again:

1. Are you OK with sovereign states enforcing their borders and deporting illegal immigrants?

2. Is it the awful tactics ICE uses to accomplish its mission, or do you find the mission in and of itself immoral?

jcranmer 1 days ago [-]
ICE's current mission isn't to deport illegal immigrants. Its current mission is to antagonize anyone who is not a WASP, and seemingly these days, anybody who stands up for non-WASP citizens in the US. As can be easily ascertained by the sheer number of encounters where the officers insist that they don't actually care to see any papers proving the people they're arresting are legal US citizens (let alone legal US residents).

So your questions don't matter because you're arguing about a reality that doesn't exist.

hypeatei 1 days ago [-]
You'd have a lot stronger argument if ICE wasn't being used as a secret police force. They're Immigration Enforcement in name only. Your average citizen would say it's okay to enforce immigration laws, there is no doubt about that; doing middle-of-the-night raids with a blackhawk helicopter in cities of your political opponents is not reasonable[0]. There are plenty more examples of their abhorrent behavior (like killing two American citizens in the midwest and brutalizing protestors) if you cared to search for it.

I've noticed that the MAGAs have been adamant about trying to shift the window back to: "but you agree that immigrants should be deported right?" as some sort of attempt to justify what's happening, I guess. Is that talking point coming from some popular right wing show or something as a last ditch effort before midterms?

0: https://www.propublica.org/article/chicago-venezuela-immigra...

actionfromafar 1 days ago [-]
Something smells fishy here... is that a Sea Lion?
throwawaypath 2 hours ago [-]
Something smells grassy here... is that a Straw Man?
2 hours ago [-]
xrd 1 days ago [-]
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 people are really struggling in this country?

And I know plenty of restaurant owners in Portland that are closing because of down tourism. Why can Trump sue the IRS for $10B but Portland can't sue him for disparaging the city because he can't figure out that videos of riots are five years old?

charcircuit 1 days ago [-]
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.
KingMob 1 days ago [-]
We don't need to get them all out, though. The vast majority are picking strawberries and working cheap construction jobs, not funneling drugs and guns.

I'm as concerned with getting them all out as I'm concerned with ticketing every jaywalker.

charcircuit 23 hours ago [-]
>The vast majority are picking strawberries and working cheap construction jobs,

This doesn't matter. I do not want the idea that someone can invade my country as long as they avoid drugs and guns to spread through the world. Due to how great America is people are going to want to come here even if they aren't allowed, so they must understand that coming here illegal will end badly for them so they fully understand not to come here illegally since it has negative EV for them.

KingMob 22 hours ago [-]
> Due to how great America is

Well, not to worry then, hateful little attitudes like yours are rapidly undoing America's greatness. Soon noone will want to be there, including Americans.

Better start practicing your Chinese.

charcircuit 22 hours ago [-]
Enforcing the law is not a hateful attitude. If people don't want to be in a society that enforces laws they can feel free to go to some lawless society.
flumpcakes 20 hours ago [-]
How many laws has the Trump administration flat out ignored? You're cheerleading the introduction of a lawless society. Perhaps you should reconsider your frame of reference.
charcircuit 19 hours ago [-]
Cheerleading laws to be enforced is the opposite of cheerleading the introduction of a lawless society.
KingMob 13 hours ago [-]
Their underlying point is that you're actually being very selective in which laws you want enforced.

For starters, I doubt you've brayed as loudly for the prosecution of business owners who employ illegal migrants, as you are for the migrants themselves. (You certainly didn't mention illegal biz owners in this comment chain.) Likewise, the crimes ICE commits already exceed the crimes of those they're hunting, but you haven't acknowledged that.

Which means you don't actually believe in the law as an impartial force of justice, despite what you might tell yourself. You believe in it as a tool of power, to be wielded strongly against those you dislike, and lightly or not at all, against those you favor.

You believe in power and order, not justice and fairness.

intermerda 12 hours ago [-]
"Conservatism consists of exactly one proposition, to wit: There must be in-groups whom the law protects but does not bind, alongside out-groups whom the law binds but does not protect."
throwawaypath 10 hours ago [-]
"If you have always believed that everyone should play by the same rules and be judged by the same standards, that would have gotten you labeled a radical 50 years ago, a liberal 25 years ago and a racist today."
thrance 1 days ago [-]
No. Both.
SLWW 1 days ago [-]
[flagged]
AndyKelley 1 days ago [-]
When people like you finally realize what is happening in this country, I'm ready to quickly forgive and move on so that we can work together to preserve what freedoms we have left.

but please hurry... we really need you to pay attention and understand the reality that is upon us.

SLWW 1 days ago [-]
I do know what's happening. I've been around and watching for over a decade. We are bleeding from every orifice from an economic standpoint. The recent moves for deportations is an attempt by the office of the President to save face while not doing anything to fix over-spending, it's also a good vehicle for a surveillance push, and the RNC/old-school dems will be happy so someone like JD can take power afterwards to prop up the current rising oligarchy and further support British assets moving into the middle-east for "oil".

I'm not ignorant. I just know you aren't going to change anything by getting riled up emotionally and using language that indicates instability (I don't know you, my initial comment is because I don't want to see you get snuffed out). There's nothing you can do to solve these problems at this point and time, and they would prefer you protest so they can get your face, for the purposes of marking. Portland also is full of genuinely nutty people, been there several times and there is a real social contagion. You should be spending your time helping who you can, avoiding the authorities in general (never even speak to them), and understand that this "liberal democracy" is slowly collapsing and there's no stopping what's going to happen. We are being hollowed out entirely.

Freedoms aren't going to matter much when we are owned by every foreign nation but our own. I thought about 7 years ago that we could fix this with protesting, now I know that we can't. I'm just seeing this from a view of total loss while you see that there is yet still time.

Quick addendum: this is not me attempting to demoralize. I do think that once people can't pay for bread then maybe something will change. Up until that point the majority will give away every right for even the slightest relief, anything for a little hope of a better future. This has happened many times before. Empires rise and fall, it's nothing unique or out of the ordinary across history. First and foremost look out for yourself and your loved ones, and be willing to be flexible

AndyKelley 1 days ago [-]
Don't take the black pill.
SLWW 1 days ago [-]
Only white pilling for me sir. I believe in the morning light after a dark night. I just know that the tide comes in and out reliably. If you believe protesting is the way forward then go for it; just don't get shot while doing it.

Anyway; I like Zig a lot btw.. loving what you guys are doing.

whatis991 16 hours ago [-]
Do you understand what motivates the supporters of ICE?
MiltarizdMerica 1 days ago [-]
[flagged]
pixelpoet 1 days ago [-]
These few-minutes-old accounts swooping in on hot button issues to try persuade people are such a goddamn scourge, I wish there were something that could be done about it.

In the end I probably just need to leave HN for a while because it's really doing a number on what's left of my ability to trust what I read online.

thrance 1 days ago [-]
Only thing you can do is flag them. Two strikes and they're gone. Plus usually, moderation give these accounts a perma-ban.
MiltarizdMerica 1 days ago [-]
[flagged]
maximilianburke 1 days ago [-]
It is possible to both abolish ICE and CBP.

Especially as CBP officers commit crimes at a higher rate than undocumented migrants in the US: https://www.doomsdayscenario.co/p/accountability-for-ice-and...

In fact if you were to make a police force entirely out of CBP officers who have been arrested, it would be the fourth largest police force in America.

metalliqaz 1 days ago [-]
You don't get what the issue is?

Your account is 27 minutes old, the username is sarcastic at best, you hopped on specifically to defend the indefensible.

You really don't know?

MiltarizdMerica 1 days ago [-]
[flagged]
LexiMax 24 hours ago [-]
> I wish there were something that could be done about it.

I find it helpful to think of HN like one would any other social media site. There are things they could be doing to curtail these sorts of accounts. They have apparently chosen not to.

1 days ago [-]
sltkr 1 days ago [-]
[flagged]
baggy_trough 1 days ago [-]
> against the will of our elected officials

Did you mean your local officials?

kstrauser 1 days ago [-]
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.

dnautics 1 days ago [-]
yep. It's not in the constitution, but in all practicality mcculloch vs maryland (which i would love to see repealed) disagrees
baggy_trough 1 days ago [-]
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.
kstrauser 1 days ago [-]
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.
actionfromafar 1 days ago [-]
That's clever. Just slap the "immigration sticker" on ICE and do whatever you want.
self_awareness 23 hours ago [-]
Just go home. Work on Zig. Don't do anything stupid.
mapcars 19 hours ago [-]
I like how you call peaceful protests when people throw huge rocks, break city infrastructure and damage property and take 0 accountability for it. And most likely don't pay taxes to fix it up later.

How convenient it must be to blame officers instead of bad actors just because you agree with their side.

This is purely pushing political agenda, you just covering it up.

Defletter 19 hours ago [-]
Since you're so eager to construe his support for peaceful protest as support for civil unrest, I therefore think it's fair if I construe your defence of ICE to mean support for their extrajudicial executions and the people who dress up as ICE (ie: masked men dragging people at gunpoint into unmarked vans) to kidnap and rape people.
oneoffprobably 22 hours ago [-]
Please stay safe.

I can't hold it so had to create an account to share, I'm sorry. I'm one of the minor zig contributors, and I'm reading ziglang blog for the purpose of engagement in software engineering craft. I don't want to see these ICE stuff or whatever else political opinion you or somebody else have. I'm not from US and I barely know what ICE is but you're hating on people (I'm sure you think it's deserved, as with any hate) and I assume you may hate me at some point because I do something you don't share or like (like this comment for example). Thinking that creator of Zig may hate me, takes a lot of fun from using the language let alone contributing to it or areas surrounding it. What if tomorrow people with tattoos at particular spot will be hated in media and you'll be posting "Abolish people with tattoo". Not the best comparison, but I hope you got why I feel scared of engaging with community now.

I think you have big responsibility for maintaining community of people with different political opinions and you are definitely free to share it on your personal blog. But you chose to do it in the community driven project as a lead of that project. And it's not first time. It's a bit different. For me at least.

Also the fear is what made me create this new account, I'm not a bot or something like that. I'm just afraid due to many (political) reasons and I want to find peace in playing with computers and one of these safe places was just taken from me, which you probably have the right to do but you could've avoided it. You're not the only one. There are many projects like this who mention Gaza, Ukraine, Russia, Israel, all these stuff. It's getting less and less projects to engage with (again, for me, I think it works well for those projects as they attract people they like).

I'm sorry you have to suffer and see people deaths. Me too. I understand it's difficult to hold these stuff inside. As you can see I couldn't ether. But I hoped you're stronger than me.

dwb 22 hours ago [-]
Get some empathy and awareness. I’m not from the US either but I am against fascist thugs occupying cities. It’s not difficult.
k_g_b_ 16 hours ago [-]
The world demonstrates in many instances, that you do not have to have empathy with people suffering from oppression, rape, murder, etc in order to "succeed" in terms of wealth and power.

Meaning: if you can't accept that someone publishing words/code/etc on the web at the same time also offers their own strong opinions (that you directly claim to be hate) about their own such issues, there's plenty of "communities" in which this kind of unempathetic approach to other people and their lives is celebrated and normalized.

If you barely know what ICE is, how can you claim his opinions to be "hate"? How can you claim that Andrew may hate you without thinking you identify with what you understand about ICE?

What ICE does is unmistakenly fascistic and authoritarian, far beyond the powers they have been granted by law and democratic processes. It's utterly disgusting to try and compare protesting and fighting against that with "abolish people with tattoos". ICE is an institution, a government agency among a dozen+ law enforcement agencies in the US. You compare advocating for abolishing it through democratic process (what Andrew expressed) with calling for the murder of many millions of people with a private hobby.

And while Andrew may have some responsibility towards the community he founded; if he has the responsibility to include different political opinions, he most certainly has the responsibility to exclude fascism. Fascism is the destruction of different opinions, it is not a political opinion that can stand among others and be compared on the same basis: that of human rights at the minimum.

Ask yourself and reflect: why does this very simple and inoffensive call by Andrew make you scared, especially if you don't know what ICE is and does? Could you have been influenced into this feeling? It is certainly not a rational reaction to a few characters of text viewed on a screen.

adzm 1 days ago [-]
I too am sick of internal compiler errors
xeonmc 1 days ago [-]
I too am sick of internal combustion engines, a product of the last century.
matheusmoreira 1 days ago [-]
I too am sick of intrusion countermeasures electronics. Think of all the poor netrunners out there.
miki123211 23 hours ago [-]
Well, I guess the Zig project is now writing in NTSC, causing compatibility issues for the PAL folks out there.

/s

hakrgrl 1 days ago [-]
[flagged]
himujjal 1 days ago [-]
[flagged]
milch 23 hours ago [-]
It's kind of hilarious to call 2 single words at the end of a blogpost that you could have read over "pushing politics down your throat". As you said, you didn't even have an idea what it meant. For all you knew before you looked it up, he was complaining about the frigid winter weather.
sltkr 23 hours ago [-]
Would you really make the same argument if those two words were “White power!” or something?
boston_clone 21 hours ago [-]
Hey it’s only the first week of February - isn’t it a bit early to be vying for most egregious example of a false equivalence?
bigstrat2003 14 hours ago [-]
No, the point is valid. The reason milch is saying "it's only two words what's your problem" isn't because it's only two words, it's because they are expressing a message he finds to be acceptable. The parent poster was attempting to point that out by showing there are "two words" messages he wouldn't support.
milch 13 hours ago [-]
The poster I replied to made an over exaggerated statement about the prominence of these two words, which I found hilarious, in the same way a teenager saying "I am LITERALLY DYING right now" after the barista spelled their name wrong on their coffee order would be hilarious. This was a very slight inconvenience to the poster's day (at best) that they could have dropped after deciding they don't care about events happening in a country they don't live in.
boston_clone 13 hours ago [-]
Advocating for the removal of an abusive government agency that has been around for only a handful of years is very fucking different from professing white supremacist views.

Trying to compare those because "they're only two words!" is textbook false equivalence.

https://en.wikipedia.org/wiki/False_equivalence#Examples

self_awareness 23 hours ago [-]
Programmers are curious by nature. So it's not 2 words; it's 2 words + wikipedia article + news articles about it, just to know what he's writing about. All uncalled for.
boston_clone 22 hours ago [-]
Be a little more curious then, friend. The author lives in Portland, which has been experiencing federal brutalization for months. Same place where the feds are repeatedly violating standards for warfare by using chemical munitions on civilians and engaging in large-scale misinformation campaigns against immigrants.

It’s almost astonishing how you found his statement “uncalled for”, while neglecting these facts.

https://www.theguardian.com/us-news/2026/feb/02/portland-ven...

self_awareness 21 hours ago [-]
To be honest, I am more concerned about the Iranian government killing its own people.

Iran has already killed half as many people as the estimated casualties in the Israel-Palestine war.

Not everything revolves around USA.

boston_clone 21 hours ago [-]
I’m distraught by what’s happening there, too. Truly horrifying details emerged in the last week or so.

We must all not be discouraged from speaking truth to power, especially when power is abused - irrespective of country or creed!

ICE must be abolished. The people of Iran must have democracy. But only one of those things is within the author’s relative sphere of influence.

heavyset_go 1 days ago [-]
The gall to tell someone what to create or not create, or say or not say with their own creation, for free for your own enjoyment.
sltkr 1 days ago [-]
[flagged]
rjrjrjrj 1 days ago [-]
“Woke”: objecting to murder
sltkr 1 days ago [-]
[flagged]
dminik 1 days ago [-]
Objecting to murder is still politics, no? In fact, US republicans and democrats can't seem to agree who is fine to murder.

Republicans say that abortions are murder, but often also that prisoner executions are fine. Democrats tend to be in favor of abortions, but not of the death penalty.

I'm not making a moral judgement here, but I do want to ask. Is it just politics you don't agree with that you don't want Andrew to express?

sltkr 23 hours ago [-]
Objecting to murder qua murder isn't political, since murder is defined as unjustified premeditated killing. The key word being _unjustified_: it's hardly political to oppose something that is unjustified by definition. The political aspect comes into play when people start to debate which killings are and aren't justified.

Your abortion example is a good one, so I will use it to clarify my point. When people say “abortion is murder!” they aren't just objecting to murder. They are asserting that abortion _is_ murder, actually: it's the political view that killing unborn foetuses is unjustified. The essential claim isn't “murder is bad”, but rather “abortion is bad”. So summarizing opposition to abortion as simply opposition to murder isn't accurate at all. It doesn't cut at the core of the objection.

The same situation exists with ICE. Modern societies grant the state a monopoly on violence, which the state delegates to officers who enforce the law of the land. When those officers use violence, it can be justified by virtue of them enforcing the monopoly on violence on behalf of the state, for the greater good. When a police officer shoots a gunman who attempts to kill civilians, few people would call that murder: after all, the killing is justified. Sometimes, law enforcement officers kill people when it's questionable whether it is justified. Labeling the killing as “murder” or “not murder” is then a political position: you aren't making a specific statement about murder (again, almost everyone agrees that murder is bad), but you're insisting that killing a person in such-or-such a situation is (not) justified.

So yes, insisting that the recent ICE killings of left wing activists constitute murder is a political statement: it's asserting that this ostensibly justified use of state violence was not justified in this case. Which is a point you can plausibly make, but you cannot insist it's not political, because determining which types of killings are justified and which are not is intrinsically a matter of publicy policy, i.e., political.

> Is it just politics you don't agree with that you don't want Andrew to express?

Ideally, I would not want Andrew to express any political views, at least not in his capacity of Zig project leader. I prefer open source projects that are maximally inclusive, which means not enforcing contributors to conform with particular political views.

Of course there is no law that says open source projects must be inclusive of political views, so you can create an open source project just for people who have the same political views as you do, but then I think the decent thing to do is at least be honest about it.

If Andrew thinks Zig is an American Democratic software project, he should clearly label it as such on ziglang.org. And then I also think Hacker News should ban him when he makes posts where he takes political stances, since Hacker News explicitly has a policy that opposes politics. If Andrew doesn't think Zig is just for American Democrats, he should refrain from making political posts on the Zig language blog. He can still go to his anti-ICE rally and post about it on his personal Bluesky account or whatever, but that at least makes it clear those are his personal political views, and they are not part of the Zig project.

Of course, I cannot enforce either of those things. They are just my personal preferences.

tristan957 23 hours ago [-]
Denouncing ICE is not denouncing federal immigration law. The Department of Homeland Security did not exist until 2003. Are you saying that prior to 2003, the US did not enforce federal immigration law?
sltkr 23 hours ago [-]
What's your point? Immigration law existed before 2003 too. It might not have been the DHS or ICE enforcing it, but the concept of illegal aliens wasn't invented in 2003.

And yes, I interpret “Abolish ICE” to mean “don't enforce federal immigration law”, because that's what people _usually_ mean when they say “abolish ICE”.

Technically, “abolish ICE” could also mean: “abolish ICE and replace it with an even more ruthless state secret police modeled after the East German Stasi” but in my experience that's _rarely_ what people who say “abolish ICE” mean. So I don't think you can fault me for assuming, in good faith, that's not what Andrew means when he calls for the abolition for ICE, either.

If Andrew feels I'm misconstruing his intent, then he's welcome to write a full blog post explaining his nuanced views on immigration, but he didn't do that. He only wrote two words: abolish. ICE. I think it's reasonable to assume that he means to literally abolish Immigration and Customs Enforcement, leaving the US without Immigration and Customs Enforcement.

tristan957 16 hours ago [-]
Andrew doesn't need to write anything. You're making a bad faith argument.

> I think it's reasonable to assume that he means to literally abolish Immigration and Customs Enforcement, leaving the US without Immigration and Customs Enforcement.

You really don't think that the US had federal immigration enforcement before 2003. Very strange.

22 hours ago [-]
k_g_b_ 16 hours ago [-]
So you're basing it all on your willful interpretation of "don't enforce federal immigration law" instead of going with any other interpretation that would not enrage you so? That seems unhealthy. How about the following very likely interpretation: "abolish the government agency ICE through democratic process (including protesting and voting)" followed with one of "move immigration law enforcement to another agency and better qualified agents with different, more humane rules" or "also reform immigration law to be more humane than allowing the executive arbitrary deportation of people in a legal process of gaining legal visa/citizenship/etc" or any of the other less ridiculous takes than your interpretation or Stasi comparison.
rjrjrjrj 1 days ago [-]
“Pushing politics is explicitly against the Hacker News guidelines though.”

Cool tirade.

hakrgrl 1 days ago [-]
"Be kind. Don't be snarky."
23 hours ago [-]
KingMob 1 days ago [-]
[flagged]
undeveloper 22 hours ago [-]
[flagged]
jpnc 24 hours ago [-]
[flagged]
KingMob 22 hours ago [-]
"Danger hair"? WTAF are you even talking about? Are you afraid of dyed hair?
jpnc 19 hours ago [-]
[flagged]
k_g_b_ 16 hours ago [-]
Ah, so you are signalling misogyny and judging people as less just by their choice of hair-do with that term, got it.
23 hours ago [-]
hakrgrl 1 days ago [-]
[flagged]
self_awareness 1 days ago [-]
[flagged]
pravetz259 1 days ago [-]
One can say words against one injustice without being required to mention every injustice.
self_awareness 1 days ago [-]
[flagged]
1 days ago [-]
1 days ago [-]
nameconflicts 1 days ago [-]
[flagged]
shpongled 1 days ago [-]
As someone who has been primarily writing Rust for the past 8+ years, I am actually unaware of any political drama surrounding Rust. It's just a programming language.
nemo1618 1 days ago [-]
This strikes me as a very agent-friendly problem. Given a harness that enforces sufficiently-rigorous tests, I'm sure you could spin up an agent loop that methodically churns through these functions one by one, finishing in a few days.
AndyKelley 1 days ago [-]
hallucinations in a libc implementation would be especially bad
1 days ago [-]
henning 1 days ago [-]
Have you ever used an LLM with Zig? It will generate syntactically invalid code. Zig breaks so often and LLMs have such an eternally old knowledge cutoff that they only know old ass broken versions.

The same goes for TLA+ and all the other obscure things people think would be great to use with LLMs, and they would, if there was as much training data as there was for JavaScript and Python.

dnautics 1 days ago [-]
i find claude does quite well with zig. this project is like > 95% claude, and it's an incredibly complicated codebase [0] (which is why i am not doing it by hand):

https://github.com/ityonemo/clr

[0] generates a dynamically loaded library which does sketchy shit to access the binary representation of datastructures in the zig compiler, and then transpiles the IR to zig code which has to be rerun to do the analysis.

ezekiel68 1 days ago [-]
To be fair, this was true of early public LLMs with rust code too. As more public zig repositories (and blogs / docs / videos) come online, they will improve. I agree it's a mess currently.
Graziano_M 1 days ago [-]
You must have not tried this with an LLM agent in the past few months.
ale 1 days ago [-]
i tested sonnet 4.5 just last week on a zig codebase and it has to be instructed the std.ArrayList syntax every time.
rudedogg 1 days ago [-]
I made a Zig agent skill yesterday if interested: https://github.com/rudedogg/zig-skills/

Claude getting the ArrayList API wrong every time was a major reason why

It’s AI generated but should help. I need to test and review it more (noticed it mentions async which isn’t in 0.15.x :| )

simonmic 10 hours ago [-]
The linked blog post about making this is an excellent read.
rudedogg 8 hours ago [-]
Thanks! I think I spent as much time writing the post as I did making the skill, so I’m happy someone got some value out of it.
ale 15 hours ago [-]
Fighting fire with fire
rudedogg 10 hours ago [-]
A little bit! I wrote a long blog post about how I made it, I think the strategy of having an LLM look at individual std modules one by one make it actually pretty accurate. Not perfect, but better than I expected
Graziano_M 13 hours ago [-]
Are you using an agent? It can quickly notice the issue and fix it. Obviously if it's trained on an older version it won't know the new APIs.
benatkin 1 days ago [-]
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

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact
Rendered at 05:35:47 GMT+0000 (Coordinated Universal Time) with Vercel.