Top 11 Typechecker Open-Source Projects
-
Project mention: RFC: Strictly Typed Reactive Forms Gotchas Every Angular Developer Needs to Know | dev.to | 2022-05-19
Angular is a robust framework suitable for large codebases and enterprise applications. One significant contributing factor is Angular’s support for TypeScript. Angular is built entirely in TypeScript, and because TypeScript is Angular’s primary language, Angular’s documentation treats TypeScript as a first-class citizen.
-
how, when mypy itself has only "type: ignore" as a workaround for many scenarios?
here's a list of 41 issues where either the user or the mypy devs are saying "use type: ignore as a workaround for now":
https://github.com/python/mypy/issues?q=is%3Aopen+label%3Afa...
-
SonarLint
Deliver Cleaner and Safer Code - Right in Your IDE of Choice!. SonarLint is a free and open source IDE extension that identifies and catches bugs and vulnerabilities as you code, directly in the IDE. Install from your favorite IDE marketplace today.
-
Facebook/Instagram uses Pyre which is a typechecker for Python.
-
another library to check typing in python code (by google)
-
-
And for those very specific cases I will use Statically typed, compile-time type-safe raw SQL
-
Project mention: Python’s “Type Hints” are a bit of a disappointment to me | news.ycombinator.com | 2022-04-21
Every point in this blog post strikes me as either (1) unaware of the tooling around python typing other than mypy, or (2) a criticism of static-typing-bolted-on-to-a-dynamically-typed-language, rather than Python's hints. Regarding (1), my advise to OP is to try out Pyright, Pydantic, and Typeguard. Pyright, especailly, is amazing and makes the process of working with type hints 2 or 3 times smoother IMO. And, I don't think points that fall under (2) are fair criticisms of type *hints*. They are called hints for a reason.
Otherwise, here's a point-by-point response, either recommending OP checks out tooling, or showing that the point being made is not specific to Python.
> type hints are not binding.
There are projects [0][1] that allow you to enforce type hints at runtime if you so choose.
It's worth mentioning that this is very analogous to how Typescript does it, in that type info is erased completely at runtime.
> Type checking is your job after all, ...[and that] requires maintenance.
There are LSPs like Pyright[2] (pyright specifically is the absolute best, IMO) that report type errors as you code. Again, this is very very similar to typescript.
> There is an Any type and it renders everything useless
I have never seen a static-typing tool that was bolted on to a dynamically typed language, without an `Any` type, including typescript.
> Duck type compatibility of int and float
The author admits that they cannot state why this behavior is problematic, except for saying that it's "ambiguous".
> Most projects need third-party type hints
Again, this is a criticism of all cases where static types are bolted on dynamically typed languages, not Python's implementation specifically.
> Sadly, dataclasses ignore type hints as well
Pydantic[3] is an amazing data parsing library that takes advantage of type hints, and it's interface is a superset of that of dataclasses. What's more, it underpins FastAPI[4], an amazing API-backend framework (with 44K Github stars).
> Type inference and lazy programmers
The argument of this section boils down to using `Any` as a generic argument not being an error by default. This is configurable to be an error both in Pyright[5], and mypy[6].
> Exceptions are not covered [like Java]
I can't find the interview/presentation, but Guido Van Rossum specifically calls out Java's implementation of "exception annotations" as a demonstration of why that is a bad idea, and that it would never happen in Python. I'm not saying Guido's opinion is the absolute truth, but just letting you know that this is an explicit decision, not an unwanted shortcoming.
[0] https://github.com/RussBaz/enforce
[1] https://github.com/agronholm/typeguard
[2] https://github.com/microsoft/pyright
[3] https://pydantic-docs.helpmanual.io
[4] https://github.com/tiangolo/fastapi
[5] https://github.com/microsoft/pyright/blob/main/docs/configur...
[6] https://mypy.readthedocs.io/en/stable/config_file.html#confv...
-
Scout APM
Less time debugging, more time building. Scout APM allows you to find and fix performance issues with no hassle. Now with error monitoring and external services monitoring, Scout is a developer's best friend when it comes to application development.
-
-
Project mention: SafeScript runtime tool that add checks for JavaScript and TypeScript | reddit.com/r/programming | 2022-02-13
There is also https://github.com/fabiandev/ts-runtime for Typescript that looks more polished. Too bad both these projects were abandoned, it would be such a cleaner alternative to libraries like io-ts.
-
language-incubator
Learning compilers, interpreters, code generation, virtual machines, assemblers, JITs, etc.
Project mention: Jonesforth – A sometimes minimal FORTH compiler and tutorial (2007) | news.ycombinator.com | 2022-05-13It was a lot of fun for me to reimplement this in MIPS assembler on CI20 [0]
JonesForth could be more straightforward in its interpreter part. I tried to make this part as clean as possible, hopefully did not miss anything.
Maybe I will make a RISCV version in my copious free time in the future.
[0] https://github.com/EarlGray/language-incubator/blob/29755c32...
-
Typechecker related posts
- Confusing behavior around typeguarding "this" in a class
- GitHub - microsoft/TypeScript: TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
- How to develop browser extensions
- Understanding TypeScript....My Experience
- inference behavior: what's the source of truth ?
- Why Testing Your Code Is Important
- Announcing TypeScript 4.7 RC
Index
What are some of the best open-source Typechecker projects? This list will help you:
Project | Stars | |
---|---|---|
1 | TypeScript | 80,653 |
2 | mypy | 13,100 |
3 | pyre-check | 5,903 |
4 | pytype | 3,736 |
5 | steep | 1,004 |
6 | Rezoom.SQL | 641 |
7 | enforce | 531 |
8 | hammox | 436 |
9 | ts-runtime | 422 |
10 | language-incubator | 22 |
11 | django-urlconfchecks | 10 |
Are you hiring? Post a new remote job listing for free.