-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Add 3.0.1-RC1 blog article #12699
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add 3.0.1-RC1 blog article #12699
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,168 @@ | ||
--- | ||
layout: blog-page | ||
title: Scala 3.0.1-RC1 – further stabilising the compiler | ||
author: Anatolii Kmetiuk | ||
authorImg: /images/anatolii.png | ||
date: 2021-06-07 | ||
--- | ||
|
||
Hello! We are happy to announce Scala 3.0.1-RC1 – the first release candidate in the post-3.0.0 era. With this release, we continue the work on making the compiler even more stable. | ||
|
||
<!--more--> | ||
|
||
# Experimental language features policy | ||
Research and experimentation has always been an integral part of the Scala community's culture. That's what made Scala the language it is right now. Like many things in engineering, however, it's a part of a trade-off between experimentation and stability. Experimenting is fun and insightful, but when stakes on your project are high, stability becomes a priority. | ||
|
||
Therefore, to ensure wide adoption of the language and its reliability in wide range of applications, we need to balance the two. We would like to have the room for trying new things out – but while doing so, we would like to keep in mind an ordinary Scala user who may not necessarily be interested in the bleeding edge and who would like their Scala dependencies and code to simply work. In the post-3.0.0 era, we must prioritize stability. | ||
|
||
With this release, we are introducing a restriction on [features marked as experimental](https://dotty.epfl.ch/api/scala/language$$experimental$.html). Now, it is not possible to use them from stable or `RC` releases. If you would like to experiment with them, you need to use a `NIGHTLY` version of the compiler. Nightlies are published every 24 hours, and you can find them on [Maven](https://repo1.maven.org/maven2/org/scala-lang/scala3-compiler_3/). | ||
|
||
The spirit of this policy is to make sure that effectively, no library published for Scala 3 contain experimental features. This way, what is experimental can be easily changed and is not subject to the guarantees of the wider language. And, most importantly, the changes to such features would not affect the community *in practice* – the guarantee not achievable if we just announced the policy without implementing a mechanism to enforce it. | ||
|
||
Having said that, we still encourage people to play with the experimental features from the `NIGHTLY` compier versions and discuss their findings. Without the curious and adventurous part of the community playing with the new features, there is no way of knowing what they are good for, and no way to decide whether they should be dropped or promoted to a stable feature. | ||
|
||
More about this change you can read in the PR [#12102](https://github.com/lampepfl/dotty/pull/12102). | ||
|
||
# Kind-projector work | ||
This release also brings extra features for the [Kind Projector](https://docs.scala-lang.org/scala3/guides/migration/plugin-kind-projector.html) migration support. First, PR [#12378](https://github.com/lampepfl/dotty/pull/12378) allows `_` as type lambda placeholder. Second, PR [#12341](https://github.com/lampepfl/dotty/pull/12341) brings support for the variance annotations on the placeholder. This work enhances the ability to cross-compile Scala 2 code that uses the Kind Projector plugin to Scala 3. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. /cc @neko-kai There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @anatoliykmetyuk I would add a link to the migration guide which has more details on how to to make use of it from a user perspective - https://docs.scala-lang.org/scala3/guides/migration/plugin-kind-projector.html – and a quick mention that |
||
|
||
# Improved error reporting | ||
Down the error reporting lane, match type reduction errors were improved. When using a match type, it may or may not reduce to one of its cases. If it doesn't match type is used as specified, e.g. if `M[T]` is a match type and it didn't reduce for `M[Int]`, `M[Int]` will be used. This behavior, however, is frequently not what you want: there is a lot of cases where you would expect a match type to reduce but it doesn't. In such cases, it would be nice to have some diagnostic regarding why it didn't reduce. PR [#12053](https://github.com/lampepfl/dotty/pull/12053/) adds just such a diagnostic. E.g. the following code: | ||
|
||
```scala | ||
trait A | ||
trait B | ||
type M[X] = X match | ||
case A => Int | ||
case B => String | ||
val x: String = ??? : M[B] // error | ||
``` | ||
|
||
will report the following error: | ||
|
||
``` | ||
6 |val x: String = ??? : M[B] // error | ||
| ^^^^^^^^^^ | ||
| Found: M[B] | ||
| Required: String | ||
| | ||
| Note: a match type could not be fully reduced: | ||
| | ||
| trying to reduce M[B] | ||
| failed since selector B | ||
| does not match case A => Int | ||
| and cannot be shown to be disjoint from it either. | ||
| Therefore, reduction cannot advance to the remaining case | ||
| | ||
| case B => String | ||
``` | ||
|
||
# Scaladoc | ||
We have updated the [documentation](http://dotty.epfl.ch/docs/usage/scaladoc/index.html) for Scaladoc making it easier for you to get started. Also, PR [#11582](https://github.com/lampepfl/dotty/pull/11582) has added the snippet compiler to ensure the snippets in your scaladoc documentation comments aren't broken. You can read more about this feature on the [mailing list](https://contributors.scala-lang.org/t/snippet-validation-in-scaladoc-for-scala-3/4976). | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
|
||
# Metaprogramming | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. /cc @nicolasstucki |
||
A lot of metaprogramming work was focused on improving the performance. Some of the notable PRs include: | ||
|
||
- Cache quote unpickling [#12242](https://github.com/lampepfl/dotty/pull/12242) | ||
- Avoid pickled tasty for some captured quote reference [#12248](https://github.com/lampepfl/dotty/pull/12248) | ||
- Improve quote matcher performance [#12418](https://github.com/lampepfl/dotty/pull/12418) | ||
- Port scala.quoted.runtime.impl.QuoteMatcher [#12402](https://github.com/lampepfl/dotty/pull/12402) | ||
|
||
|
||
# Issue fixing | ||
Otherwise, we are making an effort to reduce our issue tracker. Among others, the following are some of the PRs dedicated to issue fixing: | ||
|
||
- IArray.toArray: Deprecate broken method [#12598](https://github.com/lampepfl/dotty/pull/12598) | ||
- Fix comparison of dependent function types [#12214](https://github.com/lampepfl/dotty/pull/12214) | ||
- Make translucentSuperType handle match types [#12153](https://github.com/lampepfl/dotty/pull/12153) | ||
- Harden Type Inference [#12560](https://github.com/lampepfl/dotty/pull/12560) | ||
- Reject references to self in super constructor calls [#12567](https://github.com/lampepfl/dotty/pull/12567) | ||
- Provide mirror support after inlining [#12062](https://github.com/lampepfl/dotty/pull/12062) | ||
- Allow export paths to see imports [#12134](https://github.com/lampepfl/dotty/pull/12134) | ||
- Streamline given syntax [#12107](https://github.com/lampepfl/dotty/pull/12107) | ||
- Export constructor proxies [#12311](https://github.com/lampepfl/dotty/pull/12311) | ||
- Identify package and nested package object in isSubPrefix [#12297](https://github.com/lampepfl/dotty/pull/12297) | ||
- Treat Refinements more like AndTypes [#12317](https://github.com/lampepfl/dotty/pull/12317) | ||
- Fix [#9871](https://github.com/lampepfl/dotty/pull/9871): use toNestedPairs in provablyDisjoint [#10560](https://github.com/lampepfl/dotty/pull/10560) | ||
|
||
|
||
# Contributors | ||
Thank you to all the contributors who made this release possible 🎉 | ||
|
||
According to `git shortlog -sn --no-merges 3.0.0-RC2..3.0.1-RC1`† these are: | ||
|
||
``` | ||
121 Martin Odersky | ||
111 Liu Fengyun | ||
98 Nicolas Stucki | ||
29 Guillaume Martres | ||
24 Phil | ||
20 Olivier Blanvillain | ||
14 Tom Grigg | ||
14 Adrien Piquerez | ||
13 Natsu Kagami | ||
12 Andrzej Ratajczak | ||
10 odersky | ||
10 Aleksander Boruch-Gruszecki | ||
9 Anatolii Kmetiuk | ||
8 Jamie Thompson | ||
6 Maxime Kjaer | ||
5 Som Snytt | ||
3 Filip Zybała | ||
3 Krzysztof Romanowski | ||
3 Kai | ||
3 Fengyun Liu | ||
3 noti0na1 | ||
3 Phil Walker | ||
2 Johannes Rudolph | ||
2 soronpo | ||
2 tanishiking | ||
2 Adam Warski | ||
2 Kacper Korban | ||
2 Raphael Jolly | ||
2 Sébastien Doeraene | ||
1 xuwei-k | ||
1 Alexander Ioffe | ||
1 David Barri | ||
1 Devon Stewart | ||
1 Dmitrii Naumenko | ||
1 Ivan Kurchenko | ||
1 Jakub Kozłowski | ||
1 Jonas Ackermann | ||
1 Kevin Lee | ||
1 Martin | ||
1 Michał Pałka | ||
1 Miles Sabin | ||
1 Oron Port | ||
1 Paweł Marks | ||
1 Ruslan Shevchenko | ||
1 Seth Tisue | ||
1 Vadim Chelyshov | ||
1 nogurenn | ||
1 nurekata | ||
``` | ||
|
||
†: Note that we measure against `3.0.0-RC2` and not `3.0.0` because we stabilized on `3.0.0-RC2`. Only critical bug fixes found their way into `3.0.0-RC3` and further, while the majority of changes ended up in `3.0.1-RC1`. | ||
|
||
## Library authors: Join our community build | ||
|
||
Scala 3 now has a set of widely-used community libraries that are built against every nightly Scala 3 snapshot. | ||
Join our [community build](https://github.com/lampepfl/dotty/tree/master/community-build) | ||
to make sure that our regression suite includes your library. | ||
|
||
[Scastie]: https://scastie.scala-lang.org/?target=dotty | ||
|
||
[@odersky]: https://github.com/odersky | ||
[@DarkDimius]: https://github.com/DarkDimius | ||
[@smarter]: https://github.com/smarter | ||
[@felixmulder]: https://github.com/felixmulder | ||
[@nicolasstucki]: https://github.com/nicolasstucki | ||
[@liufengyun]: https://github.com/liufengyun | ||
[@OlivierBlanvillain]: https://github.com/OlivierBlanvillain | ||
[@biboudis]: https://github.com/biboudis | ||
[@allanrenucci]: https://github.com/allanrenucci | ||
[@Blaisorblade]: https://github.com/Blaisorblade | ||
[@Duhemm]: https://github.com/Duhemm | ||
[@AleksanderBG]: https://github.com/AleksanderBG | ||
[@milessabin]: https://github.com/milessabin | ||
[@anatoliykmetyuk]: https://github.com/anatoliykmetyuk |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/cc @odersky @sjrd @smarter