|
| 1 | +--- |
| 2 | +layout: blog-page |
| 3 | +title: Announcing Dotty 0.17.0-RC1 – new implicit scoping rules and more |
| 4 | +author: Anatolii Kmetiuk |
| 5 | +date: 2019-07-25 |
| 6 | +--- |
| 7 | + |
| 8 | +Greetings! With this post, we are proud to announce the 17th release of Dotty. With this release, we are making steady progress on the metaprogramming capabilities of Scala 3. Also, implicit scoping rules have seen a rework and a bunch of organizational changes took place. |
| 9 | + |
| 10 | +This release serves as a technology preview that demonstrates new |
| 11 | +language features and the compiler supporting them. |
| 12 | + |
| 13 | +Dotty is the project name for technologies that are being considered for |
| 14 | +inclusion in Scala 3. Scala has pioneered the fusion of object-oriented and |
| 15 | +functional programming in a typed setting. Scala 3 will be a big step towards |
| 16 | +realising the full potential of these ideas. Its main objectives are to |
| 17 | + |
| 18 | +- become more opinionated by promoting programming idioms we found to work well, |
| 19 | +- simplify where possible, |
| 20 | +- eliminate inconsistencies and surprising behaviours, |
| 21 | +- build on strong foundations to ensure the design hangs together well, |
| 22 | +- consolidate language constructs to improve the language’s consistency, safety, ergonomics, and |
| 23 | + performance. |
| 24 | + |
| 25 | +You can learn more about Dotty on our [website](https://dotty.epfl.ch). |
| 26 | + |
| 27 | +<!--more--> |
| 28 | + |
| 29 | +This is our 17th scheduled release according to our |
| 30 | +[6-week release schedule](https://dotty.epfl.ch/docs/contributing/release.html). |
| 31 | + |
| 32 | +# What’s new in the 0.17.0-RC1 technology preview? |
| 33 | +## New implicit scoping rules |
| 34 | +We aim to make the implicit scoping rules clean and intuitive. In this release, the scoping rules were refactored to facilitate this goal. As specified in the [code documentation](https://github.com/lampepfl/dotty/pull/6832/files#diff-584b631c45ba6f2d4bc5d803074b8f12R474): |
| 35 | + |
| 36 | +The implicit scope of a type `tp` is the smallest set S of object references (i.e. TermRefs |
| 37 | +with Module symbol) such that: |
| 38 | + |
| 39 | +- If `tp` is a class reference, S contains a reference to the companion object of the class, |
| 40 | + if it exists, as well as the implicit scopes of all of `tp`'s parent class references. |
| 41 | +- If `tp` is an opaque type alias `p.A` of type `tp'`, S contains a reference to an object `A` defined in the |
| 42 | + same scope as the opaque type, if it exists, as well as the implicit scope of `tp'`. |
| 43 | +- If `tp` is a reference `p.T` to a class or opaque type alias, S also contains all object references |
| 44 | + on the prefix path `p`. Under Scala-2 mode, package objects of package references on `p` also |
| 45 | + count towards the implicit scope. |
| 46 | +- If `tp` is a (non-opaque) alias of `tp'`, S contains the implicit scope of `tp'`. |
| 47 | +- If `tp` is a singleton type, S contains the implicit scope of its underlying type. |
| 48 | +- If `tp` is some other type, its implicit scope is the union of the implicit scopes of |
| 49 | + its parts (parts defined as in the spec). |
| 50 | + |
| 51 | +You can learn more from PR [#6832](https://github.com/lampepfl/dotty/pull/6832). |
| 52 | + |
| 53 | +## Metaprogramming |
| 54 | +We are making steady progress developing metaprogramming features. The highlights for this release are: |
| 55 | + |
| 56 | +- Tasty Reflection's `Reflection` object moved inside `QuoteContext` object. This means that if previously to do Tasty Reflection you had to implicitly depend on `Reflection`, now you need to depend on `QuoteContext`. To know more, see [#6723](https://github.com/lampepfl/dotty/pull/6723). |
| 57 | +- Progress made on quoted patterns – see [#6504](https://github.com/lampepfl/dotty/pull/6504). |
| 58 | +- `code` string interpolator allows to obtain the code a user passes to a macro as a String. See [#6661](https://github.com/lampepfl/dotty/pull/6661). To enable this feature, do the following import: `import scala.compiletime._`. |
| 59 | + |
| 60 | +## 2.12 build removed from the CI tests |
| 61 | +2.12 build is removed from the test suite. The 2.12 build compiled and tested the Dotty compiler with the Scala 2.12 compiler. This means that, even though Dotty is bootstrapped (i.e. capable of compiling itself), we were not able to use any of the new Dotty features in the Dotty codebase since these features would not compile with Scala 2.12. The decision to abstain from using the new features was made to give us the time to see if something goes wrong with the bootstrap and the ability to revert to Scala 2.12 if it becomes necessary. |
| 62 | + |
| 63 | +The removal of 2.12 build marks the stage in Dotty's life when we start to actively use new Dotty features in our code base, making it incompatible with Scala 2. |
| 64 | + |
| 65 | +## Other changes |
| 66 | +There were some organizational and infrastructural changes worth mentioning. |
| 67 | + |
| 68 | +- [Shapeless 3](https://github.com/milessabin/shapeless/tree/shapeless-3) was added to the community build. This means that all the new Dotty features are now tested for the ability to compile Shapeless 3 with them. |
| 69 | +- The process of submitting issues to the Dotty issue tracker is standardized using a GitHub issue template. We have separate templates for bugs, compiler crashes and language feature requests. The latter are now not allowed in the main Dotty repository, and the template for feature requests redirects users to a separate repo meant solely for such requests. |
| 70 | +- Dotty Knowledge Collection initiative. To improve the documentation of the compiler, we came up with an idea of a separate repo where we will log the raw, unrefined knowledge about the compiler internals. This e.g. can be a quick catch we learnt while working that we believe is worth saving somewhere. To read more about the idea, see the [dotty-knowledge](https://github.com/lampepfl/dotty-knowledge) repo's README. |
| 71 | +- `f`-interpolator was implemented as a macro – see the [Scala 2 documentation](https://docs.scala-lang.org/overviews/core/string-interpolation.html#the-f-interpolator) to learn more about what it is. |
| 72 | + |
| 73 | +# Let us know what you think! |
| 74 | + |
| 75 | +If you have questions or any sort of feedback, feel free to send us a message on our |
| 76 | +[Gitter channel](https://gitter.im/lampepfl/dotty). If you encounter a bug, please |
| 77 | +[open an issue on GitHub](https://github.com/lampepfl/dotty/issues/new). |
| 78 | + |
| 79 | +## Contributing |
| 80 | + |
| 81 | +Thank you to all the contributors who made this release possible! |
| 82 | + |
| 83 | +According to `git shortlog -sn --no-merges 0.16.0-RC3..0.17.0-RC1` these are: |
| 84 | + |
| 85 | +``` |
| 86 | + 119 Martin Odersky |
| 87 | + 103 Nicolas Stucki |
| 88 | + 38 Liu Fengyun |
| 89 | + 33 Guillaume Martres |
| 90 | + 33 Sara Alemanno |
| 91 | + 17 Anatolii |
| 92 | + 10 Aggelos Biboudis |
| 93 | + 6 Miles Sabin |
| 94 | + 5 Anatolii Kmetiuk |
| 95 | + 4 Olivier Blanvillain |
| 96 | + 4 Robert Stoll |
| 97 | + 3 odersky |
| 98 | + 2 Dale Wijnand |
| 99 | + 2 Timothée Floure |
| 100 | + 2 Rodrigo Fernandes |
| 101 | + 2 James Thompson |
| 102 | + 2 Steven Heidel |
| 103 | + 1 Stéphane MICHELOUD |
| 104 | + 1 bishabosha |
| 105 | + 1 noti0na1 |
| 106 | + 1 Daniel Reigada |
| 107 | + 1 Haemin Yoo |
| 108 | + 1 Bunyod |
| 109 | + 1 Deon Taljaard |
| 110 | + 1 Ondra Pelech |
| 111 | + 1 Jon Pretty |
| 112 | +``` |
| 113 | + |
| 114 | +If you want to get your hands dirty and contribute to Dotty, now is a good time to get involved! |
| 115 | +Head to our [Getting Started page for new contributors](https://dotty.epfl.ch/docs/contributing/getting-started.html), |
| 116 | +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). |
| 117 | +They make perfect entry points into hacking on the compiler. |
| 118 | + |
| 119 | +We are looking forward to having you join the team of contributors. |
| 120 | + |
| 121 | +## Library authors: Join our community build |
| 122 | + |
| 123 | +Dotty now has a set of widely-used community libraries that are built against every nightly Dotty |
| 124 | +snapshot. Currently this includes ScalaPB, algebra, scalatest, scopt and squants. |
| 125 | +Join our [community build](https://github.com/lampepfl/dotty-community-build) |
| 126 | +to make sure that our regression suite includes your library. |
| 127 | + |
| 128 | +[Scastie]: https://scastie.scala-lang.org/?target=dotty |
| 129 | + |
| 130 | +[@odersky]: https://github.com/odersky |
| 131 | +[@DarkDimius]: https://github.com/DarkDimius |
| 132 | +[@smarter]: https://github.com/smarter |
| 133 | +[@felixmulder]: https://github.com/felixmulder |
| 134 | +[@nicolasstucki]: https://github.com/nicolasstucki |
| 135 | +[@liufengyun]: https://github.com/liufengyun |
| 136 | +[@OlivierBlanvillain]: https://github.com/OlivierBlanvillain |
| 137 | +[@biboudis]: https://github.com/biboudis |
| 138 | +[@allanrenucci]: https://github.com/allanrenucci |
| 139 | +[@Blaisorblade]: https://github.com/Blaisorblade |
| 140 | +[@Duhemm]: https://github.com/Duhemm |
| 141 | +[@AleksanderBG]: https://github.com/AleksanderBG |
| 142 | +[@milessabin]: https://github.com/milessabin |
| 143 | +[@anatoliykmetyuk]: https://github.com/anatoliykmetyuk |
0 commit comments