frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

Open in hackernews

Pyrefly: A new type checker and IDE experience for Python

https://engineering.fb.com/2025/05/15/developer-tools/introducing-pyrefly-a-new-type-checker-and-ide-experience-for-python/
92•homarp•3h ago

Comments

homarp•3h ago
this is the official announcement, but pyrefly was previously discuted a few weeks ago: https://news.ycombinator.com/item?id=43831524

"Today we’re releasing Pyrefly as an alpha. At the same time, we’re busy burning down the long-tail of bugs and features aiming to remove the alpha label this Summer. "

globalnode•2h ago
Its probably cool n' all but fb isnt getting any of my attention. They'd need to come up with AGI for that to happen, and even then I'd shrug it off.
frogperson•1h ago
I agree. I simply can't support anything Mark Zuckerberg does at this point.
surajrmal•1h ago
This is an open source developer tooling project, not a product which Zuckerberg had anything to do with. What's the point of ignoring it?
voidfunc•1h ago
Guilt by association is very in vogue these days
doug_durham•57m ago
These talented engineers could take their skills elsewhere. That's the message.
globalnode•1h ago
> Why we built Pyrefly: Back in 2017, we embarked on a mission to create a type checker that could handle Instagram’s massive codebase of typed Python

They're saying this on fb.com. How does it not have anything to do with fb?

The feedback section takes you to fb's github.

insane_dreamer•26m ago
what if they pull off the metaverse? ;)
kingkongjaffa•2h ago
This is very cool but why wouldn’t they just contribute to uv and ruff and ty https://github.com/astral-sh/ty
ldng•2h ago
NIH + copyright
trostaft•2h ago
Isn't both this and ty MIT license?
djinnish•2h ago
I think astral and meta were both working on their own type-checkers independently. My current understanding is that meta released so they could preempt the initial release of ty. It seems like they're a bit further ahead in development. Not sure if there are going to be any real differences between the two down the line.
bsimpson•1h ago
Sounds a lot like TypeScript and Flow.
surajrmal•1h ago
Typescript was Microsoft though. Meta might have the edge here based on brand awareness, but who knows for sure.
bsimpson•1h ago
Right, and Flow was FB
singhrac•1h ago
Sure, but in this case they are both implementations of a spec defined by PEPs, so a bit more like gcc vs clang (less tightly bound than those, of course, in design decisions). Neither company is trying to invent a new language here.
singhrac•1h ago
I think they've mentioned earlier that it's really just because PyCon is this week (so a good time to announce new Python tooling).
simonw•2h ago
ty is so new right now - it only got its current name a few weeks ago!
baggiponte•1h ago
That’s not true, they have been developing it as red knot for a good while :)
colesantiago•1h ago
Because this has been tested at Meta / Facebook scale which means it's faster for any Python codebase massive and small.

Since Meta built this, I have confidence this will be maintained more than others and I will use this and ask for Pyrefly experience in the future.

WD-42•1h ago
I suggest you try uv and ruff and then see if you still think only companies the size of meta can provide quality tooling.
0xFF0123•1h ago
This feels like a somewhat closed minded approach given both tools are in their infancy
munro•1h ago
That's sort of how I felt about things before, but the reality I believe is we wouldn't have uv if they 'just contributed to poetry'.
mnahkies•1h ago
I tend to agree.

I don't know the differences between the two well enough to know if it was the case here, but in my experience sometimes you need to innovate on a fork, or from scratch in order to create the space/freedom to do so.

Once a project is popular, it's harder to justify and be confident about major changes (aka https://m.xkcd.com/1172/)

koakuma-chan•1h ago
I just ran ty and it can't resolve any imports whereas pyrefly passes. Why would that be? I hate Python so much.
ThePhysicist•2h ago
Seems there are at least three Rust-based competitors for type checkers in Python now (Microsoft, Facebook, Astral), and of course there's still mypy.
morkalork•1h ago
They're all static type checkers right? None for runtime?
Yossarrian22•1h ago
Yes. If you want runtime validation of data you’re taking in people recommended pydantic. If you’re looking for runtime validation within your own code I’ve seen people use beartype, though to be honest I don’t personally understand the value added from it
rationably•1h ago
...or Marshmallow, which allows one to do many complex validations in a relatively trivial manner.
morkalork•1h ago
On one hand, I feel like I've been in a coma since covid because I've just been coasting along with Marshmallow and jsonschema, but on the other hand it's like a lot of the major advances have been in the past couple years. Apparently pydantic got a big version update in 2023? And now all these competing static type checkers?
WD-42•1h ago
Pydantic got the re write in rust treatment so de/serialization is crazy fast now.
notpushkin•1h ago
msgspec must be insanely fast then: https://jcristharif.com/msgspec/benchmarks.html

