Announcing Dotty 0.4.0-RC1
Today, we are excited to release Dotty version 0.4.0-RC1. This release serves as a technology preview that demonstrates new language features and the compiler supporting them.
If you’re not familiar with Dotty, it's 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 constructs. The theory behind these constructs is researched in DOT, a calculus for dependent object types. You can learn more about Dotty on our website.
This is our fourth scheduled release according to our 6-week release schedule. The previous technology preview improved stability and reliability.
What’s new in the 0.4.0-RC1 technology preview?
Rewritten REPL #2991
The original Dotty REPL was a proof of concept hacked together from an ancient version of the scalac REPL. It worked by creating Scala source files from the user input using string concatenation, this made it easy to adapt it for Dotty since it did not rely on the internals of scalac, but it was also fragile and hard to reason about. The new REPL instead works by manipulating ASTs (Abstract Syntax Trees), this is more robust and will make it easier to develop new features: we have already implemented auto-completion support (by reusing the APIs we had created for the Dotty IDE and we have plans for displaying API documentation in the REPL.
Note that the user interface of the REPL has not changed: like in the old REPL we use code adapted from the Ammonite REPL to provide syntax highlighting, multi-line editing, history, etc.
Scala 2.12 support #2827
Since our first release, it has been possible to use Scala 2 libraries in a Dotty project as explained in the dotty-example-project. Previously, we supported libraries compiled by Scala 2.11, but starting with this release we support Scala 2.12 instead. If your Dotty project has Scala 2 dependencies this change should be transparent for you assuming all your dependencies have been published for 2.12.
Over the last few weeks, we started working on compilation speed with some good results: compiling ScalaPB is now 20% faster than with Dotty 0.3.0-RC2. You can follow along our progress on http://dotty-bench.epfl.ch/.
Trying out Dotty
Scastie, the online Scala playground, supports Dotty. This is an easy way to try Dotty without installing anything.
Using sbt 0.13.13 or newer, do:
sbt new lampepfl/dotty.g8
This will setup a new sbt project with Dotty as compiler. For more details on using Dotty with sbt, see the example project.
It is very easy to start using the Dotty IDE in any Dotty project by following the IDE sections of the getting-started page.
Releases are available for download on the Releases section of the Dotty repository: https://github.com/lampepfl/dotty/releases
We also provide a homebrew package that can be installed by running:
brew install lampepfl/brew/dotty
In case you have already installed Dotty via brew, you should instead update it:
brew upgrade dotty
Let us know what you think!
If you have questions or any sort of feedback, feel free to send us a message on our Gitter channel. If you encounter a bug, please open an issue on GitHub.
Thank you to all the contributors who made this release possible!
git shortlog -sn --no-merges 0.3.0-RC2..0.4.0-RC1 these are:
226 Martin Odersky 112 Felix Mulder 104 Nicolas Stucki 41 Allan Renucci 41 Guillaume Martres 33 liu fengyun 8 Olivier Blanvillain 4 Aggelos Biboudis 3 Dmitry Petrashko 2 Raymond Tay 2 esarbe 2 Enno Runne 1 Brandon Elam Barker 1 Raphael Bosshard 1 Jacob J 1 Aleksander Boruch-Gruszecki 1 Jim Van Horn 1 Matthias Sperl 1 Michal Gutowski
If you want to get your hands dirty and contribute to Dotty, now is a good time to get involved! You can have a look at our Getting Started page for new contributors, the Awesome Error Messages project or some of the simple Dotty issues. They make perfect entry-points into hacking on the compiler.
We are looking forward to having you join the team of contributors.