146 pointsby ingve8 hours ago11 comments
  • OsamaJaber3 hours 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
  • xrd3 hours ago
    "Abolish ICE" at the bottom. Obviously a Bad Bunny fan, as I am.
    • AndyKelley3 hours 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.

      • ghthor13 minutes ago
        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!

      • xrd2 hours 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?

      • 2 hours ago
        undefined
      • throwawaypath2 hours ago
        [flagged]
        • AndyKelley2 hours 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?

          • throwawaypath2 hours 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?

            • jcranmeran hour 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.

            • hypeateian hour 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...

            • actionfromafar2 hours ago
              Something smells fishy here... is that a Sea Lion?
        • xrd2 hours 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?

        • thrance2 hours ago
          No. Both.
      • MiltarizdMerica2 hours ago
        [flagged]
        • pixelpoet2 hours 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.

          • thrance2 hours ago
            Only thing you can do is flag them. Two strikes and they're gone. Plus usually, moderation give these accounts a perma-ban.
          • MiltarizdMerica2 hours ago
            [flagged]
            • maximilianburke2 hours 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.

            • metalliqaz2 hours 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?

        • 2 hours ago
          undefined
      • SLWW2 hours ago
        [flagged]
        • AndyKelley2 hours 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.

          • SLWW2 hours 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

            • AndyKelley2 hours ago
              Don't take the black pill.
              • SLWWan hour 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.

      • baggy_trough2 hours ago
        > against the will of our elected officials

        Did you mean your local officials?

        • kstrauseran hour 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.

          • baggy_trough38 minutes 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.
            • kstrauser10 minutes ago
              And yet they didn’t brag about invading other states bordering, let’s see, Canada, just the blue one that had a political spat with.
            • actionfromafar33 minutes ago
              That's clever. Just slap the "immigration sticker" on ICE and do whatever you want.
    • adzm3 hours ago
      I too am sick of internal compiler errors
    • matheusmoreira3 hours ago
      I too am sick of intrusion countermeasures electronics. Think of all the poor netrunners out there.
    • xeonmc2 hours ago
      I too am sick of internal combustion engines, a product of the last century.
  • generichumanan hour 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?

    • AndyKelleyan hour 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.

  • jzelinskie4 hours 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?
    • AndyKelley3 hours 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.
  • meisel3 hours 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?

    • ibejoeb3 hours 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.
      • comex3 hours 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.

        • gary_02 minutes 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).
        • ibejoeb3 hours 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.

  • nesarkvechnep4 hours 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.

  • 5 hours ago
    undefined
  • cies4 hours 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_Dev3 hours 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."

  • self_awareness3 hours ago
    [flagged]
    • pravetz2593 hours ago
      One can say words against one injustice without being required to mention every injustice.
    • 2 hours ago
      undefined
    • 3 hours ago
      undefined
  • nameconflictsan hour ago
    I considered Zig because I was tired of all the political correctness surrounding Rust. If Zig is also involved in all sorts of political issues, then it's no different from Rust; it's just a case of the pot calling the kettle black.
    • shpongledan hour 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.
  • nemo16184 hours 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.
    • AndyKelleyan hour ago
      hallucinations in a libc implementation would be especially bad
    • 4 hours ago
      undefined
    • henning4 hours 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.

      • ezekiel682 hours 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_M3 hours ago
        You must have not tried this with an LLM agent in the past few months.
        • ale2 hours 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.