Skip to content
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

Create Scala-3 StdLib artefact #22043

Open
4 tasks
odersky opened this issue Nov 27, 2024 · 0 comments
Open
4 tasks

Create Scala-3 StdLib artefact #22043

odersky opened this issue Nov 27, 2024 · 0 comments
Labels
area:library Standard library itype:enhancement needs-minor-release This PR cannot be merged until the next minor release

Comments

@odersky
Copy link
Contributor

odersky commented Nov 27, 2024

Currently, the Scala 2 standard library is compiled with Scala 2. We would like to add extensions that are defined in Scala 3 and are meant to be consumed primarily by Scala 3. The problem is how to do that without introducing a split in the ecosystem.

Where we are today:

  • We can compile most of the Scala 2 standard library with the Scala 3 compiler
  • We have a Mima tool in place that checks binary forward compatibility with the Scala-2 compiled version. Currently it needs to apply fairly extensive filters to pass.

The proposed scheme is to

  • create a fork of the Scala 2 standard library,
  • add Scala 3 specific definitions to it
  • compile with Scala 3
  • check that the resulting library is binary compatible.

Projects that consist of 100% Scala 2 would continue to use the Scala-2 compiled library. Mixed projects would use the
newer Scala 3 library. The purpose of this issue is to identify all problems we need to fix before we can roll this out. Here are some to start with, please add others in the comments:

  • Make sure we achieve full binary compatibility between the two libraries. This will probably need a bunch of sub-issues that identify individual incompatibilities.
  • Handle root classes such as AnyVal, ot function and tuple types. The idea is to copy the Scala-2 classfiles as they are into the Scala 3 library, not try to recompile them with Scala 3.
  • Handle @specialized. Again, we could copy class files that use it as they are into the Scala 3 library. There are not that many outside of functions and tuples anyway.
  • Solve the Scala-2 side problems that could arise from having to read a later Scala 3 library using TastyReader. Alternatively, sunset TastyReader and don't support Scala2 modules relying on Scala 3 modules anymore.
@odersky odersky added the stat:needs triage Every issue needs to have an "area" and "itype" label label Nov 27, 2024
@Gedochao Gedochao added itype:enhancement area:library Standard library needs-minor-release This PR cannot be merged until the next minor release and removed stat:needs triage Every issue needs to have an "area" and "itype" label labels Nov 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:library Standard library itype:enhancement needs-minor-release This PR cannot be merged until the next minor release
Projects
None yet
Development

No branches or pull requests

2 participants