4 ms·
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.
by ThePhysicist 1y 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 1y agoThey're all static type checkers right? None for runtime?
- Yossarrian22 1y agoYes. 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 1y ago...or Marshmallow, which allows one to do many complex validations in a relatively trivial manner.
- morkalork 1y agoOn 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 1y agoPydantic got the re write in rust treatment so de/serialization is crazy fast now.
- notpushkin 1y agomsgspec must be insanely fast then: https://jcristharif.com/msgspec/benchmarks.html https://jcristharif.com/msgspec/benchmarks.html But of course unless parsing and manipulating JSON is your bottleneck, Pydantic is great, too.
- espdev 1y agoIt's true. msgspec has incredibly fast msgpack serialization. It's a shame so few people know about it.
- notpushkin 1y agoJSON, too!
- Yossarrian22 1y agoClose, Microsoft’s type checker Pyright is Typescript. Its still faster than mypy for me though.
- chrisweekly 1y agoPls forgive my ignorance, but how is Typescript (a superset of Javascript) used to type-check Python?
- Yoric 1y agoThere'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.
- deleted 1y ago[deleted]
- thraxil 1y agoYou 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.
- ItsHarper 1y agoThey're saying pyright is a Python type checker, but it's written in Typescript, not Rust.
- dist-epoch 1y agojust like the Python compiler/interpreter is written in C.
- deleted 1y ago[deleted]
- deleted 1y ago[deleted]