I am reading about Scala 3 and discovered dotty. I am trying to understand what it is. Somewhere I read "It is new compiler", somewhere I read "It is part of Scala 3", and somewhere I read "Dotty is new Scala 3".
Can somebody please explain to me what exactly dotty is? In layman's and technical terms?
PS: I have already read the tag info of dotty on StackOverflow but didn't really understand it.
Let me explain with foundation of Scala 3:
The Dependent Object Types (DOT) is a new foundation for Scala which is to be Scala 3. DOT is a core calculus for path-dependent types which enhance Scala language and its type systems to next level.
According to this blog by Martin Odersky:
"What do you get if you boil Scala on a slow flame and wait until all incidental features evaporate and only the most concentrated essence remains? After doing this for 8 years we believe we have the answer: it’s DOT, the calculus of dependent object types, that underlies Scala."
Therefore, In Scala 3, DOT - Dependent Object Type, has been implemented as foundation of Scala and DOTTY is a project for the development of Scala 3 with DOT. In addition, Scala 3 works on new compiler which is also called Dotty that support DOT and which is more powerful that current version of Scala compiler. Technically, For Scala 2 and below, scalac
is compiler, but for Scala 3, dotc
is a compiler.
So, the language specification are the same in Scala 2(below) and Scala 3, but the compiler is new which desugar to DOT. Also, with DOT as foundation, there are additional new features in Scala 3 e.g. union types, intersection-type etc.
Is DOTTY is new programming language?
No. Dotty is the project name for a language and compiler that is slated to become Scala 3.0, That means, DOTTY is next version of Scala programming language, with a new compiler (also called Dotty).
I hope this will give you beginner insight to dotty.