Skip to content

Commit ce53925

Browse files
committed
Editorial changes to 3.1.1 announcement
1 parent c3ca368 commit ce53925

File tree

1 file changed

+14
-11
lines changed

1 file changed

+14
-11
lines changed

blog/_posts/2022-01-17-scala-3.1.1-released.md

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,15 @@ by: Paweł Marks, VirtusLab
55
title: Scala 3.1.1 and forward compatibility news
66
---
77

8-
Hello from the Scala 3 team! After a slightly longer than usual pause, we are back with a new release of the Scala compiler and exciting news about improvements in forward compatibility. The delay in the release was caused by urgent bugs that needed backporting and testing, and then the holiday season.
8+
Hello from the Scala 3 team! We are back with a new release of the Scala compiler and exciting news about improvements in forward compatibility.
99

1010
## Improvements is Scala 3.1.1
1111

12-
Scala 3.1.1-RC2 was promoted to a full stable release of the language. Scala 3.1.1 is the first patch version after the 3.1 minor release. It is therefore focused on bug fixes and improvements in overall correctness and stability. Although there are no new additions to the language, you can still spot some noticeable improvements:
12+
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:
1313

14-
- You can use `using` clauses to introduce Scala 2 conversions.
14+
- You can use `using` clauses to introduce subtyping relations between types in the function body.
1515

16-
Now the code like this should compile and perform necessary conversion from `A` to `B` in the method body:
16+
Now the code like this should compile. Any value of type `A` can be assigned to a value of type `B`:
1717

1818
```scala
1919
def example[A, B](a: A)(using A <:< B) =
@@ -22,25 +22,28 @@ Scala 3.1.1-RC2 was promoted to a full stable release of the language. Scala 3.1
2222
```
2323

2424
To know more see [PR #13662](https://github.com/lampepfl/dotty/pull/13662) and [related issue](https://github.com/lampepfl/dotty/issues/12955).
25-
- Mirrors can be correctly summoned for hierarchical sum types compiled by Scala 3.0.x ([PR #14100](https://github.com/lampepfl/dotty/pull/14100)).
25+
- Mirrors can be correctly summoned for hierarchical sum types compiled by Scala 3.0.x. You can now safely create derived instances of type classes for the types defined in dependencies compiled with previous versions of the compiler. ([PR #14100](https://github.com/lampepfl/dotty/pull/14100)).
2626
- Dual Scala 2/3 macros can be now declared in non-experimental scopes ([PR #13795](https://github.com/lampepfl/dotty/pull/13795)).
27-
- Scaladoc can correctly handle symbolic class names, such as `/` or `\` ([PR #13827](https://github.com/lampepfl/dotty/pull/13827)).
28-
- Scaladoc documentation has a new, improved UI.
27+
- Scaladoc documentation has an improved UI.
2928

3029
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).
3130

3231
## 3.1.2-RC1 and forward compatibility improvements
3332

34-
Scala 3 has excellent backward compatibility guarantees between the minor versions. On the other hand, after the recent release of Scala 3.1, we can see that the libraries should be really cautious with updating the compiler version, as it is forcing the 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.
33+
Together with 3.1.1 we have released first RC version of 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.
3534

36-
We are sure we want to mitigate those difficulties. We already have implemented the first and most important part of the solution and have it ready for public testing. Beginning in Scala 3.1.2-RC1, that was just released, compiler is able to generate output that can be consumed by older versions. To enable that, you need to specify a minimum version of the language using the experimental `-Yscala-release` flag.
35+
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 the libraries should be really cautious with updating the compiler version, as it is forcing the 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.
3736

38-
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 internal `@since` annotation that was also added in this version.
37+
We are sure we want to mitigate those difficulties. We already have implemented the first and most important part of the solution and have it ready for public testing. Beginning in Scala 3.1.2-RC1 compiler is able to generate output that can be consumed by older versions. To enable that, you need to specify a minimum version of the language using the experimental `-Yscala-release` flag.
3938

40-
Those restrictions are not final, and in the future, we may decide to allow using some functions from the newer versions of the standard library and to make the `@since` annotation public.
39+
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 the all bugfixes without restricting their potential audience.
40+
41+
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.
4142

4243
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.1.
4344

45+
You can read about potential next steps and leave your feedback in [the discussion](https://contributors.scala-lang.org/t/improving-scala-3-forward-compatibility/5298) that initiaded this change.
46+
4447
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).
4548

4649
## Contributors

0 commit comments

Comments
 (0)