But of course unless parsing and manipulating JSON is your bottleneck, Pydantic is great, too.

Yossarrian22•1h ago
Close, Microsoft’s type checker Pyright is Typescript. Its still faster than mypy for me though.
chrisweekly•1h ago
Pls forgive my ignorance, but how is Typescript (a superset of Javascript) used to type-check Python?
Yoric•1h ago
There's nothing magical to type-checking Python. You can write this in any programming language. TypeScript is actually a pretty nice language for writing static analysis tools.
thraxil•1h ago
You can write a parser and type checker for pretty much any language in pretty much any language. It's just text files as input and text as output.
phlakaton•2h ago
I'm curious to know more about the Pyre to Pyrefly transition, specifically the rewrite in Rust. Was that merely a case of trading in a lesser-known language for the language du jour? Were there specific advantages they wanted to get out of Rust?
vivzkestrel•1h ago
how does this compare to mypy
aleksanb•1h ago
To repeat an earlier comment of mine from the launch of uv on hn (tl; dr: these new type checkers never support django):

The way these type checkers get fast is usually by not supporting the crazy rich reality of realworld python code.

The reason we're stuck on mypy at work is because it's the only type checker that has a plugin for Django that properly manages to type check its crazy runtime generated methods.

I wish more python tooling took the TS approach of "what's in the wild IS the language", as opposed to a "we only typecheck the constructs we think you SHOULD be using".

fulafel•1h ago
TS has the luxury of being its own distinct language, defining its own semantics and having its own compiler. You could have something like that targeting Python.
tasn•1h ago
1. Maybe it's time to drop the crazy runtime generation and have something statically discoverable, or at least a way to annotate the typing statically.

2. Astral indicated already they plan to just add direct support for Django and other popular languages.

3. As people replied to similar comments on the previous threads (maybe to you?): that's not why ty is fast and why mypy is slow. It's also an easy claim to disprove: run both without plugins and you'll see ty is still 100x+ faster.

WhyNotHugo•39m ago
> 1. Maybe it's time to drop the crazy runtime generation and have something statically discoverable, or at least a way to annotate the typing statically.

That, and duck typing, are one of the biggest things that make Python what it is. If I have to drop all that for type checking and rewrite my code, why would I rewrite it in Python?

dontlaugh•29m ago
Having used Python for many years, it’s the least interesting aspect of the language. Almost all such tricks can be done with compile time meta programming, often even without API changes.
insane_dreamer•28m ago
The only type checker that fully works (meaning it successfully performs the necessary type inference all for inherited objects) for our large and highly modular python codebase, is Pycharm (I'm guessing it's their own custom tool from the ground up? Not really sure, actually.)
adsharma•6m ago
The problem is not with the type checkers.

https://code.djangoproject.com/ticket/32759

Similar (but lesser) problems exist with pydantic and sqlmodel. They're both fine projects except for:

https://www.reddit.com/r/Python/comments/1i5atpy/fquery_meet...

This is a long winded way of saying type checkers will deal with:

  @sqlmodel
  @pydantic
  @dataclass
  class MyModel:
    name: str

a lot better. Move what doesn't fit here to dataclass metadata.
rw2•1h ago
non AI IDEs are going to have a hard time in the future.
bpshaver•28m ago
Unsure how this comment is relevant
lacker•1h ago
I'm a little worried on behalf of the "Python Language Tooling Team" at Meta, because uv has been so popular, and I wouldn't be surprised if ty wins out in this space.

So watch out, or this will become like Atom or Flow, an internal competitor of a technology that is surpassed by the more popular external open source version, leaving the directors/vps muttering to themselves "It's too bad that this team exists at all. Could we get rid of them and just switch to the open source stuff?"

Perhaps just something for the manager (Aaron Pollack?) to keep an eye on....

