If you are a Mac user, you can install Dotty with brew:
brew install lampepfl/brew/dotty
If you are a Linux or Windows user, download the latest release. Optionally add path of the folder
bin/ to the system environment variable
Now you can compile Scala source code:
To start the REPL, run:
Or, you can try Dotty in your browser with Scastie.
Create a Dotty Project
The fastest way to create a new project in Dotty is using sbt (0.13.15+).
Create a Dotty project:
sbt new lampepfl/dotty.g8
Or a Dotty project that cross compiles with Scala 2:
sbt new lampepfl/dotty-cross.g8
For documentation see the Dotty Example Project.
|Union, intersection and literal singleton types||Implemented|
|@static methods and fields||Implemented|
|SBT incremental build||Implemented|
|Option-less pattern matching||Implemented|
|Automatic tupling of function parameters||Implemented|
|Implicit function types||Implemented|
|Phantom types||In progress|
|Whole program optimizer||In progress|
|HList & HMaps/Record types||In progress|
Talks on Dotty?
- Scala's Road Ahead by Martin Odersky (slides)
- Compilers are Databases by Martin Odersky (slides)
- Exploring the future of Scala by Dmitry Petrashko (slides)
- Deep Dive with Dotty
I have more questions!
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.
Is it the future Scala?
Yes, it will be - eventually.
Can I use it?
You can! But it currently comes with no guarantees of stability.
Is there Scala 2 interop?
Dotty currently interops with libraries compiled with Scala 2.11 - but not 2.12
How do I migrate my code to Dotty?
The automated rewriting tool scalafix is planned for Dotty. Scala 2 sources can be compiled to some degree by issuing:
dotc -language:Scala2 file.scala
when compiling your program.
Who’s working on it?
And a long line of contributors!