|
| 1 | +--- |
| 2 | +layout: blog-page |
| 3 | +title: Announcing Dotty 0.9.0-RC1 |
| 4 | +author: Allan Renucci |
| 5 | +authorImg: /images/allan.jpg |
| 6 | +date: 2018-07-06 |
| 7 | +--- |
| 8 | + |
| 9 | +Today, we are excited to release Dotty version 0.9.0-RC1. This release serves as a technology |
| 10 | +preview that demonstrates new language features and the compiler supporting them. |
| 11 | + |
| 12 | +Dotty is the project name for technologies that are considered for inclusion in Scala 3. Scala has |
| 13 | +pioneered the fusion of object-oriented and functional programming in a typed setting. Scala 3 will |
| 14 | +be a big step towards realizing the full potential of these ideas. Its main objectives are to |
| 15 | + |
| 16 | +- become more opinionated by promoting programming idioms we found to work well, |
| 17 | +- simplify where possible, |
| 18 | +- eliminate inconsistencies and surprising behaviors, |
| 19 | +- build on strong foundations to ensure the design hangs well together, |
| 20 | +- consolidate language constructs to improve the language’s consistency, safety, ergonomics, and performance. |
| 21 | + |
| 22 | +You can learn more about Dotty on our [website](https://dotty.epfl.ch). |
| 23 | + |
| 24 | +<!--more--> |
| 25 | + |
| 26 | +This is our ninth scheduled release according to our [6-week release schedule](https://dotty.epfl.ch/docs/usage/version-numbers.html). |
| 27 | +The [previous technology preview](https://github.com/lampepfl/dotty/releases/tag/0.8.0-RC1) added |
| 28 | +support for sbt 1, introduced improved unchecked warnings and improved SAM type support. |
| 29 | + |
| 30 | +## What’s new in the 0.9.0-RC1 technology preview? |
| 31 | + |
| 32 | +### Improved REPL [#4680](https://github.com/lampepfl/dotty/pull/4680) |
| 33 | +The REPL now uses [JLine 3](https://github.com/jline/jline3) under the hood which improves on |
| 34 | +many aspects such as auto-completions and multi-line editing. The REPL now also works on Windows! |
| 35 | + |
| 36 | +### Documentation support in the IDE [#4461](https://github.com/lampepfl/dotty/pull/4461), [#4648](https://github.com/lampepfl/dotty/pull/4648) |
| 37 | +The Dotty IDE will now display documentation on code hover for symbols that were previously |
| 38 | +compiled by the Dotty compiler. In the future, we plan to let users query the documentation |
| 39 | +in the REPL as well. |
| 40 | + |
| 41 | +### Drop requirement that implicit and functions must be non-empty [#4549](https://github.com/lampepfl/dotty/pull/4549) |
| 42 | +We decided to remove an arbitrary restriction that implicit and functions must be non-empty. |
| 43 | +We can now write: |
| 44 | +```scala |
| 45 | +type IntProducer = implicit () => Int |
| 46 | + |
| 47 | +def prod1: IntProducer = 1 |
| 48 | +val prod2: IntProducer = 2 |
| 49 | +``` |
| 50 | + |
| 51 | +An interesting observation is that by-name parameters can now be encoded as implicit function types: |
| 52 | +```scala |
| 53 | +def timed[T](op: => T) = ... |
| 54 | +def timed[T](op: implicit () => T) = ... |
| 55 | + |
| 56 | +timed { |
| 57 | + fetch(url) |
| 58 | +} |
| 59 | +``` |
| 60 | + |
| 61 | +Both definitions above are equivalent. |
| 62 | + |
| 63 | +### Emit feature warnings for implicit conversions [#4229](https://github.com/lampepfl/dotty/pull/4229) |
| 64 | +Implicit conversions are easily the most misused feature in Scala. We now emit feature warnings |
| 65 | +when encountering an implicit conversion definition, just like Scala 2 does. |
| 66 | + |
| 67 | +In addition, we also emit a feature warning when an implicit conversion is used, |
| 68 | +unless the conversion is an implicit class, or otherwise co-defined with the type |
| 69 | +to which it converts, or the conversion is predefined in `scala.Predef` or is the |
| 70 | +`scala.reflect.Selectable.reflectiveSelect` conversion (we might extend this to more conversions). |
| 71 | + |
| 72 | +### Optimise s and raw interpolators [#3961](https://github.com/lampepfl/dotty/pull/4229) |
| 73 | +`s` and `raw` string interpolators were known to be slower than their not type-safe counterparts: |
| 74 | +```scala |
| 75 | +s"Hello $name!" |
| 76 | + |
| 77 | +// versus |
| 78 | +"Hello " + name + "!" |
| 79 | +``` |
| 80 | +The compiler will now desugar the former into the later. Special thanks to |
| 81 | +[Wojtek Swiderski](https://github.com/Wojtechnology) who contributed this feature to the Dotty |
| 82 | +compiler! |
| 83 | + |
| 84 | +## Trying out Dotty |
| 85 | + |
| 86 | +### sbt |
| 87 | +Using sbt 1.1.4 or newer, do: |
| 88 | + |
| 89 | +```shell |
| 90 | +sbt new lampepfl/dotty.g8 |
| 91 | +``` |
| 92 | + |
| 93 | +This will setup a new sbt project with Dotty as compiler. For more details on |
| 94 | +using Dotty with sbt, see the |
| 95 | +[example project](https://github.com/lampepfl/dotty-example-project). |
| 96 | + |
| 97 | +### IDE support |
| 98 | +It is very easy to start using the Dotty IDE in any Dotty project by following |
| 99 | +the [IDE guide](https://dotty.epfl.ch/docs/usage/ide-support.html). |
| 100 | + |
| 101 | + |
| 102 | +### Standalone installation |
| 103 | +Releases are available for download on the _Releases_ |
| 104 | +section of the Dotty repository: |
| 105 | +[https://github.com/lampepfl/dotty/releases](https://github.com/lampepfl/dotty/releases) |
| 106 | + |
| 107 | +We also provide a [homebrew](https://brew.sh/) package that can be installed by running: |
| 108 | + |
| 109 | +```shell |
| 110 | +brew install lampepfl/brew/dotty |
| 111 | +``` |
| 112 | + |
| 113 | +In case you have already installed Dotty via brew, you should instead update it: |
| 114 | + |
| 115 | +```shell |
| 116 | +brew upgrade dotty |
| 117 | +``` |
| 118 | + |
| 119 | +### Scastie |
| 120 | +[Scastie], the online Scala playground, supports Dotty. This is an easy way to try Dotty without |
| 121 | +installing anything. Note however that Scastie only supports Dotty 0.7.0-RC1. |
| 122 | + |
| 123 | +## Let us know what you think! |
| 124 | +If you have questions or any sort of feedback, feel free to send us a message on our |
| 125 | +[Gitter channel](https://gitter.im/lampepfl/dotty). If you encounter a bug, please |
| 126 | +[open an issue on GitHub](https://github.com/lampepfl/dotty/issues/new). |
| 127 | + |
| 128 | +## Contributing |
| 129 | +Thank you to all the contributors who made this release possible! |
| 130 | + |
| 131 | +According to `git shortlog -sn --no-merges 0.8.0..0.9.0-RC1` these are: |
| 132 | + |
| 133 | +``` |
| 134 | +TODO |
| 135 | +``` |
| 136 | + |
| 137 | +If you want to get your hands dirty and contribute to Dotty, now is a good time to get involved! |
| 138 | +Head to our [Getting Started page for new contributors](https://dotty.epfl.ch/docs/contributing/getting-started.html), |
| 139 | +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). |
| 140 | +They make perfect entry-points into hacking on the compiler. |
| 141 | + |
| 142 | +We are looking forward to having you join the team of contributors. |
| 143 | + |
| 144 | +## Library authors: Join our community build |
| 145 | +Dotty now has a set of widely-used community libraries that are built against every nightly Dotty |
| 146 | +snapshot. Currently this includes ScalaPB, algebra, scalatest, scopt and squants. |
| 147 | +Join our [community build](https://github.com/lampepfl/dotty-community-build) |
| 148 | +to make sure that our regression suite includes your library. |
| 149 | + |
| 150 | + |
| 151 | +[Scastie]: https://scastie.scala-lang.org/?target=dotty |
| 152 | + |
| 153 | +[@odersky]: https://github.com/odersky |
| 154 | +[@DarkDimius]: https://github.com/DarkDimius |
| 155 | +[@smarter]: https://github.com/smarter |
| 156 | +[@felixmulder]: https://github.com/felixmulder |
| 157 | +[@nicolasstucki]: https://github.com/nicolasstucki |
| 158 | +[@liufengyun]: https://github.com/liufengyun |
| 159 | +[@OlivierBlanvillain]: https://github.com/OlivierBlanvillain |
| 160 | +[@biboudis]: https://github.com/biboudis |
| 161 | +[@allanrenucci]: https://github.com/allanrenucci |
| 162 | +[@Blaisorblade]: https://github.com/Blaisorblade |
| 163 | +[@Duhemm]: https://github.com/Duhemm |
0 commit comments