90s_dev•50m ago
JSX is my favorite thing to come out of Facebook (also the only good thing).
doug_durham•59m ago
Why is "written in Rust" a feature to be mentioned? Who cares? So my type checker has memory protection and is compiled. I'm not running my type checker on an embedded system or in a mission critical service. It seems kind of like "written in Erlang". I'd prefer to have non-performance critical code for Python written in Python. That way the broader community can support and extend it.
tomrod•58m ago
Shortcut for "noticeably fast."

Open source Rust is still review able.

beeb•43m ago
It makes it easy to find performant and quality software by searching for "[insert tool description] rust", I personally don't mind! Seeing how 95% of the tools I use on the daily are written in Rust, I love finding new ones and am rarely disappointed.
mcbuilder•43m ago
I feel like 70% of open source projects on GitHub say written in the language that they were written in
bpshaver•30m ago
I feel like the likelihood that a project will say what language it is written in is much higher if that language is Rust. I like Rust but I do find this trend a little annoying. (Even though I acknowledge that "written in Rust" probably means the tool is relatively new, not buggy, and easy to use.)
immibis•4m ago
That's because the point of writing something in Rust is virtue signaling just as often as it's about the software itself.
lynndotpy•36m ago
Have you used Rust before? As a user, the speed and safety is nice. But as a developer, Rust projects are easier to hack on and contribute to.

That's kind of the whole appeal of Astral. I know Python better than Rust, but it's a lot easier for me to hack on Rust projects. The whole appeal of Astral is that they want to bring Rust-quality tooling to Python.

mdaniel•22m ago
> but it's a lot easier for me to hack on Rust projects

That static typing is nice, I wonder if it's going to catch on one day.

The amount of energy spent trying to bend dynamically types languages into being real ones is just comical. Even the standard library is barely typed, so they give no fucks https://github.com/python/cpython/blob/v3.13.3/Lib/re/__init...

What does it accept? Who knows. What does it return? Don't worry about it

lynndotpy•16m ago
Static typing is a big one, but I've been so steeped in Python that I don't appreciate it as much as maybe I should.

The big thing for me is that most Rust projects are statically(ish) compiled (like go) and only need a `cargo build`. No venvs or pip commands or node/npm/nvm or make, etc.

BrawnyBadger53•7m ago
Hindly Milner type inference needs to catch on
amelius•29m ago
Sounds like a project that is trying to solve too many things at once ...
melodyogonna•16m ago
The Rust code written here is so easy to follow but all these new Python tooling being written in Rust worries me, it adds yes another vector to the N-language problem.

I hope Mojo can offer something here

Customizing kubectl with Kubernetes 1.33

https://cloudfleet.ai/blog/cloud-native-how-to/2025-05-customizing-kubectl-with-kuberc/
1•cagataygurturk•2m ago•0 comments

'Minimalist' quantum computer simulates movements of molecules

https://www.nature.com/articles/d41586-025-01591-1
2•bookofjoe•8m ago•1 comments

A Free Space for Tech, Politics, Philosophy & Blockchain Discussions IRC

https://web.zchat.org/
1•ircevents•12m ago•0 comments

Simple GPT in pure Go, trained on Jules Verne books

https://github.com/zakirullin/gpt-go
2•kombucha255•13m ago•0 comments

Princeton University Library Launches the José Donoso Digital Archive

https://library.princeton.edu/about/library-news/2025/princeton-university-library-launches-jos%C3%A9-donoso-digital-archive
1•gnabgib•13m ago•0 comments

The future isn't 'human and machine' but 'human and human and machine'

https://tushardadlani.com/the-hidden-cost-of-ai-losing-our-human-connections-in-pursuit-of-efficiency
1•tush726•17m ago•1 comments

ZKLP system allows confirming user in a region without exposing exact location

https://www.theregister.com/2025/05/17/privacy_preserving_location_sharing/
1•rntn•18m ago•0 comments

Rutger Bregman Wants to Save Elites from Their Wasted Lives

https://www.nytimes.com/2025/05/17/magazine/rutger-bregman-interview.html
4•umarniz•29m ago•0 comments

Introduction to MCP Security

https://public.support.unisys.com/framework/publicterms.aspx?returnurl=%2faseries%2fdocs%2fClearPath-MCP-20.0%2f26211060-014%2fWebHelp%2fIntroduction_to_Security_Services%2fSecurity_Overview.htm
1•rbanffy•30m ago•0 comments

