Skip to content

Commit 342be62

Browse files
Add 3.0.1-RC1 blog article
1 parent 41d262b commit 342be62

File tree

1 file changed

+169
-0
lines changed

1 file changed

+169
-0
lines changed
Lines changed: 169 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,169 @@
1+
---
2+
layout: blog-page
3+
title: Scala 3.0.1-RC1 – further stabilising the compiler
4+
author: Anatolii Kmetiuk
5+
authorImg: /images/anatolii.png
6+
date: 2021-06-07
7+
---
8+
9+
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.
10+
11+
<!--more-->
12+
13+
# Experimental language features policy
14+
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.
15+
16+
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.
17+
18+
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/).
19+
20+
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.
21+
22+
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.
23+
24+
More about this change you can read in the PR [#12102](https://github.com/lampepfl/dotty/pull/12102).
25+
26+
# Kind-projector work
27+
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.
28+
29+
# Improved error reporting
30+
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:
31+
32+
```scala
33+
trait A
34+
trait B
35+
type M[X] = X match
36+
case A => Int
37+
case B => String
38+
val x: String = ??? : M[B] // error
39+
```
40+
41+
will report the following error:
42+
43+
```
44+
6 |val x: String = ??? : M[B] // error
45+
| ^^^^^^^^^^
46+
| Found: M[B]
47+
| Required: String
48+
|
49+
| Note: a match type could not be fully reduced:
50+
|
51+
| trying to reduce M[B]
52+
| failed since selector B
53+
| does not match case A => Int
54+
| and cannot be shown to be disjoint from it either.
55+
| Therefore, reduction cannot advance to the remaining case
56+
|
57+
| case B => String
58+
```
59+
60+
# Scaladoc
61+
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).
62+
63+
# Metaprogramming
64+
A lot of metaprogramming work was focused on improving the performance. Some of the notable PRs include:
65+
66+
- Cache quote unpickling [#12242](https://github.com/lampepfl/dotty/pull/12242)
67+
- Avoid pickled tasty for some captured quote reference [#12248](https://github.com/lampepfl/dotty/pull/12248)
68+
- Improve quote matcher performance [#12418](https://github.com/lampepfl/dotty/pull/12418)
69+
- Port scala.quoted.runtime.impl.QuoteMatcher [#12402](https://github.com/lampepfl/dotty/pull/12402)
70+
71+
A way to abort macro expansion was enhanced in PR [#12056](https://github.com/lampepfl/dotty/pull/12056). Now you can use `errorAndAbort(msg: String)` to stop macro expansion with an error, and `expr.valueOrAbort` to abort macro expansion if a given expression doesn't represent a value or possibly contains side effects.
72+
73+
# Issue fixing
74+
Otherwise, we are making an effort to reduce our issue tracker. Among others, the following are some of the PRs dedicated to issue fixing:
75+
76+
- IArray.toArray: Deprecate broken method [#12598](https://github.com/lampepfl/dotty/pull/12598)
77+
- Fix comparison of dependent function types [#12214](https://github.com/lampepfl/dotty/pull/12214)
78+
- Make translucentSuperType handle match types [#12153](https://github.com/lampepfl/dotty/pull/12153)
79+
- Harden Type Inference [#12560](https://github.com/lampepfl/dotty/pull/12560)
80+
- Reject references to self in super constructor calls [#12567](https://github.com/lampepfl/dotty/pull/12567)
81+
- Provide mirror support after inlining [#12062](https://github.com/lampepfl/dotty/pull/12062)
82+
- Allow export paths to see imports [#12134](https://github.com/lampepfl/dotty/pull/12134)
83+
- Streamline given syntax [#12107](https://github.com/lampepfl/dotty/pull/12107)
84+
- Export constructor proxies [#12311](https://github.com/lampepfl/dotty/pull/12311)
85+
- Identify package and nested package object in isSubPrefix [#12297](https://github.com/lampepfl/dotty/pull/12297)
86+
- Treat Refinements more like AndTypes [#12317](https://github.com/lampepfl/dotty/pull/12317)
87+
- Fix [#9871](https://github.com/lampepfl/dotty/pull/9871): use toNestedPairs in provablyDisjoint [#10560](https://github.com/lampepfl/dotty/pull/10560)
88+
89+
90+
# Contributors
91+
Thank you to all the contributors who made this release possible 🎉
92+
93+
According to `git shortlog -sn --no-merges 3.0.0-RC2..3.0.1-RC1`† these are:
94+
95+
```
96+
121 Martin Odersky
97+
111 Liu Fengyun
98+
98 Nicolas Stucki
99+
29 Guillaume Martres
100+
24 Phil
101+
20 Olivier Blanvillain
102+
14 Tom Grigg
103+
14 Adrien Piquerez
104+
13 Natsu Kagami
105+
12 Andrzej Ratajczak
106+
10 odersky
107+
10 Aleksander Boruch-Gruszecki
108+
9 Anatolii Kmetiuk
109+
8 Jamie Thompson
110+
6 Maxime Kjaer
111+
5 Som Snytt
112+
3 Filip Zybała
113+
3 Krzysztof Romanowski
114+
3 Kai
115+
3 Fengyun Liu
116+
3 noti0na1
117+
3 Phil Walker
118+
2 Johannes Rudolph
119+
2 soronpo
120+
2 tanishiking
121+
2 Adam Warski
122+
2 Kacper Korban
123+
2 Raphael Jolly
124+
2 Sébastien Doeraene
125+
1 xuwei-k
126+
1 Alexander Ioffe
127+
1 David Barri
128+
1 Devon Stewart
129+
1 Dmitrii Naumenko
130+
1 Ivan Kurchenko
131+
1 Jakub Kozłowski
132+
1 Jonas Ackermann
133+
1 Kevin Lee
134+
1 Martin
135+
1 Michał Pałka
136+
1 Miles Sabin
137+
1 Oron Port
138+
1 Paweł Marks
139+
1 Ruslan Shevchenko
140+
1 Seth Tisue
141+
1 Vadim Chelyshov
142+
1 nogurenn
143+
1 nurekata
144+
```
145+
146+
†: 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`.
147+
148+
## Library authors: Join our community build
149+
150+
Scala 3 now has a set of widely-used community libraries that are built against every nightly Scala 3 snapshot.
151+
Join our [community build](https://github.com/lampepfl/dotty/tree/master/community-build)
152+
to make sure that our regression suite includes your library.
153+
154+
[Scastie]: https://scastie.scala-lang.org/?target=dotty
155+
156+
[@odersky]: https://github.com/odersky
157+
[@DarkDimius]: https://github.com/DarkDimius
158+
[@smarter]: https://github.com/smarter
159+
[@felixmulder]: https://github.com/felixmulder
160+
[@nicolasstucki]: https://github.com/nicolasstucki
161+
[@liufengyun]: https://github.com/liufengyun
162+
[@OlivierBlanvillain]: https://github.com/OlivierBlanvillain
163+
[@biboudis]: https://github.com/biboudis
164+
[@allanrenucci]: https://github.com/allanrenucci
165+
[@Blaisorblade]: https://github.com/Blaisorblade
166+
[@Duhemm]: https://github.com/Duhemm
167+
[@AleksanderBG]: https://github.com/AleksanderBG
168+
[@milessabin]: https://github.com/milessabin
169+
[@anatoliykmetyuk]: https://github.com/anatoliykmetyuk

0 commit comments

Comments
 (0)