Types in Scala and Dotty
Nice talk about the difference in types at different languages from the scala author.
The following category was used for describing static type systems.
- Type it to the max (Scala, Haskell, OCaml, F#)
- Cutting corners (Dart, Eiffel, Typescript)
- My way or the highway (Go, Pascal, Java4)
Interestingly, each of the category has actively developed ones, like Dart, Go, Scala, along with majority languages like C and Java. It would be indicating the difficulty in optimizing the policy for every problems.
As indicated in the presentation, major part of the scala’s complexity may be coming from the types. When I tried some, understanding type error was difficult. The major pain was to identify how to solve them (how to convert one type to another is sometimes difficult).
dotty seems one trial for alleviating the complexity, and code is uploaded in the following GitHub repository.
Dotty is a platform to try out new language concepts and compiler technologies for Scala. The focus is mainly on simplification. We remove extraneous syntax (e.g. no XML literals), and try to boil down Scala’s types into a smaller set of more fundamental constructors. The theory behind these constructors is researched in DOT, a calculus for dependent object types.