We have been developing Pyrefly (a Python type checker and LSP) for several months, which you may have noticed on Pyre’s github. We want to give this community an early preview of what we have been working on, so we created a playground that you can try here:
There is a lot of work left to do, and we hope to have a beta available by PyCon that folks can try in the IDE. The current version isn’t ready to use in your Python project just yet, but we wanted to share our code and high level design which has been promising for modeling some of the trickier type system features to support, like generics and dataclasses.
I just tried running it on a project of mine (yes, I know it is not intended for external use yet); it shows quite a few false positives. Some questions:
We have a generic LSP as part of Pyrefly (pyrefly lsp). We’ve wrapped that into VS Code, but will certainly take contributions for other editors, and might well work to enable them ourselves closer to when it is ready.
Astral is doing impressive work, and it’s exciting to see their contributions to the Python development tooling community. We would love to work with them if they are interested.
Regarding Wasabi, there are currently no plans to release it. However, if there are specific features from Wasabi that you would like to see in Pyrefly or the IDE in general, please feel free to open an issue on our GitHub.
Besides its speed and popularity, are there any other reasons for why you went with rust? And would you, at this point, still recommend it to someone tasked to write a type-checker from scratch?
Speed and popularity were big parts of it. We would have preferred Python, but didn’t think we could hit our ambitious performance goals using Python today (hopefully future work around free-threaded Python and JIT changes that). After ruling out Python, we wanted something that was safe, cross-platform, compiled to WASM (Playground experience). Rust and Go are probably the best choices for those goals, and the team had more experience with Rust.
I am delighted to see more work happening in the Python tooling sphere, especially in type checking. I’d love to use parts of this tool, for example, to build a reference graph of a project (similar to “Go to Definition” features in an LSP but accessing that information programmatically). Just want to suggest keeping the doors open to using the project as a library in other Python / Rust projects.
Hi @tusharsadhwani, we have heard of features similar to this one. It’s not on our immediate roadmap, but something on our radar generally. If you don’t mind explaining what you are hoping to do with a bit more detail in an issue, we can consider it once we have a clearer picture of the larger needs for exporting data out of Pyrefly.