|
| 1 | +--- |
| 2 | +layout: blog-page |
| 3 | +title: Announcing Dotty 0.27.0-RC1 - ScalaJS, performance, stability |
| 4 | +author: Anatolii Kmetiuk |
| 5 | +authorImg: /images/anatolii.png |
| 6 | +date: 2020-08-31 |
| 7 | +--- |
| 8 | + |
| 9 | +Hello! We are excited to announce 0.27.0-RC1 of Dotty. In this version, we bring ScalaJS support to Dotty. As we are getting closer to the Scala 3 release, we continue shifting our focus to stability and performance, which are the central theme of this release. |
| 10 | + |
| 11 | +You can try out this version right now, from the comfort of your SBT, by visiting the [home page](https://dotty.epfl.ch/) and scrolling down to the "Create a Dotty Project" section. |
| 12 | + |
| 13 | +Alternatively, you can try this version of Scala online via [Scastie](https://scastie.scala-lang.org/). Once you're there, click "Build Settings" and set "Target" to "Dotty". |
| 14 | + |
| 15 | +Enjoy the ride🚀! |
| 16 | + |
| 17 | +<!--more--> |
| 18 | +# Welcome Scala.js support (with caveats) |
| 19 | +This release brings enough support for Scala.js that it should be actually usable in a number of projects. |
| 20 | +To use it, make sure of the following: |
| 21 | + |
| 22 | +* Use sbt-scalajs v1.1.1 or later |
| 23 | +* Use sbt-dotty v0.4.2 or later |
| 24 | +* Use `scalaVersion := "0.27.0-RC1"` or later for Dotty |
| 25 | +* Use `enablePlugins(ScalaJSPlugin)` or a `crossProject` |
| 26 | + |
| 27 | +When the above are combined, sbt-scalajs ans sbt-dotty will coordinate to transparently configure your project with Dotty with its Scala.js support. |
| 28 | + |
| 29 | +In this release, the following features are supported: |
| 30 | + |
| 31 | +* Dependencies with `%%%`, including with `withDottyCompat`, |
| 32 | +* The entire portable subset of the language, i.e., code that compiles both on the JVM and on JS, |
| 33 | +* Calling JavaScript APIs, including those defined in dependencies. |
| 34 | + |
| 35 | +The following features are *not supported yet*: |
| 36 | + |
| 37 | +* Define non-native JS classes (i.e., classes extending `js.Any` but without `@js.native`): they will report compile errors |
| 38 | +* Exports of all kinds (i.e., `@JSExportXYZ`): they will be silently ignored |
| 39 | + |
| 40 | +To the best of our knowledge, cross-compiling libraries should be able to use Scala.js with Dotty in plain capacity. |
| 41 | +If you experience a bug with anything except the unsupported features mentioned above, please file a bug report. |
| 42 | + |
| 43 | +# Stability |
| 44 | +As we're getting closer to the release of Scala 3, we are continuing to focus on the stability and performance of the language. In this release, we have fixed support of objects under JDK9+ (PR [#9181](https://github.com/lampepfl/dotty/pull/9181)). The issue was, due to the changes in JDK9+ compared to JDK8, our initialization scheme for objects did not work under JDK9+. The aforementioned fixed that issue, thereby unblocking JDK9+ support for Dotty. |
| 45 | + |
| 46 | +We are also continuing to work on stabilising enums. PR [#9532](https://github.com/lampepfl/dotty/pull/9532) corrects the deserialization and serialization of singleton enum values with `ObjectInputStream` and `ObjectOutputStream`. PR [#9549](https://github.com/lampepfl/dotty/pull/9549) enables overriding the `toString` method on enums – previously this was not possible because of the way enums were desugared. |
| 47 | + |
| 48 | +# Performance |
| 49 | +We are also focusing these days on making the compiler faster and memory-efficient. For the past month, we were looking in the compiler's memory footprint. We were trying to determine what was allocated in unreasonable amounts during compilation and trying to resolve these allocation issues. The following PRs attempt to increase the performance of the compiler: |
| 50 | + |
| 51 | +- Optimize megaphase [#9597](https://github.com/lampepfl/dotty/pull/9597) |
| 52 | +- Cache all memberNamed results [#9633](https://github.com/lampepfl/dotty/pull/9633) |
| 53 | +- Parallelize position pickling [#9619](https://github.com/lampepfl/dotty/pull/9619) |
| 54 | +- Simplify TypeComparer [#9405](https://github.com/lampepfl/dotty/pull/9405) |
| 55 | +- Optimize and simplify SourcePosition handling [#9561](https://github.com/lampepfl/dotty/pull/9561) |
| 56 | + |
| 57 | +# Metaprogramming |
| 58 | +We are keeping the work on the metaprogramming API improvements. For this release, the following PRs bring better API to metaprogrammers: |
| 59 | + |
| 60 | +- Avoid leak of internal implementation in tasty.Reflection [#9613](https://github.com/lampepfl/dotty/pull/9613) |
| 61 | +- Redefine quoted.Expr.betaReduce [#9469](https://github.com/lampepfl/dotty/pull/9469) |
| 62 | + |
| 63 | +# Let us know what you think! |
| 64 | + |
| 65 | +If you have questions or any sort of feedback, feel free to send us a message on our |
| 66 | +[Gitter channel](https://gitter.im/lampepfl/dotty). If you encounter a bug, please |
| 67 | +[open an issue on GitHub](https://github.com/lampepfl/dotty/issues/new). |
| 68 | + |
| 69 | +## Contributing |
| 70 | +Thank you to all the contributors who made this release possible 🎉 |
| 71 | + |
| 72 | +According to `git shortlog -sn --no-merges 0.26.0-RC1..0.27.0-RC1` these are: |
| 73 | + |
| 74 | +``` |
| 75 | + 118 Martin Odersky |
| 76 | + 75 Liu Fengyun |
| 77 | + 65 Nicolas Stucki |
| 78 | + 27 Sébastien Doeraene |
| 79 | + 23 Guillaume Martres |
| 80 | + 16 Jamie Thompson |
| 81 | + 15 bishabosha |
| 82 | + 10 Guillaume Raffin |
| 83 | + 7 Anatolii Kmetiuk |
| 84 | + 4 Robert Stoll |
| 85 | + 3 Pavel Shirshov |
| 86 | + 3 december32 |
| 87 | + 3 odersky |
| 88 | + 2 ysthakur |
| 89 | + 1 Niklas Vest |
| 90 | + 1 Dean Wampler |
| 91 | + 1 Fengyun Liu |
| 92 | + 1 John Sullivan |
| 93 | + 1 Lan, Jian |
| 94 | + 1 Aleksander Boruch-Gruszecki |
| 95 | + 1 Ruslan Shevchenko |
| 96 | + 1 Stefan Zeiger |
| 97 | + 1 William Narmontas |
| 98 | + 1 xuwei-k |
| 99 | +``` |
| 100 | + |
| 101 | +If you want to get your hands dirty and contribute to Dotty, now is a good time to get involved! |
| 102 | +Head to our [Getting Started page for new contributors](https://dotty.epfl.ch/docs/contributing/getting-started.html), |
| 103 | +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). |
| 104 | +They make perfect entry points into hacking on the compiler. |
| 105 | + |
| 106 | +We are looking forward to having you join the team of contributors. |
| 107 | + |
| 108 | +## Library authors: Join our community build |
| 109 | + |
| 110 | +Dotty now has a set of widely-used community libraries that are built against every nightly Dotty |
| 111 | +snapshot. Currently, this includes shapeless, ScalaPB, algebra, scalatest, scopt and squants. |
| 112 | +Join our [community build](https://github.com/lampepfl/dotty/tree/master/community-build) |
| 113 | +to make sure that our regression suite includes your library. |
| 114 | + |
| 115 | +[Scastie]: https://scastie.scala-lang.org/?target=dotty |
| 116 | + |
| 117 | +[@odersky]: https://github.com/odersky |
| 118 | +[@DarkDimius]: https://github.com/DarkDimius |
| 119 | +[@smarter]: https://github.com/smarter |
| 120 | +[@felixmulder]: https://github.com/felixmulder |
| 121 | +[@nicolasstucki]: https://github.com/nicolasstucki |
| 122 | +[@liufengyun]: https://github.com/liufengyun |
| 123 | +[@OlivierBlanvillain]: https://github.com/OlivierBlanvillain |
| 124 | +[@biboudis]: https://github.com/biboudis |
| 125 | +[@allanrenucci]: https://github.com/allanrenucci |
| 126 | +[@Blaisorblade]: https://github.com/Blaisorblade |
| 127 | +[@Duhemm]: https://github.com/Duhemm |
| 128 | +[@AleksanderBG]: https://github.com/AleksanderBG |
| 129 | +[@milessabin]: https://github.com/milessabin |
| 130 | +[@anatoliykmetyuk]: https://github.com/anatoliykmetyuk |
0 commit comments