267 pointsby ayhanfuat4 hours ago15 comments
  • hdjdndndba4 hours ago
    This makes sense given how much of the current AI ecosystem is built on top of Python. I hope this helps the foundation improve security for everyone who relies on these libraries.
    • bbor3 hours ago
      For anyone who isn’t aware/remembering, this is certainly made with the security of PyPi in mind, python’s main package repository.

      NPM is the other major source of issues (congrats for now, `cargo`!), and TIL that NPM is A) a for-profit startup (??) and B) acquired by Microsoft (????). In that light, this gift seems even more important, as it may help ensure that relative funding differences going forward don’t make PyPi an outsized target!

      (Also makes me wonder if they still have a Microsoft employee running the PSF… always thought that was odd.)

      AFAIU the actual PSF development team is pretty small and focused on CPython (aka language internals), so I’m curious how $750,000/year changes that in the short term…

      EDIT: there’s a link below with a ton more info. This gift augments existing gifts from Amazon, Google, Microsoft, and Citi, and they soft-commit to a cause:

        Planned projects include creating new tools for automated proactive review of all packages uploaded to PyPI, improving on the current process of reactive-only review. We intend to create a new dataset of known malware that will allow us to design these novel tools, relying on capability analysis.
      • simonw2 hours ago
        > (Also makes me wonder if they still have a Microsoft employee running the PSF… always thought that was odd.)

        You might be confusing the Python Steering Council - responsible for leadership of Python language development - with the PSF non-profit there.

        The PSF is lead by a full-time executive director who has no other affiliation, plus an elected board of unpaid volunteer directors (I'm one of them).

        Microsoft employees occasionally get voted into the board, but there is a rule to make sure a single company doesn't have more than 2 representatives on the board at any one time,

        The board also elects a chair/president - previously that was Dawn Wages who worked at Microsoft for part of that time (until March 2025 - Dawn was chair up to October), today it's Jannis Leidel from Anaconda.

        Meanwhile the Python steering council is entirely separate from the PSF leadership, with their own election mechanism voted on by Python core contributors. They have five members, none of whom currently work for Microsoft (but there have been Microsoft employees in the past.)

      • jjthebluntan hour ago
        Microsoft was serious about supporting Python as far back as 2006, because IronPython was a real effort in Redmond. (I'm wondering how they think of it now.)
  • qaq3 hours ago
    Still crazy how little investment goes to Python given how critical it is to the ecosystem.
    • mixmastamyk3 hours ago
      Poor management has played a role. They refused to invest in packaging to the extent that a separate company (astral) had to do it for them. Bugs closed for years with the excuse “we’re only volunteers.” Meanwhile, “outreach” was funded for several million a year. Not confidence inspiring. Maybe would have improved if the funds had been spent more appropriately.

      Similar story with Mozilla.

      • teh642 hours ago
        Where are you getting these numbers? Looking at the PSFs Report for 2024 [0], 50% of their expenses went to pycon. Would you consider that outreach? I believe conferences are very important as part of the health of a language, and reading the definition of outreach[1], I would not classify the conference as that. The second highest amount of expenses (27.1%) went to (surprise!) "Packaging Work Group/Infrastructure/Other", i.e. pypi, pip etc... "Outreach & Education" was only 2.8% of 12.9% of expenses, i.e. 0.3612%, which is $17846 (actual dollars, not thousands like in the report.)

        [0] https://www.python.org/psf/annual-report/2024/ [1] https://en.wikipedia.org/wiki/Outreach

        • mixmastamyk2 hours ago
          The assertions above are my memory from pre-covid, I’d look at 2019 and before perhaps. Many things changed after that (and council too) but it takes a while to change perception.
          • teh642 hours ago
            In 2019 [0] they only had 2.5 million of total expenses, of which 75% was pycon. So even if everything else was on "outreach" (it was not), that would only be $642,500, which is not "several million a year".

            In 2020 [1] 48.1% went to "Packaging Work Group/Infrastructure/Other" (I assume because in person pycon was canceled).

            I also checked 2021 [2], which was 32.7% pycon and 31.2% pip etc...

            Also 2022 [3], 57.8% pycon, 26.6% Packaging Work Group...

            In 2023 [4], 60.5% pycon, and Packaging Work Group expenses decreased to 9.6% because of fastly now provides the bandwidth/hosting: "We are grateful to Fastly for making the online services that the PSF provides possible, so that we can invest time and resources into advancing our infrastructure to better meet community wants and needs."

            So your assertion seems to have never been true.

            [0] https://www.python.org/psf/annual-report/2019/

            [1] https://www.python.org/psf/annual-report/2020/

            [2] https://www.python.org/psf/annual-report/2021/

            [3] https://www.python.org/psf/annual-report/2022/

            [4] https://www.python.org/psf/annual-report/2023/

            • mixmastamykan hour ago
              As mentioned covid changed everything, so please stop pulling figures from that once in a lifetime event.
              • teh64an hour ago
                I have looked at 2018-2016, where the expenses are almost completely the main pycon and more local pycons. Also sponserships like "Pallets group, which maintains projects such as Flask and Jinja" (2018). Everything other than the main pycon is less than 1 million dollars combined in expenses.

                I feel it is important to look at the facts, not just vibes.

                • mixmastamyk14 minutes ago
                  A portion of pycon expenses are spent on outreach during the event. There are dedicated grants, aid, support as well. The 2019 PDF breakdown doesn't seem to be available any longer.

                  During the 2010s, the packaging group was begging for help. "We're only volunteers," a common refrain: https://news.ycombinator.com/item?id=46605018

                  During the 2020s, funding for packaging was provided by Mozilla and Chan-Zuck, because PSF wouldn't do enough.

                  As we all know, astral stepped in and solved the problem for them. I moved to their tools as soon as was possible. And not simply because they were fast, but because they work.

                  For example, here's one that they broke for my package a couple of years ago in pip, and never fixed: https://github.com/pypa/packaging/issues/774

                • nedbatan hour ago
                  > Also sponserships like "Pallets group ...

                  Those are "fiscal sponsorships" meaning the PSF holds money for other organizations. The PSF is not funding Pallets (or Boston Python or North Bay Python, etc, etc). They accept money earmarked for those organizations and provide administrative support. Details: https://www.python.org/psf/fiscal-sponsorees/

                  • teh6437 minutes ago
                    Thanks for the correction!
      • embedding-shape2 hours ago
        I don't know much about the Linux Foundation if I'm being honest, even though I've been a 24/7 Linux user for decades, but they seemingly don't have the same image in the ecosystem, at least not close to how people see Mozilla today.

        Why is that? Is there lessons to be learned from the Linux Foundation how to actually effectively and responsibly manage that sort of money, in those types of projects?

        • mixmastamyk2 hours ago
          A foundation should invest in its technology first and resist the strong temptation to fund pet projects (of leadership) with donated money.
          • nedbat2 hours ago
            I'm not sure what you are labeling as pet projects of leadership? Is there something the PSF is doing that you consider a pet project rather than part of their core mission?
            • mixmastamykan hour ago
              Yes, outreach before investing in packaging. It’s not that outreach is bad but that packaging was crumbling.
              • nedbatan hour ago
                I'm not sure how you got to "before" here. The PSF runs PyPI, organizes the Python Packaging Authority, supports sprints and standardization efforts, funds developers in residence and so on. Packaging is improving, partly because of those efforts. It's not an either/or.
                • mixmastamykan hour ago
                  https://devclass.com/2025/03/10/pypi-repository-takes-steps-...

                      > CPython core developer Paul Moore described his involvement in the
                      > packaging community and said: “it’s struggling under the weight of its own
                      > popularity … the individuals involved are doing their best under what are
                      > frankly near-impossible conditions.”
                  
                      > Moore questioned whether the fact that so many businesses now depend on
                      > Python and PyPI meant that “maybe a purely volunteer basis simply can’t
                      > work any more,” though he hoped this is not the case.
                  • nedbatan hour ago
                    Yes, it could use more funding. Glad to see that Anthropic is helping. It's still not an either/or situation. The PSF would not be fulfilling their mission if they only funded packaging until packaging was "solved" (whatever that might mean) and only then did they fund outreach.
                    • mixmastamyk10 minutes ago
                      I didn't say either/or, and was talking about priorities. You don't install a fancy roof when the foundation is crumbling.

                      > The PSF would not be fulfilling their mission if they only funded packaging until packaging was "solved" (whatever that might mean) and only then did they fund outreach.

                      But they did the opposite. So they still didn't fulfill it, astral had to.

  • returnInfinity2 hours ago
    They are probably trying to build influence. Why is a startup that is burning cash donating money?
    • red2awnan hour ago
      They are heavily focused on code. Claude Code likely generates 100 of millions lines of Python a day, make the language a little bit better with $1.5M is extremely high leverage.
    • nedbat2 hours ago
      Is it so hard to imagine that they do it because the PSF's work is important and they want to support them? All the AI labs depend hugely on the Python ecosystem and infrastructure. Startups burning cash spend on many things that are important to them.
    • jedberg2 hours ago
      Of course they are. These donations usually come out of the marketing budget. And it's working, we're talking about them.

      But also they rely heavily on Python and want to support the ecosystem.

  • twoquestions3 hours ago
    Glad to see Anthropic continuing to invest in the longevity and quality of their open-source dependencies!

    If you missed it, they bought Bun a while back, which is what Claude Code is built in: https://bun.sh/blog/bun-joins-anthropic

    • geodelan hour ago
      Wow. Just came to know from your comment. Not sure if it was covered here on HN. I totally missed it.
  • 3 hours ago
    undefined
  • heliumtera2 hours ago
    It's certainly better than absolute nothing!
  • zoobab3 hours ago
    I did not know you could make donations with a string attached ("improve security")...
    • larkost2 hours ago
      My wife's previous job was as an accountant with the endowment foundation at a mid-sized public university (San Jose State University). A lot of her time was spent making sure that the spending from the endowments many different funds corresponded to the rules that the donors had given when donating that money. Much of that was working with groups to shift spending around between accounts when they invariably made "mistakes".

      One of her biggest projects was shepherding a large group of very old donations through a legal process to remove provisions in the donation agreements that were now illegal. In these cases the donors were long deceased, and the most common rule that needed to be changed was targeting race or ethnicity (e.g.: funds setup to help black people, or Irish, etc...).

      The sheer number of different variations on "donor intent", or even just the wording on that legal document was astounding. There was always a tension between my wife's group and the group that was bringing in the money ("stewardship"), her group wanted things to be simpler and the "stewarding" group wanted nothing to get in the way of donations. It was remarkably similar to the tensions between sales and engineering in many software firms.

    • jobs_throwaway3 hours ago
      Of course you can. The vast majority of donations of this magnitude come with strings attached, be it how the money is spent, access to leadership/events, etc
    • frankwiles3 hours ago
      It's super common with non-profits. Obviously they would prefer no strings attached but some light strings are usually not a problem for most non-profits.
      • bbor3 hours ago
        And they come in a variety of bindingness. I didn’t notice any details in this link which makes me think this is mostly a handshake deal, but it wouldn’t be at all unusual for there to be some auditing mechanisms on a quarterly/yearly cycle.

        For example, Wikimedia just recently claimed that they can’t chase some political project that critics wanted them to because most of their funds are earmarked-for/invested-in specific projects. So it does happen with US-based tech non-profits to at least some extent.

    • epistasis3 hours ago
      The vast majority of donations to, say, universities are made with a specific purpose, and that happens with a lot of non-profits too. The recipient doesn't have to accept the donation, of course, but if they do they track exactly how it was spent.
    • ssutch33 hours ago
      Yes, and at least the strings they attached are productive palatable unlike some other organizations: https://pyfound.blogspot.com/2025/10/NSF-funding-statement.h...
      • mcintyre19943 hours ago
        That link shows the significance of this Anthropic donation too:

        > $1.5 million over two years would have been quite a lot of money for us, and easily the largest grant we’d ever received.

      • pathetic1231233 hours ago
        [flagged]
  • htrp3 hours ago
    Looking at you Deepmind and OpenAI
    • surajrmal3 hours ago
      Google sponsors the python foundation as per this page: https://www.python.org/psf/sponsors/
      • godelski3 hours ago
        Kinda crazy that the top level "Visionary Sponsor" is a donation level of $160k. There's also 0 sponsors at the $100k level. I was also surprised to see Netflix at $5k and Jane Street at $17k. Maybe they should give more but there's a lot of names absent and that says more
  • neom3 hours ago
    Seems like a good time to throw out a reminder regarding "Roads and Bridges: The Unseen Labor Behind Our Digital Infrastructure" by Nadia Asparouhova. While she may have published it in 2016, it's still relevant today and speaks to the need for the private sector generally (looking at you VC firms) to support and understand the open source work, hours of unfunded labor, powering our societies.

    https://www.fordfoundation.org/learning/library/research-rep...

    • godzillabrennus3 hours ago
      Big Tech should really be footing the bill here as well as large established VC firms.
      • alain940402 hours ago
        Really simple fix: social pressure and expectations should be that every company that uses open source pays a fixed amount of their revenue (is 0.1% low enough to be negligible for the companies). Companies that don't should shunned.
        • TrainedMonkeyan hour ago
          The problem is, people who make that decision can either spend 0.1% to support open source and get return on investment in terms of better business performance in 2-3 business years. Or they could pay themselves 0.1% in bonuses right now and get an immediate return.
        • jszymborskian hour ago
          How about we skip the social pressure and levy a tax on them that is used to shore up a sovereign fund for OSS.
          • 13 minutes ago
            undefined
        • n8m82 hours ago
          They won’t even attempt to read ToS, you think they’ll shun companies?
      • an hour ago
        undefined
      • ajross3 hours ago
        To a large extent they do and always have. It's not as broad or fair as it should be[1], but for almost any economically important project all the major contributors and maintainers are on the payroll of one of the big tech interests or a foundation funded by them.

        The hippies writing that software may not be compensated at the level you'd expect given the value they provide, but they'll never go hungry.

        [1] LLVM and Linux get more cash than they can spend. GNU stuff is comparatively impoverished because everyone assumes they'd do it for free anyway. Stuff that ships on a Canonical desktop or RHEL default install gets lots of cash but community favorites like KDE need to make their own way, etc... Also just to be clear: node is filled with povertyware and you should be extremely careful what you grab from npm.

        • Foxboron3 hours ago
          > but for almost any economically important project all the major contributors and maintainers are on the payroll of one of the big tech interests or a foundation funded by them.

          "almost" is the load bearing word here, and/or a weasel word. Define what an "economically important project" is.

          > Also just to be clear: node is filled with povertyware and you should be extremely careful what you grab from npm.

          Is "povertyware" what we call software written by people and released for free now?

          • ajross2 hours ago
            > "almost" is the load bearing word here, and/or a weasel word. Define what an "economically important project" is.

            Linux, clang, python, react, blink, v8, openssl... You know what I mean. I stand by what I said. Do you have a counterexample you think is clearly unfunded? They exist[1], but they're rare.

            > Is "povertyware" what we call software written by people and released for free now?

            It's software subject to economic coercion owing to the lack of means of its maintainership. It's 100% fine for you to write and release software for free, but if a third party bets their own product on it they're subject to an attack where I hand you $7M to look the other way while I borrow your shell.

            [1] The xz-utils attack is the flag bearer for this kind of messup, obviously.

            • cudderan hour ago
              Unfunded is kind of a stretch, but at least libxml2.

              Essentially "povertyware" as you call it when you consider the trillion dollar companies built on top of them? Now that's way easier: SQLite, PostgreSQL, ffmpeg, imagemagick, numpy, pandas, GTK, curl, zlib, libpng, zxing or any other popular qr/barcode library, etc...

            • Foxboronan hour ago
              > Linux, clang, python, react, blink, v8, openssl... You know what I mean. I stand by what I said. Do you have a counterexample you think is clearly unfunded? They exist[1], but they're rare.

              For Linux "all the major contributors and maintainers are on the payroll of one of the big tech interests or a foundation funded by them" is simply not true. It's trivial to prove this by just looking at the maintainers of the subsystems. Making this claim is nonsense to begin with.

              Same is true for several major contributors to the Python compiler and subsequent libraries as well.

              You will move the goalpost by trying to narrow down what "major contributor" means.

              > It's software subject to economic coercion owing to the lack of means of its maintainership. It's 100% fine for you to write and release software for free, but if a third party bets their own product on it they're subject to an attack where I hand you $7M to look the other way while I borrow your shell.

              So without knowing anyone you are making a value judgement on the (probable?) lack of ethics? Excuse me?

              • ajrossan hour ago
                > You will move the goalpost

                I can't move the goalpost if you won't produce a ball. Who exactly are you thinking of that needs a job but doesn't have one?

                • Foxboronan hour ago
                  > Who exactly are you thinking of that needs a job but doesn't have one?

                  That is not your claim. Your claim is that they "are on the payroll of one of the big tech interests or a foundation funded by them". Which is simply not true.

                  You can easily find several maintainers of these projects doing this as their part-time hobby project, have cut a deal at work or simply don't work at place that funds Linux development.

                  I'm not going to call out individual I know the situation and/or their employment history.

        • embedding-shape2 hours ago
          What is a "economically important project"? A company that makes a lot of money?
        • kolbean hour ago
          > LLVM and Linux get more cash than they can spend. GNU stuff is comparatively impoverished because everyone assumes they'd do it for free anyway. Stuff that ships on a Canonical desktop or RHEL default install gets lots of cash but community favorites like KDE need to make their own way, etc... Also just to be clear: node is filled with povertyware and you should be extremely careful what you grab from npm.

          This is often the problem with charity in general. It's hard to find good organizations that actually need your money. Great ones self-sustain on their own revenue. Good ones are saturated with donations from their own users. There's just a small sliver of projects that are awesome, and could productively use financial support. From personal experience, identifying these is often far more costly than the act of writing a check.

    • whilenot-dev2 hours ago
      *by Nadia Eghbal

      EDIT: or are you rather thinking about the book Working in Public: The Making and Maintenance of Open Source Software?

      • embedding-shape2 hours ago
        Actually, since 2022, Nadia Asparouhova :)

        From a 2022 email:

        > (P.S. I have a new last name! Still transitioning everything over, but I’m now Nadia Asparouhova.)

  • hamandcheese3 hours ago
    I must be the only one in here who thinks $1.5M is a small sum compared to Anthropic's size and the amount of value they have gotten out of Python. Good press is cheaper than I thought.
    • tomComb3 hours ago
      You are right, it is. But it would be a mistake for us to use this opportunity to attack them for it.

      We should applaud their donation today, and at another time assess the meager contributions of many companies that should be shamed.

      • DrBazza2 hours ago
        Every single financial institution on Wall Street, the City of London, Amsterdam, Tokyo, Dubai and so on, uses Python. Very few contribute.

        I've worked at a few that use the 'mold' linker to dramatically reduce their build times. Again, very few contribute. In this particular case, I managed to get one former employer to make a donation.

        But the list goes on.

        Short arms, deep pockets, as the saying goes.

        • tyre2 hours ago
          It’s interesting to see everyone advocate for open source software with permissive licenses, then get mad when companies use them.

          If python wants to require money for updates or for customers over $X in revenue, they can!

          If companies don’t want to donate, they don’t have to just as python contributors don’t have to if they’re annoyed at how it’s used.

    • 1stranger3 hours ago
      All people do here is complain.
      • notyourwork2 hours ago
        We can both applaud the effort and indicate it’s not enough. Two things can be true simultaneously.
    • defraudbah3 hours ago
      that was my first thought too, $1.5M is peanuts for Anthropic, however $1.5M is better than nothing, so it worth some PR too. Good they do, I think we have to encourage companies to do it, shaming will not help.
  • Fokamul3 hours ago
    It's easy to donate, since it's not their money. They are not profitable. Just Nvidia's money, they're paying themselves for new GPUs and datacenters.
  • senko4 hours ago
    • dang5 minutes ago
      Link added above. Thanks!
  • guywithahat3 hours ago
    Which seems intellectually frustrating. The python foundation was only short money because they refused to accept a 1.5 million dollar federal grant from the Trump admin for political reasons (I believe a condition of the money was it couldn't be used for DEI). They have now received 1.5 million from Anthropic, which is VC funded and burning cash.

    I find these matters are often more complex than I can understand from a headline but this feels like Anthropic bailed out the PSF because PSF is making bad management decisions, and bailing them out might be a bad long-term play.

    • bob001a few seconds ago
      If you think the Trump administration wouldn't make up "DEI efforts" and then sue them for much more than $1.5m to exert pressure in other areas then I have a bridge to sell you.
    • nedbat2 hours ago
      Just to clarify: the NSF grant was refused because it required the PSF to abandon all DEI efforts, not just that the grant itself couldn't be used for DEI. Accepting the NSF grant would have required the PSF to forgo one of its core principles. It was the right decision, not bad management.
    • emil-lp3 hours ago
      Perhaps you should do some research before judging the decision making of the PSF.
      • 9rx19 minutes ago
        He did some research. Now he is validating it.

        Believe it or not, not all researched information is accurate. And even when it is accurate it isn't always interpreted correctly. It is not sufficient to simply research something.

        One must also discuss it. That allows revealing what one thinks they know, to help realize what they don't through coordination with others.

        That is what discussion is for. If he already had a perfect picture, what would the point of talking about it be? There isn't one.

      • cmrdporcupine2 hours ago
        Right? "I find these matters are often more complex than I can understand from a headline but this feels like..."

        Drive-by insinuation rather than argumentation.

        • guywithahatan hour ago
          I mean there were conversations in closed rooms nobody outside of the room knows about. What we know publicly is they refused the funding because it required them to drop DEI activities, which not only would have solved their funding issues but was the morally correct thing to do. The PSF should be focused on improving Python, it shouldn't be a political organization.
          • nedbatan hour ago
            OK, thanks for making your position clear. You disagree with some of the core mission of the PSF. Luckily you are in the minority and the PSF is carrying on.
      • 3 hours ago
        undefined
    • 2 hours ago
      undefined
    • larkost2 hours ago
      I don't agree that it was a "bad management decision". The Trump administration has demonstrated that it will play dirty with grants if they perceive that the receiving organization is not towing their political line as closely as they want.

      Not only will they not grant future funds, but they have shown that they will not pay out previously agreed monies, and will even try (with government layers) to pull back funds from groups they have decided "do not align with the governments interests", for however they define that at that moment. There are a long list of court findings that these have been arbitrary and capricious, but every one of those findings (wins) cost the grant receivers a lot of money in court and later fees.

      So any money taken from them is incurring a risk. You can disagree with the Python Foundation's calculus on this (saying it was not that large a risk), but please don't pretend that it was not an actual risk.

    • myko2 hours ago
      > I believe a condition of the money was it couldn't be used for DEI

      This is a morally depraved condition, kudos on them for turning it down

  • simianwords4 hours ago
    Just recently I heard that typed languages are best for agentic programming
    • oefrha3 hours ago
      Just recently I heard that they can donate to “typed languages” too, a donation to one language does’t preclude other donations, and given their cash injections they have a few $1.5m’s to spare.
    • lambdaone4 hours ago
      Python is a typed language. Perhaps you were trying to say something different?
      • simianwords3 hours ago
        Is it static or dynamic? Whatever rust is that python isn’t.
        • __MatrixMan__3 hours ago
          Rust is static. Python is optionally static.
        • lambdaone3 hours ago
          Python type hints are static - at the moment, they are advisory only, but there is an obvious route forward to making Python an (optionally) fully statically typed language by using static type checking on programs before execution.
          • psunavy032 hours ago
            Didn't The Powers That Be™ say that was not going to happen?
          • _cairn2 hours ago
            I might be missing the point but isn’t this what we use mypy et al for today?
      • pantsforbirds3 hours ago
        They clearly meant a statically typed language. Yes Python is Strongly Typed, but I think we all knew what they meant.
    • exceptione3 hours ago
      For any programming really, but I think Python got big due to

        a) the huge influx of beginners into IT,
        b) lots of intro material available in Python and 
        c) having a simple way to run your script and get feedback (same as PHP)
      
      
      I say that as someone urging people to look beyond Python when they master the basics of programming.
      • shadowgovt3 hours ago
        Python has a terseness that is hard to rival. I think that was a major selling point: its constructs and use of whitespace mean that a valid Python program looks pretty close to the pseudo-code one might write to reason out the problem before writing it in another language.
        • exceptione2 hours ago
          I doubt that this is the selling point. Imho it is nothing special compared to Haskell, F# and the likes.
          • shadowgovt6 minutes ago
            Python doesn't require you to understand monads to write useful Python.

            To be clear: Haskell is great, but its entire vibe (lazy evaluation, pure functions) is entirely different from what Python's about. Someone who knows C++ or Java has a much bigger gap to jump to pick up Haskell than to pick up Python.

    • danielbln4 hours ago
      Types are best, period. Whether they are native or hints doesn't really matter for the agent, what matters is the interface contract they provide.
      • simianwords3 hours ago
        I don’t get this argument because if we put the effort to get it typed, we don’t get one of the best benefits - performance.
        • maleldil3 hours ago
          But that's not the argument here. Python type hints allow checking correctness statically, which is what matters for agents.
          • simianwords3 hours ago
            Yes then you might as well use some other language that uses types but also gets you performance. I agree the ecosystem is missing but hey we have LLMs now
            • solumunus3 hours ago
              Performance isn’t the only important metric. There are other pros to weigh. For many apps a language might be performant enough, and bring other pros that make it more appealing than more performant alternatives.
          • wincy2 hours ago
            That’s what makes types easier for me, too, so that makes sense.
          • 9rx2 hours ago
            > Python type hints allow checking correctness statically

            Not really. You can do some basic checking, like ensuring you don't pass a string into where an integer is expected, but your tests required to make sure that you're properly dealing with those integers (Python type hints aren't nearly capable enough to forgo that) would catch that anyway. The LLM doesn't care if the error comes from a type checker or test suite.

            When you get into real statically typed languages there isn't much consideration for Python. Perhaps you can prompt an LLM to build you an extractor, but otherwise, based on what already exists, your best bet is likely Lean extracted to C, imported as a Python module. Easier would be to cut Python out of the picture, though.

            If you are satisfied with the SMT middle-ground, Dafny does support Python as a target. But as the earlier commenter said: Types are best.

        • shadowgovt3 hours ago
          The best benefit depends on your problem domain.

          For a lot of the business world, code flexibility is much more important than speed because speed is bottlenecked not on the architecture but on the humans in the process; your database queries going from two seconds to one second matters little if the human with their squishy eyeballs takes eight seconds to digest and understand the output anyway. But when the business's needs change, you want to change the code supporting them now, and types make it much easier to do that with confidence you aren't breaking some other piece of the problem domain's current solution you weren't thinking about right now (especially if your business is supported by a team of dozens to hundreds of engineers and they each have their own mental model of how it all works).

          Besides... Regarding performance, there is a tiny hit to performance in Python for including the types (not very much at all, having more to do with space efficiency than runtime). Not only do most typed languages not suffer performance hindrance from typing, the typing actually enables their compilation-time performance optimizations. A language that knows "this variable is an int and only and int and always an int" doesn't need any runtime checks to confirm that nobody's trying to squash a string in there because the compiler already did that work by verifying every read and write of the variable to ensure the rules are followed. All that type data is tossed out when the final binary gets built.

    • reactordev4 hours ago
      So add mypy to your pre-commit
      • alex_suzuki3 hours ago
      • simianwords3 hours ago
        All this but none of the performance benefits.
        • __MatrixMan__3 hours ago
          If your code is talking to an LLM, the performance difference between rust and python represents < 0.1% of the time you spend waiting for computers to do stuff. It's just not an important difference.
          • simianwords2 hours ago
            This is clearly not what I'm speaking about - there are only a few applications that talk to an LLM.
            • __MatrixMan__an hour ago
              The article is about Anthropic's contribution to Python. Pretty much all of their code talks to an LLM.

              And just a few comments earlier you said:

              > Just recently I heard that typed languages are best for agentic programming

              Are we not talking about using python (or some alternative) to constrain the behavior of agents?

            • reactordev2 hours ago
              Today…
        • 3 hours ago
          undefined
        • shadowgovt3 hours ago
          It's true; mypy won't make your Python faster. To get something like that, you'd want to use Common LISP and SBCL; the SBCL compiler can use type assertions to actually throw away code-paths that would verify type expectations at runtime (introducing undefined behavior if you violate the type assertions).

          It's pretty great, because you can run it in debug mode where it will assert-fail if your static type assertions are violated, or in optimized mode where those checks (and the code to support multiple types in a variable) go away and instead the program just blows up like a C program with a bad cast does.

          • reactordevan hour ago
            The point about mypy was it does type checking (static analysis) for your Python code. Not speeding it up.
    • dude2507113 hours ago
      For vibe code, since it's not important whether the output works, JavaScript is even better.
    • desireco423 hours ago
      Why is this getting downvoted... it is true. Also it is true that dynamic languages (like Ruby ;) and Python) are more efficient with tokens, like significantly then types like C, C++ or such. But Javascript and Typescript are using twice the tokens of Ruby for example and Clojure is even more efficient, obviosly I would add.
      • minimaxir3 hours ago
        It's not incorrect, but in the context of the given Hacker News submission it reads as "why fund Python at all?"
    • pansa23 hours ago
      AFAICT Python basically is a [statically-]typed language nowadays. Most people are using MyPy or an alternative typechecker, and the community frowns on those who aren’t.
      • embedding-shape3 hours ago
        > Most people are using MyPy or an alternative typechecker, and the community frowns on those who aren’t.

        That's not like a widespread/by-default/de-facto standard across the ecosystem, by a wide margin. Browse popular/trending Python repositories and GitHub sometime and I guess you can see.

        Most of the AI stuff released is still basically using conda or pip for dependencies, more times than not, they don't even share/say what Python version they used. It's basically still the wild west out there.

        Never had anyone "frown" towards me for not using MyPy or any typechecker either, although I get plenty of that from TS fans when I refuse to adopt TS.

        • pansa23 hours ago
          > Never had anyone "frown" towards me for not using MyPy or any typechecker either

          I’ve seen it many times. Here’s one of the more extreme examples, a highly-upvoted comment that describes not using type hints as “catastrophically unprofessional”:

          https://www.reddit.com/r/Python/comments/1iqytkf/python_type...

          • embedding-shape3 hours ago
            But yeah, that's reddit, people/bots rejoice over anything being cargoculted there, and you really can't take any upvote/downvote numbers on reddit seriously, it's all manipulated today.

            Don't read stuff on reddit and use whatever you've "learned" there elsewhere, because it's basically run by moderators who try to profit of their communities these days, hardly any humans left on the subreddits.

            Edit: I really can't stress this enough, don't use upvotes/likes/stars/whatever as an indicator that a person on the internet is right and has a good point, especially not on reddit but I would advice people to not do so on HN either, or any other place. But again, especially on reddit, the upvotes literally count for nothing. Don't pick up advice based on upvoted comments on reddit!

        • __MatrixMan__3 hours ago
          Generally you only get frowned at if you're not using type hints while contributing to a project whose coding standards say "we use type hints here."

          If you're working on a project that doesn't use type hints, there's also plenty of frowning, but that's just because coding without a type checker is kind of painful.

          • embedding-shape3 hours ago
            > Generally you only get frowned at if you're not using type hints while contributing to a project whose coding standards say "we use type hints here."

            Yeah, that obviously makes sense, not following the code guidelines of a project should be frowned upon.

        • shadowgovt3 hours ago
          I think in the case of TS, it's more that JavaScript itself is notoriously trash (I'm not being subjective; see https://www.destroyallsoftware.com/talks/wat), and TypeScript helps paper over like 90% of the holes in JavaScript.

          Python typed or untyped feels like a taste / flexibility / prototyping tradeoff; TypeScript vs. JavaScript feels like "Do you want to get work done or do you want to wrap barbed wire around your ankle and pull?" And I say this as someone who will happily grab JS sometimes (for <1,000 LOC projects that I don't plan to maintain indefinitely or share with other people).

          Plus, TypeScript isn't a strict superset of JavaScript, so choice at the beginning matters; if you start in JS and decide to use TS later, you're going to have to port your code.

          • embedding-shape3 hours ago
            Typed Python vs untyped Python is literally the same as TS vs JS, don't let others fool you into thinking somehow it's different.

            > TypeScript helps paper over like 90% of the holes in JavaScript

            Always kind of baffles me when people say this, how are you actually programming where 90% of the errors/bugs you have are related to types and other things TS addresses? I must be doing something very different when writing JS because while those things happen sometime (once or twice a year maybe?), 90% of the issues I have while programming are domain/logic bugs, and wouldn't be solved by TS in any way.

            • shadowgovt7 minutes ago
              I mean, I'm one of the fools who would fool you into thinking it's different, since I use all four languages. ;)

              I can just skip the mypy run if I want to do untyped Python. I can't skip adding types if I'm writing TypeScript in most contexts; it's not valid TypeScript syntax. Conversely, I can't add types to JavaScript; it's not valid JavaScript syntax (jsdoc tags and running a static checker over that being a different subject, and more akin to the Python situation).

              > how are you actually programming where 90% of the errors/bugs you have are related to types and other things TS addresses

              It's the things in the "wat" video. JavaScript, in general, errs on the side of giving you some answer when you try and do something very unusual with types (like add a boolean to a number or a string to an array) over taking a runtime error. TypeScript will fail to typecheck in most of the places where those operations are techincally correct but surprising as hell in the wrong way unless you explicitly coerce the types to match up.

      • shadowgovt3 hours ago
        It's a pretty nice best-of-both-worlds arrangement. The type information is there, but the program still runs without it (unless one is doing something really fancy, since it does actually make a runtime construct that can be introspected; some ORMs use the static type data to figure out database-to-object bindings). So you can go without types for prototyping, and then when you're happy with your prototype you can let mypy beat you up until the types are sound. There is a small nonzero cost to using the types at runtime (since they do create metadata that doesn't get dropped like in most languages with a static compilation step, like C++ or TypeScript).

        I can name an absolute handful of languages I've used that have that flexibility. Common LISP comes to mind. But in general you get one or the other option.

        • pansa23 hours ago
          > It's a pretty nice best-of-both-worlds arrangement

          It’s also a worst-of-both-worlds arrangement, in that you have to do the extra work to satisfy the type checker but don’t get the benefits of a compiled language in terms of performance and ease-of-deployment, and only partial benefits in terms of correctness (because the type system is unsound).

          AFAIK the Dart team felt this way about optional typing in Dart 1.x, which is why they changed to sound static typing for Dart 2.

          • 9rxan hour ago
            Without dependent typing, it's the worst of all worlds anyway. You have to express types, but they aren't expressive enough to not have to also express the same in tests, leaving this weird place where you have to repeat yourself over and over.

            That was an okay tradeoff for humans writing code as it enables things like the squiggly line as you type for basic mistakes, automatic refactoring, etc. But that stuff makes no difference to LLMs.

  • 3 hours ago
    undefined