Prosecutor's audio shows Biden's memory lapses

https://www.axios.com/2025/05/16/biden-hur-tape-special-counsel-audio
5•stikit•31m ago•3 comments

World of Warcraft Player with Disability Completes Elite PvP Set After 9 Years

https://gamerant.com/world-warcraft-player-disability-rival-elite-druid-set-pvp/
1•gamescr•32m ago•0 comments

If nothing is curated, how do we find things

https://tadaima.bearblog.dev/if-nothing-is-curated-how-do-we-find-things/
10•nivethan•33m ago•1 comments

Could SSL.com's Latest Vulnerability Lead to Browser Distrust?

https://trackssl.com/could-ssl-coms-latest-vulnerability-lead-to-browser-distrust/
1•colinbartlett•33m ago•0 comments

Weathering Software Winter

https://100r.co/site/weathering_software_winter.html
2•rbanffy•35m ago•0 comments

Making $3M+ per year with a free product

https://www.indiehackers.com/post/tech/making-3m-per-year-with-a-free-product-axW4u1vB6C8f91Z3Lxu5
1•tony_starkling•37m ago•1 comments

Build a Smart Snack Dispenser with CV

https://codelabs.viam.com/guide/smart-snack-dispenser/index.html#0
1•mooreds•38m ago•0 comments

Traumatic brain injuries in Colorado's mountains outpace state/national averages

https://www.summitdaily.com/news/longevity-headstrong-traumatic-brain-injury-colorado-summit-county/
1•mooreds•39m ago•0 comments

Animal Well taps into PS5 hardware to elevate 2D pixel-art platforming

https://blog.playstation.com/2022/07/20/how-animal-well-taps-into-ps5-hardware-to-elevate-2d-pixel-art-platforming/
1•90s_dev•39m ago•0 comments

AI-powered legal document generator for your website or online business

https://weblegal.ai/en/
1•PlanetIrata•40m ago•1 comments

A simple Neovim plugin to assist with Ruby/Rails and ViewComponent development

https://github.com/body-clock/view-component.nvim
2•mooreds•40m ago•0 comments

Apple's AI partnership with Alibaba raises alarms in Washington

https://9to5mac.com/2025/05/17/us-government-looks-into-apple-alibaba-partnership/
1•retskrad•41m ago•0 comments

Show HN: TripJam – Travel group chat with collaborative map and itinerary

https://app.tripjam.app/expeditions/6d21552b-3c6b-4288-99d0-f31c7704b20e
1•kenforthewin•42m ago•0 comments

An alternative Monty Hall problem

https://statmodeling.stat.columbia.edu/2025/05/17/an-alternative-monty-hall-problem-as-with-the-usual-monty-hall-problem-just-set-it-up-as-a-probability-tree-and-it-all-works-out/
2•Tomte•43m ago•0 comments

When Crows Wore Sunglasses: A Surreal Journey Through Grief, God and Grit

https://open.spotify.com/episode/3K1X2Abm0Z0z9ISaMuQQqQ
1•totaldude87•47m ago•0 comments

My Exobrain

https://www.worthe-it.co.za/blog/2025-05-04-my-exobrain.html
1•ingve•48m ago•0 comments

Gorilla study reveals complex pros and cons of friendship

https://phys.org/news/2025-05-gorilla-reveals-complex-pros-cons.html
3•PaulHoule•52m ago•0 comments

xAI screws up it's system prompt, again

https://theahura.substack.com/p/tech-things-xai-screws-up-its-system
2•theahura•55m ago•0 comments

The EU Is Trying to Regulate AI. But First, It Has to Define It

https://www.sidharthramachandran.com/post/the-eu-is-trying-to-regulate-ai-but-first-it-has-to-define-it
1•sidhusmart•56m ago•0 comments

IBM open sources $300* fully-functional Lego microscope design (2020)

https://ibm-research.medium.com/ibm-open-sources-300-fully-functional-lego-microscope-design-248a6cdc81bf
3•Tomte•58m ago•0 comments

The 3:00 Am Economy: Why Nobody Sleeps Anymore

https://www.clickworlddaily.com/2025/05/the-300-am-economy-why-nobody-sleeps-in.html
1•versiqcontent•59m ago•1 comments