Scala 3.6.4 release thread

Scala 3.6.4-RC1 is now ready for tests!

Highlights of the release:

  • JDK 24 support
  • REPL init script setting #22206
  • Deprecated scalac setting -Yno-decode-stacktraces is now an alias for -Xno-enrich-error-messages #22208

For a full list of changes and contributor credits, please refer to the release notes

The stable release is planned for February 18th

3 Likes

I can’t get the option to work; am i doing something wrong?

$ scala repl -S 3.6.4-RC1 --repl-init-script 'println("Hello")'
Unrecognized argument: --repl-init-script

To list all available options, run
  scala repl --help

But it works inside the repl:

bjornr@bjornux:~$ scala repl -S 3.6.4-RC1
Welcome to Scala 3.6.4-RC1 (21.0.5, Java OpenJDK 64-Bit Server VM).
Type in expressions for evaluation. Or try :help.
                                                                                                                              
scala> :reset --repl-init-script:'println("Hello")'
Resetting REPL state with the following settings:
  --repl-init-script:println("Hello")

Hello
                                                                                                                              
scala> 

It’s from “ouside” using the code from command line which is the important use case; so you can pass an import for instance…

REPL is confusing me

$ scala repl -S 3.6.4-RC1
Downloading Scala 3.6.4-RC1 compiler
Downloading Scala 3.6.4-RC1 bridge
Welcome to Scala 3.6.4-RC1 (21.0.5, Java OpenJDK 64-Bit Server VM).
Type in expressions for evaluation. Or try :help.
                                                                                                                                                                                                                                        
scala> println(util.Properties.versionString)
version 2.13.15

see Scala FAQ | Scala Documentation

try scala repl -S 3.6.4-RC1 -O --repl-init-script ...

if I understand correctly, scala-cli recognizes certain options as being compiler/REPL options and doesn’t require the -O, but this is one it apparently doesn’t know yet, so the -O is necessary

@bjornregnell it’s a REPL flag, not a Scala CLI or compiler one.
You pass it to the launched app, so to the REPL in this case, so after --.

scala repl -S 3.6.4-RC1 -- --repl-init-script 'println("Hello")'
Hello
Welcome to Scala 3.6.4-RC1 (23.0.1, Java OpenJDK 64-Bit Server VM).
Type in expressions for evaluation. Or try :help.
                                                                                                                 
scala> 

This will work.

The feature is also still worked on, as tracked under Add a setting/API to run a code snippet/script in the REPL on startup · Issue #21242 · scala/scala3 · GitHub
We may add a more intuitive way of passing an init script (although the syntax above is quite simple already, I think).

1 Like

AHA!! Many thanks. Finally Scala 3 can do what I have longed for:

Super-thanks to all contributors of this feature!!!

3 Likes

ah, thanks for the correction, TIL

Scala 3.6.4-RC2 is now available - Release 3.6.4-RC2 · scala/scala3 · GitHub

The second release candidate fixes some of changes that coused regressions in several projects

The stable 3.6.4 release is planned for March 5th.

3 Likes

I am afraid I have found a regression - some imports are falsely reported as unused. RC1 already exhibited the issue, unfortunately I did not test my project against it. Reported as 3.6.4 regression - false positive warnings: unused imports · Issue #22690 · scala/scala3 · GitHub

Thank you reporting this one.
Unfortunately some time ago we’ve introduced a cutoff policy for RC releases so that we can fixed amount of time to find and fix regressions, to address issues with multiple releases for the same minor due to multiple bugfix releases (e.g. 3.6.1-RC1 being blocked by not yet released 3.5.0 (-RC7))
In the 3.6.4-RC2 (5 weeks after RC1) we’ve reverted all changes that introduced a known regressions that we were not able to fix in that period. Unless any critical issue would occur (e.g. detected binary compatibility breakage, CVE, etc.) we don’t plan any additional release candidates and the RC2 would be nominated to final release.
This means this regression is unlikely to be fixed in 3.6.4, but we’d try our best to have it fixed in 3.7.0 (either in RC1 planned for March 12th or backported in successor RC)

1 Like

Thanks for clarification. As for my project, it can happily live with 3.6.3 until next release, I do not think any of 3.6.4 features is something we need.

The next planned release is 3.7.0. You can expect its first RC by the end of next week.

6 Likes

Is there an expected release date for 3.7.0? I thought it was planned for end of year, but if the first RC is due next week then maybe the final release will be earlier than I thought.

I’d like to know so I can decide what version to use in the next release of Mill 0.13.0

It’s typically ~6 weeks after cutoff / RC1, which would set us for final release no earlier then April 15th.

As for the version used for Mill I’d personally suggest 3.3 LTS with possible upgrade to next one (probably 3.9 LTS) in the future, because of the plugin system. Seems like sbt 2 is currently using Scala 3.6, but in my opinion they should stick to LTS as well, unless it is possible to have a seperation of an API for plugin authors published using LTS and actual application using whatever version author chooses.

3 Likes

Got it, thanks! Mill’s main branch currently is on 3.6 following SBT 2.0, we can see whether it’s feasible to use 3.3.x. IIRC some libraries hit compiler bugs thst necessitated 3.5 or above, so might not be feasible even if we wanted to

Are named tuples expected to be non-experimental (or under preview)?

Yes, stable, see Makes Named Tuples a stable feature in 3.7 by WojciechMazur · Pull Request #22753 · scala/scala3 · GitHub

iirc, we discussed it on the core team and saw no reason for this particular one to go through the preview stage

1 Like

Awesome! Thanks for the update and for all the work!