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

Scala 3 [draft] #182

Draft
wants to merge 7 commits into
base: main
Choose a base branch
from
Draft

Scala 3 [draft] #182

wants to merge 7 commits into from

Conversation

benhutchison
Copy link
Member

Here is my work on Scala 3 support.

2 branch strategy

  • master will be Scala 3.x. Aiming for source compatible with existing mouse, save for a few deprecations.
  • current master becomes scala2 branch, fixes only

Remaining:

  • Pull the examples from the README into a /example subproject that is shared across both branches, link from README. That's to help ensure source compatbility across the rewrite.
  • Thinking to wait for the syntax of Scala 3 to stabilize before publishing Scala 3 binaries.

… time. Migrate from Scalatest to Munit. Drop Scalacheck and property-based tests that were overkill for simple methods. Deprecate a bunch of methods to try to align with naming conventions in the std lib. Code bulk also dropped as top-level definitions & exports avoid some package object boilerplate
@benhutchison benhutchison mentioned this pull request Mar 1, 2021
3 tasks
@larsrh
Copy link
Contributor

larsrh commented Mar 1, 2021

I would strongly recommend against going 3-only just yet. Cross-building for mouse shouldn't be a problem, no?

@larsrh
Copy link
Contributor

larsrh commented Mar 1, 2021

(The suggestion to use withDottyCompat in #149 is not at all a silver bullet)

@benhutchison
Copy link
Member Author

benhutchison commented Mar 1, 2021 via email

@larsrh
Copy link
Contributor

larsrh commented Mar 1, 2021

The problem with a two-branch strategy is that it becomes impossible to ensure that both Scala 2 and Scala 3 builds are on par with features. Essentially, you are forcing every downstream dependency to also use a two-branch strategy.

@benhutchison
Copy link
Member Author

benhutchison commented Mar 1, 2021 via email

@larsrh
Copy link
Contributor

larsrh commented Mar 1, 2021

Downstream consumers, no matter whether they're libraries or applications, will 100% be affected by your proposal. Essentially, even if there is source compatibility (which you cannot enforce if you have multiple branches), there is no clean migration path from Scala 2 to Scala 3 because suddenly users need to make their dependency on mouse conditional on the Scala version. This is very inconvenient and breaks expectations from past Scala migrations.

@benhutchison
Copy link
Member Author

benhutchison commented Mar 1, 2021 via email

@larsrh
Copy link
Contributor

larsrh commented Mar 2, 2021

Using a different version of a library is not an unreasonable ask of users.

It is unreasonable if there's no pressing need for it. This library (status quo) certainly doesn't use match types or macros or any other features specific to a Scala version. It creates pain for users while giving them no benefit whatsoever in return.

@benhutchison benhutchison mentioned this pull request Mar 3, 2021
Copy link
Member

@danicheg danicheg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My two cents about Scala 3 migration.
I like the idea of using extension methods for Scala 3. Also, I think we can have one main branch, and introduce a new syntax for Scala 3 using the same approach as in #248 (use different source directories for Scala 2 and Scala 3). What do you think @benhutchison?

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

Successfully merging this pull request may close these issues.

3 participants