Comment by djinnish

Comment by djinnish 2 months ago

8 replies

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.

singhrac 2 months 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).

bsimpson 2 months ago

Sounds a lot like TypeScript and Flow.

  • singhrac 2 months 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.

    • maleldil 2 months ago

      The current major type checkers, mypy and pyright, are also based on the same PEPs, but you can still see differences between them. For example, my codebase passes pyright in strict mode, but mypy results in a bunch of type errors. I'd expect pyrefly and ty to be slightly different from each other.

      See also:

      https://github.com/microsoft/pyright/blob/main/docs/mypy-com...

      https://htmlpreview.github.io/?https://github.com/python/typ...

      • singhrac 2 months ago

        Sure, I agree. I’m just saying that most of their defacto disagreements are because of ambiguity in the specs, not because one of them is (intentionally) choosing to fork.

        Fwiw I think performance and features are kind of intertwined here, since Pyright’s extra speed makes it possible to infer more things that are not easy for mypy, especially in an LSP implementation.

        Pyright is very impressive in that second link (conformance check), very much a product of Eric Traut & others dedicating a lot of energy to this single problem.

    • zem 2 months ago

      the specs are still evolving, and the various type checker implementations are what is driving them forward. in general, capturing the dynamic typing semantics of python in a gradually typed system is not a fully solved problem, and the type checkers are experimenting with various approaches to it.

  • surajrmal 2 months ago

    Typescript was Microsoft though. Meta might have the edge here based on brand awareness, but who knows for sure.