Skip to content

Code sharing between Scala 2 and Scala 3 #625

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

Closed
anatoliykmetyuk opened this issue Apr 23, 2019 · 3 comments
Closed

Code sharing between Scala 2 and Scala 3 #625

anatoliykmetyuk opened this issue Apr 23, 2019 · 3 comments
Milestone

Comments

@anatoliykmetyuk
Copy link

In Dotty, we've encountered a problem that the Dotty's version of ClassfileParser presumably fell behind the Scala 2's one (see scala/scala3#6136). This appears to be a specific case of a more general problem of code sharing between Scala 2 and 3. In this issue, I propose to discuss the ways we can keep the Scala 2 and 3 components DRY and in sync.

I believe the following questions need to be answered:

  • What code repeats between Dotty and Scala 2?
  • What considerations do we need to take into account when sharing between Dotty and Scala 2? What are the obstacles?
  • How do we share the code?

Regarding the second point, I suppose one obstacle would be the coupling it creates between Dotty and Scala 2. The changes to Scala 2 and Dotty may affect each other, and this complicates experimentation.

Another consideration is that the code bases are big, and it may take a lot of work to see what can be shared and to actually share it.

@adriaanm, would love to hear your opinion on the above.

@adriaanm
Copy link
Contributor

I think we should invest in sharing code, and we'll soon have time to start working on this (when 2.13.0 is out). I'm very open to change scalac internals/APIs to make this happen, to reorganize source folders, git submodules,....

Let's start with the backend (genbcode + optimizer), and figure out how to define an interface that works for both frontends with minimal glue code. I suppose it will have to be compiled from source against both frontends for best performance, but if we can find a way to share a binary artifact, that would be amazing.

@SethTisue
Copy link
Member

should this stay open? is there anything here that's actionable now from the Scala 2 side?

(I think maybe we should close it and then wait for requests to be initiated from the Scala 3 side?)

@SethTisue SethTisue added this to the Backlog milestone Oct 23, 2020
@anatoliykmetyuk
Copy link
Author

Yes, I believe there are no concrete plans on this. So we can close it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants