4 ms·
Looking through the code, Pylyzer seems to be a thin wrapper around Erg [1]. To typecheck, it converts your Python AST to an Erg AST, then runs its through the
by bcherny 2y ago
Looking through the code, Pylyzer seems to be a thin wrapper around Erg [1]. To typecheck, it converts your Python AST to an Erg AST, then runs its through the Erg typechecker and returns the errors.
Faster typechecking for Python is very much needed. But this project seems like it was built in a hackathon -- it is not a true standalone typechecker.
[1] https://github.com/erg-lang/erg https://github.com/erg-lang/erg
- andenacitelli 2y agoI dug into Pylyzer a few weeks back when scoping out alternatives for faster type checkers, as we have a lot of brittle Python code that we are gradually migrating in at $DAYJOB. I got the idea in my head to basically build mypy but in Rust, similar to what Ruff has done. My research agrees with your assessment. While I'm sure it's a lot faster (I think the README implies it's one or two magnitudes faster) it just doesn't sit right to me that it's essentially just transpiles to Erg and delegates the actual hard work to the Erg typechecker. This works, but I feel like it fundamentally limits what Pylyzer is capable of, and how much control it really has over the underlying type checking process, as to it, the Erg type checker is essentially a black box. It's a wrapper (a non-trivial one, to its credit -- especially considering everything is a wrapper if you look at it the right way -- but still a wrapper) rather than an actual full solution. There's also really only one maintainer (who seems to do a decent job, but I don't seem to recall much more than just bug fixes). Makes me hesitant to really depend on it sticking around long-term or having features that meaningfully progress in the future.
- cricalix 2y agoDid you come across pyre in your search? MIT license and pretty fast. https://github.com/facebook/pyre-check https://github.com/facebook/pyre-check
- bobbylarrybobby 2y agoThey say as much in the readme
- phaker 2y agoIt's also made by the top contributor to erg (github user mtshiba), and erg is trying to be a compiled typed python. If you're already making that then building a type checker wrapper on top of it makes perfect sense.