|
| 1 | +--- |
| 2 | +layout: blog-page |
| 3 | +title: Announcing Dotty 0.7.0 and 0.8.0-RC1 |
| 4 | +author: Allan Renucci |
| 5 | +authorImg: /images/allan.jpg |
| 6 | +date: 2018-04-26 |
| 7 | +--- |
| 8 | + |
| 9 | +Today, we are excited to release Dotty versions 0.7.0 and 0.8.0-RC1. These releases |
| 10 | +serve as a technology preview that demonstrates new language features and the compiler supporting them. |
| 11 | + |
| 12 | +If you’re not familiar with Dotty, it's a platform to try out new language concepts and compiler |
| 13 | +technologies for Scala. The focus is mainly on simplification. We remove extraneous syntax |
| 14 | +(e.g. no XML literals), and try to boil down Scala’s types into a smaller set of more fundamental |
| 15 | +constructs. The theory behind these constructs is researched in |
| 16 | +[DOT](https://infoscience.epfl.ch/record/215280), a calculus for dependent object types. |
| 17 | +You can learn more about Dotty on our [website](https://dotty.epfl.ch). |
| 18 | + |
| 19 | +<!--more--> |
| 20 | + |
| 21 | +This is our eighth scheduled release according to our [6-week release schedule](https://dotty.epfl.ch/docs/usage/version-numbers.html). |
| 22 | +The [previous technology preview](https://github.com/lampepfl/dotty/releases/tag/0.7.0-RC1) simplified |
| 23 | +enums, introduced erased terms, improved IDE support and improved pattern matching for GADT. |
| 24 | + |
| 25 | +## What’s new in the 0.8.0-RC1 technology preview? |
| 26 | + |
| 27 | +### sbt 1 support [#3872](https://github.com/lampepfl/dotty/pull/3872) |
| 28 | +Starting with Dotty 0.8.0, we will only support versions of sbt >= 1.1.4. Migrating to sbt 1 |
| 29 | +lets us use the new improved incremental compiler for Scala called [Zinc](https://github.com/sbt/zinc), |
| 30 | +and enables integration with tools such as [Bloop](https://scalacenter.github.io/bloop/). |
| 31 | + |
| 32 | +### Unchecked warnings [#4045](https://github.com/lampepfl/dotty/pull/4045) |
| 33 | +Dotty now emits `unchecked` warnings like `scalac` whenever a type test is performed but cannot |
| 34 | +safely be checked at runtime. For example: |
| 35 | + |
| 36 | +```scala |
| 37 | +scala> def foo(x: Any) = x.isInstanceOf[List[String]] |
| 38 | +1 |def foo(x: Any) = x.isInstanceOf[List[String]] |
| 39 | + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 40 | + | the type test for List[String] cannot be checked at runtime |
| 41 | +``` |
| 42 | + |
| 43 | +### Kind Polymorphism [#4108](https://github.com/lampepfl/dotty/pull/4108) |
| 44 | +Normally type parameters in Scala are partitioned into kinds. First-level types are types of values. |
| 45 | +Higher-kinded types are type constructors such as `List` or `Map`. The kind of a type is indicated |
| 46 | +by the top type of which it is a subtype. Normal types are subtypes of `Any`, covariant single |
| 47 | +argument type constructors such as List are subtypes of `[+X] => Any`, and the `Map` type |
| 48 | +constructor is a subtype of `[X, +Y] => Any`. |
| 49 | + |
| 50 | +Sometimes we would like to have type parameters that can have more than one kind, for instance to |
| 51 | +define an implicit value that works for parameters of any kind. This is now possible through a form |
| 52 | +of (subtype) kind polymorphism. Kind polymorphism relies on the special type `scala.AnyKind` that |
| 53 | +can be used as an upper bound of a type. |
| 54 | + |
| 55 | +```scala |
| 56 | +def f[T <: AnyKind] = .. |
| 57 | +``` |
| 58 | + |
| 59 | +The actual type arguments of f can then be types of arbitrary kinds. So the following would all be |
| 60 | +legal: |
| 61 | + |
| 62 | +```scala |
| 63 | +f[Int] |
| 64 | +f[List] |
| 65 | +f[Map] |
| 66 | +f[[X] => String] |
| 67 | +``` |
| 68 | + |
| 69 | +For more information, visit the [Kind Polymorphism](https://dotty.epfl.ch/docs/reference/kind-polymorphism.html) |
| 70 | +section of our documentation. |
| 71 | + |
| 72 | +### Improved support for SAM type [#4152](https://github.com/lampepfl/dotty/pull/4152) |
| 73 | +This release includes fixes to SAM types that greatly improve interoperability with Java 8 lamdas. |
| 74 | +One can now easely write Scala code that uses Java streams: |
| 75 | + |
| 76 | +```scala |
| 77 | +val myList = |
| 78 | + java.util.Arrays.asList("a1", "a2", "b1", "c2", "c1") |
| 79 | + |
| 80 | +myList |
| 81 | + .stream |
| 82 | + .filter(s => s.startsWith("c")) |
| 83 | + .map(_.toUpperCase) |
| 84 | + .sorted |
| 85 | + .forEach(println(_)) |
| 86 | + |
| 87 | +// C1 |
| 88 | +// C2 |
| 89 | +``` |
| 90 | + |
| 91 | +## Trying out Dotty |
| 92 | +### Scastie |
| 93 | +[Scastie], the online Scala playground, supports Dotty. |
| 94 | +This is an easy way to try Dotty without installing anything. |
| 95 | + |
| 96 | +### sbt |
| 97 | +Using sbt 1.1.4 or newer, do: |
| 98 | + |
| 99 | +```shell |
| 100 | +sbt new lampepfl/dotty.g8 |
| 101 | +``` |
| 102 | + |
| 103 | +This will setup a new sbt project with Dotty as compiler. For more details on |
| 104 | +using Dotty with sbt, see the |
| 105 | +[example project](https://github.com/lampepfl/dotty-example-project). |
| 106 | + |
| 107 | +### IDE support |
| 108 | +It is very easy to start using the Dotty IDE in any Dotty project by following |
| 109 | +the [IDE guide](https://dotty.epfl.ch/docs/usage/ide-support.html). |
| 110 | + |
| 111 | + |
| 112 | +### Standalone installationSymb |
| 113 | +Releases are available for download on the _Releases_ |
| 114 | +section of the Dotty repository: |
| 115 | +[https://github.com/lampepfl/dotty/releases](https://github.com/lampepfl/dotty/releases) |
| 116 | + |
| 117 | +We also provide a [homebrew](https://brew.sh/) package that can be installed by running: |
| 118 | + |
| 119 | +```shell |
| 120 | +brew install lampepfl/brew/dotty |
| 121 | +``` |
| 122 | + |
| 123 | +In case you have already installed Dotty via brew, you should instead update it: |
| 124 | + |
| 125 | +```shell |
| 126 | +brew upgrade dotty |
| 127 | +``` |
| 128 | + |
| 129 | +## Let us know what you think! |
| 130 | +If you have questions or any sort of feedback, feel free to send us a message on our |
| 131 | +[Gitter channel](https://gitter.im/lampepfl/dotty). If you encounter a bug, please |
| 132 | +[open an issue on GitHub](https://github.com/lampepfl/dotty/issues/new). |
| 133 | + |
| 134 | +## Contributing |
| 135 | +Thank you to all the contributors who made this release possible! |
| 136 | + |
| 137 | +According to `git shortlog -sn --no-merges 0.7.0..0.8.0-RC1` these are: |
| 138 | + |
| 139 | +``` |
| 140 | +TODO |
| 141 | +``` |
| 142 | + |
| 143 | +If you want to get your hands dirty and contribute to Dotty, now is a good time to get involved! |
| 144 | +Head to our [Getting Started page for new contributors](https://dotty.epfl.ch/docs/contributing/getting-started.html), |
| 145 | +and have a look at some of the [good first issues](https://github.com/lampepfl/dotty/issues?q=is%3Aissue+is%3Aopen+label%3Aexp%3Anovice). |
| 146 | +They make perfect entry-points into hacking on the compiler. |
| 147 | + |
| 148 | +We are looking forward to having you join the team of contributors. |
| 149 | + |
| 150 | +## Library authors: Join our community build |
| 151 | +Dotty now has a set of widely-used community libraries that are built against every nightly Dotty |
| 152 | +snapshot. Currently this includes ScalaPB, algebra, scalatest, scopt and squants. |
| 153 | +Join our [community build](https://github.com/lampepfl/dotty-community-build) |
| 154 | +to make sure that our regression suite includes your library. |
| 155 | + |
| 156 | + |
| 157 | +[Scastie]: https://scastie.scala-lang.org/?target=dotty |
| 158 | + |
| 159 | +[@odersky]: https://github.com/odersky |
| 160 | +[@DarkDimius]: https://github.com/DarkDimius |
| 161 | +[@smarter]: https://github.com/smarter |
| 162 | +[@felixmulder]: https://github.com/felixmulder |
| 163 | +[@nicolasstucki]: https://github.com/nicolasstucki |
| 164 | +[@liufengyun]: https://github.com/liufengyun |
| 165 | +[@OlivierBlanvillain]: https://github.com/OlivierBlanvillain |
| 166 | +[@biboudis]: https://github.com/biboudis |
| 167 | +[@allanrenucci]: https://github.com/allanrenucci |
| 168 | +[@Blaisorblade]: https://github.com/Blaisorblade |
| 169 | +[@Duhemm]: https://github.com/duhemm |
0 commit comments