▲ | derriz 4 days ago | |
Typescript demonstrates that you can have a fully dynamic language but also provide a type system which can support as much (or as little) type checking as is appropriate or desired. I can take my chances in Typescript by just using 'any' everywhere but if I do want to constrain variables to particular types, the compiler will fully support me and provide guarantees about the restrictions I've specified via the type signatures. | ||
▲ | akkad33 4 days ago | parent [-] | |
It sounds exactly the same as Python with pyright or mypy. A novel approach is taken by Elixir, which actually makes sure the compile time types match runtime types. That is , you can't call a function with an incorrect input type at runtime https://elixir-lang.org/blog/2023/09/20/strong-arrows-gradua... |