-
Notifications
You must be signed in to change notification settings - Fork 326
docs: Blog post about JDK support in the next Scala LTS #1736
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
Merged
Merged
Changes from 1 commit
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
295dbff
docs: Create blog about the next Scala LTS
tgodzik 995f8c6
docs: apply suggestions from review
tgodzik 3332fd5
docs: Rework list of JEPs and mention more projects
tgodzik b92e250
separate the projects lists into Java and Scala
SethTisue 4e2a11c
add two more Java projects
SethTisue baf2899
more Java projects
SethTisue 54870ec
chore: Add more review comments
tgodzik 273645f
chore: Add link to the contributors topic
tgodzik 4bec6f0
chore: Add back Seth's chanages
tgodzik File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
--- | ||
category: announcement | ||
permalink: /news/next-scala-lts.html | ||
title: "Next Scala 3 LTS version" | ||
by: Tomasz Godzik | ||
--- | ||
|
||
**TLDR;** | ||
tgodzik marked this conversation as resolved.
Show resolved
Hide resolved
tgodzik marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
sun.misc.Unsafe, re-used in lazy val implementation, will be removed in a future | ||
JDK one of the Scala 3 Next minors in 2025 Q4 and the next LTS will drop JDK 8 | ||
support | ||
|
||
## Intro | ||
|
||
For the compiler’s second LTS version, the Scala 3 compiler team will be | ||
dropping support for JDK 8 and is considering which later JDK to use. | ||
tgodzik marked this conversation as resolved.
Show resolved
Hide resolved
tgodzik marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
## Reasons for the change | ||
SethTisue marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
One of the main reasons is that recent [JEP 471](https://openjdk.org/jeps/471) | ||
tgodzik marked this conversation as resolved.
Show resolved
Hide resolved
|
||
stated that the memory-access methods in sun.misc.Unsafe are scheduled for | ||
removal in a future release. Currently, Scala 3 uses sun.misc.Unsafe in its | ||
implementation of lazy values. This was needed due to compatibility with JDK 8. | ||
In order to support later versions of JDK we will need to drop usage of Unsafe, | ||
which is being investigated under | ||
[this issue](https://github.com/scala/scala3/issues/9013). It also started to | ||
tgodzik marked this conversation as resolved.
Show resolved
Hide resolved
|
||
dawn on the compiler team that we might consider stopping to support JDK 8 | ||
altogether in a future release of Scala 3. | ||
|
||
## Advantages | ||
|
||
Switching to a newer version of the JDK would allow both the compiler and the | ||
Scala ecosystem to start using new features brought in by JDK 9+. This might | ||
tgodzik marked this conversation as resolved.
Show resolved
Hide resolved
|
||
include a number of JEPs, which will be investigated by the team the coming | ||
year. To check the current status take a look at the issues marked with the | ||
[JEP label](https://github.com/scala/scala3/issues?q=is%3Aissue+is%3Aopen+label%3Acompat%3Ajava%3Ajep). | ||
tgodzik marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
Another advantage would be reducing the maintenance burden on tooling and | ||
library authors that currently have to take into account a large number of | ||
different versions to test and make sure that their code is performant on all of | ||
them. | ||
tgodzik marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
If we take a look at the timeline we'll see that JDK 8 was first published on | ||
18th March 2014, which is already over 10 years ago. Technology and especially | ||
SethTisue marked this conversation as resolved.
Show resolved
Hide resolved
tgodzik marked this conversation as resolved.
Show resolved
Hide resolved
|
||
JDKs have advanced greatly through that period and in order to stay competitive | ||
using those advancements is a must. A lot of the existing distributions are | ||
already stopping or will soon stop updating JDK 8 with security and other fixes, | ||
which might directly impact issues within your business applications. | ||
tgodzik marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
Some larger projects within JVM and Scala ecosystems have already dropped JDK 8 | ||
support. And while it's always possible to not update your libraries and Scala | ||
tgodzik marked this conversation as resolved.
Show resolved
Hide resolved
|
||
version, which will avoid having to switch to a newer JDK, it's highly | ||
discouraged as it will make you vulnerable to potential security risks. | ||
|
||
## Plan for making the switch | ||
|
||
The current plan is to drop support of JDK 8 in one of the future minor releases | ||
of Scala 3 and in the next LTS. The JDK will be either 11 or 17 depending on the | ||
tgodzik marked this conversation as resolved.
Show resolved
Hide resolved
|
||
community feedback and our investigations. The current estimate for the next LTS | ||
SethTisue marked this conversation as resolved.
Show resolved
Hide resolved
|
||
is Q4 2025. | ||
|
||
One of the major challenges here will be making sure that we are still able to | ||
use libraries compiled with earlier JDK 8 compatible Scala 3 versions in the | ||
versions with a new implementation of lazy values, which is not reliant on | ||
sun.misc.Unsafe. | ||
tgodzik marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
tgodzik marked this conversation as resolved.
Show resolved
Hide resolved
|
||
## How does it affect me? | ||
|
||
If you are using Scala 3 on JDK 8 do let us know! However the current line of | ||
LTS under 3.3.x will be supported for at least another year after the release of | ||
the next LTS version, which should give you plenty of time to migrate. | ||
tgodzik marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
If at any point it turns out it's not possible for you to switch, be sure to | ||
SethTisue marked this conversation as resolved.
Show resolved
Hide resolved
|
||
send us your feedback. | ||
|
||
## Summary | ||
tgodzik marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
You can track the current work related to lazy values under | ||
[this issue](https://github.com/scala/scala3/issues/9013) and discuss the topic | ||
under soon to be posted thread on the | ||
[Scala contributors forum](https://contributors.scala-lang.org/) | ||
tgodzik marked this conversation as resolved.
Show resolved
Hide resolved
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.