-
Notifications
You must be signed in to change notification settings - Fork 326
First draft of 3.1.1 blogpost #1324
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
Changes from 14 commits
5fde4cb
f6e5e8e
3abb4ff
12fa60c
13d3e9a
fee7b7d
a110f94
7861363
e497672
3b131e2
89fe1ba
fa10f0b
d2117c8
9029082
1d172b1
a484d57
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,9 @@ | ||
--- | ||
title: Scala 3.1.1 | ||
start: 1 February 2022 | ||
layout: downloadpage | ||
release_version: 3.1.1 | ||
release_date: "February 1, 2022" | ||
permalink: /download/3.1.1.html | ||
license: <a href="https://www.scala-lang.org/license/">Apache License, Version 2.0</a> | ||
--- |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
--- | ||
layout: blog-detail | ||
post-type: blog | ||
by: Paweł Marks, VirtusLab | ||
title: Scala 3.1.1 and forward compatibility news | ||
--- | ||
|
||
Hello from the Scala 3 team! We are back with a new release of the Scala compiler and some exciting news about improvements in forward compatibility. | ||
|
||
## Improvements is Scala 3.1.1 | ||
|
||
Scala 3.1.1 is the patch release focused on bug fixes. Although there are no new additions to the language, you can still spot some noticeable improvements: | ||
Kordyjan marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
- You can use `using` clauses to introduce subtyping relations between types in the function body. | ||
|
||
Now, the code like below should compile. Any value of type `A` can be used where a value of type `B` is expected as long as a given instance of `A <:< B` is in scope: | ||
Kordyjan marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
```scala | ||
def example[A, B](a: A)(using A <:< B) = | ||
val b: B = a | ||
??? | ||
``` | ||
|
||
To know more see [PR #13662](https://github.com/lampepfl/dotty/pull/13662) and [related issue](https://github.com/lampepfl/dotty/issues/12955). | ||
Kordyjan marked this conversation as resolved.
Show resolved
Hide resolved
|
||
- Mirrors can be correctly summoned for hierarchical sum types compiled by Scala 3.0.x. It is now safe to derive a type class for a type dependency that was compiled with a pre-3.1.0 compiler. ([PR #14100](https://github.com/lampepfl/dotty/pull/14100)). | ||
- Dual Scala 2/3 macros can be now declared in non-experimental scopes ([PR #13795](https://github.com/lampepfl/dotty/pull/13795)). | ||
- Scaladoc documentation has an improved UI. | ||
|
||
For a comprehensive list of fixes, take a look at [the full changelog on GitHub](https://github.com/lampepfl/dotty/releases/tag/3.1.1). | ||
|
||
## 3.1.2-RC1 and forward compatibility improvements | ||
|
||
Together with 3.1.1 we have released the first RC version of the next patch release of the compiler. 3.1.2-RC1 contains further fixes, but most importantly it is our first step in improving forward compatibility in Scala. | ||
|
||
Kordyjan marked this conversation as resolved.
Show resolved
Hide resolved
|
||
Scala 3 has excellent backward compatibility guarantees between the minor versions. Right now, that means that code compiled with Scala 3.1 can depend on libraries published with 3.0 without any problems. The opposite, hovewer, is not true. Code compiled with 3.0 is not able to read dependencies compiled with 3.1. After the recent release of Scala 3.1.0, we can see that libraries should be really cautious with updating the compiler version, as it forces a bump on every user of that library. We do not want library authors to be stuck on old versions of the compiler as that would mean that they are locked out of many bugfixes, or we would need to spend enormous effort on backporting every bugfix to all past versioning lines. | ||
|
||
Our current plan to mitigate those difficulties is described in [the contributors discussion](https://contributors.scala-lang.org/t/improving-scala-3-forward-compatibility/5298), where you are free to leave your feedback. We already have implemented the first and most important part of the solution and have it ready for public testing. Beginning with Scala 3.1.2-RC1 the compiler is able to generate outputs that can be consumed by its older versions. To enable that, you need to specify the minimal targeted minor language version by using the experimental `-Yscala-release` flag. | ||
|
||
We expect that in the future authors will use the newest available version of the compiler with `-Yscala-release` set to the lowest language version that support all features they need. This way they will be able to benefit from all the bugfixes without restricting their potential audience. | ||
|
||
So, for example, compiling your library using Scala 3.1.2-RC2 with `-Yscala-release:3.0` flag, you make it possible for people still using Scala 3.0 to depend on your library. This has one limitation, you won't be able to use any symbol added to the standard library after 3.0. They are marked in the code and in the documentation by the `@since` annotation that was also added in this version. | ||
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. Actually there are more limitations as described here https://docs.scala-lang.org/scala3/reference/language-versions/binary-compatibility.html
This comment was marked as outdated.
Sorry, something went wrong. |
||
|
||
One important note is that the `-Yscala-release` flag is experimental and not yet available in any stable release of the compiler. It means the build tools, such as SBT or Mill, are not yet aware of its existence. Of course, you can declare usage of the flag in your build file, and the compiler will respect it. However, there may still be some hiccups, like generated artifacts depending on the incorrect version of the stdlib. We will do our best to help fix those minor issues before the stable release of 3.1.2. | ||
|
||
Detailed description of the new flag can be found in [the reference page for the binary comaptibility](https://docs.scala-lang.org/scala3/reference/language-versions/binary-compatibility.html). | ||
|
||
If you are interested in other changes brought by 3.1.2-RC1, there is, as always, [a changelog on GitHub](https://github.com/lampepfl/dotty/releases/tag/3.1.2-RC1). | ||
|
||
## Contributors | ||
|
||
Thank you to all the contributors who made this release possible. | ||
|
||
According to `git shortlog -sn --no-merges 3.1.0..3.1.1` these are: | ||
|
||
``` | ||
50 Fengyun Liu | ||
43 Martin Odersky | ||
26 Olivier Blanvillain | ||
24 Kacper Korban | ||
21 Filip Zybała | ||
18 Dale Wijnand | ||
18 Nicolas Stucki | ||
17 Phil | ||
13 Andrzej Ratajczak | ||
10 Guillaume Martres | ||
10 noti0na1 | ||
8 Paweł Marks | ||
7 Jamie Thompson | ||
5 soronpo | ||
5 Tom Grigg | ||
3 Yichen Xu | ||
3 Dmitrii Naumenko | ||
3 ghostbuster91 | ||
3 Julien Richard-Foy | ||
2 Stéphane Micheloud | ||
2 bjornregnell | ||
2 Vadim Chelyshov | ||
1 ysthakur | ||
1 Daniel Esik | ||
1 EnzeXing | ||
1 Jasper Moeys | ||
1 Katja Goltsova | ||
1 Matthieu Bovel | ||
1 Ondrej Lhotak | ||
1 Oron Port | ||
1 Rikito Taniguchi | ||
1 Seth Tisue | ||
1 Som Snytt | ||
1 Sébastien Doeraene | ||
1 Tomasz Godzik | ||
1 oronpo | ||
``` |
Uh oh!
There was an error while loading. Please reload this page.