News for hackers. Stuff that matters.
Re:Ty: A fast Python type checker and language server by dcreager on Wednesday May 07, 2025 @03:41PM (#43919844)
There is a formal grammar defined in the CPython repo, implemented in a language called ASDL:

https://github.com/python/cpython/blob/main/Parser/Python.as...

ty uses the same AST and parser as ruff. We don't use the ASDL grammar directly, because we store a few syntax nodes differently internally than how they're represented upstream. Our parser is hand-written in Rust. At first, our AST was also entirely hand-written, though we're moving in the direction of auto-generating more of it from a declarative grammar.

https://github.com/astral-sh/ruff/issues/15655

https://github.com/astral-sh/ruff/tree/main/crates/ruff_pyth...

https://github.com/astral-sh/ruff/blob/main/crates/ruff_pyth...

Re:Ty: A fast Python type checker and language server by zanie on Wednesday May 07, 2025 @03:52PM (#43919941)
ditto! but we gave impressively non-overlapping answers