3 ms·
> then why are languages only one or the other, never both? what do you mean by that ? multiple statically-typed languages have "var" or "any" types which can
by jcelerier 8y ago
> then why are languages only one or the other, never both?
what do you mean by that ? multiple statically-typed languages have "var" or "any" types which can be used to go from the static to the dynamic typing world.
- chongli 8y ago"Any" types do not imply dynamic typing. Languages like Haskell are purely statically typed yet do not require explicit, concrete types for everything. Type inference is the feature which bridges this gap.
- jcelerier 8y agotype inference and "any" types are completely different. e.g. in C++, auto var = 123; is inference, but std::any var2 = 123; is dynamic typing, because you can do `var2 = "foo bar";` unlike the first case.