2 ms·
Dynamic typing doesn't exclude the compiler from being able to detect some things that would cause errors at run time. It just means that these turn into compi
by pfdietz 3y ago
Dynamic typing doesn't exclude the compiler from being able to detect some things that would cause errors at run time. It just means that these turn into compile time warnings, not compile errors.
In Common Lisp, it's common practice to not accept code unless all such warnings are gone.
- chongli 3y agoThat is static typing. You can add static types to a dynamic language, but then you introduce a compilation step. This is not an argument in favour of dynamic typing. If your language requires a compilation step anyway, then what you have is a static language with only one type: the ‘any’ type. Every argument I’ve seen in favour of dynamic typing is some variation of “I like it this way.” They’re not technical arguments because dynamic typing is a strict subset of a statically typed language, equivalent to passing a flag to turn the type checker off. Sure, not every compiler offers such a flag, but that is an argument against one particular static language (or group of languages), not an argument against static types itself.