|
|
|
|
|
by pron
5188 days ago
|
|
Well, avoiding casts AND supporting inheritance AND having a simple type system is pretty hard. You can usually just pick two of the three. Many prefer static typing, and many don't. BTW, Clojure is indeed dynamically typed, but it has a "type philosophy" that keeps things nice and orderly, namely no encapsulation and uniform data access. |
|
Basically I don't think that Scala's complexity should burn us on type safety in general. I think Go and Dart, for example, are an overreaction to the complexities of type systems like those of Scala (no generics and null pointers in the former, and unsound covariant generics and null pointers in the latter). There is room for a statically typed language that brings the benefits of type safety that make programming easier without the complexities that make programming harder; the fact that we haven't found that sweet spot yet doesn't mean that we should just throw up our hands. I'm not convinced that the sweet spot is either unsound or requires casts.