mouse icon indicating copy to clipboard operation
mouse copied to clipboard

Scala 3 [draft]

Open benhutchison opened this issue 4 years ago • 8 comments
trafficstars

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.

benhutchison avatar Feb 18 '21 03:02 benhutchison

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

larsrh avatar Mar 01 '21 20:03 larsrh

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

larsrh avatar Mar 01 '21 20:03 larsrh

Er, why? The proposal is to go 2 branch, not 3 only..

On Tue., 2 Mar. 2021, 7:29 am Lars Hupel, [email protected] wrote:

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

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/typelevel/mouse/pull/182#issuecomment-788251556, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAXJZHZ2TB7SWTHIYEKFC3TBP2L3ANCNFSM4XZRAX2A .

benhutchison avatar Mar 01 '21 20:03 benhutchison

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.

larsrh avatar Mar 01 '21 20:03 larsrh

We need to keep in perspective what mouse is: a small, simple and slowly changing api, almost 100% extension methods.

Im not convinced mouse should grow much larger. So I think it's unlikely downstream consumers will be greatly impacted if the branches are source compatible.

On Tue., 2 Mar. 2021, 7:33 am Lars Hupel, [email protected] wrote:

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.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/typelevel/mouse/pull/182#issuecomment-788253813, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAXJZB2ZNVSPIIDRSINTB3TBP2YHANCNFSM4XZRAX2A .

benhutchison avatar Mar 01 '21 20:03 benhutchison

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.

larsrh avatar Mar 01 '21 20:03 larsrh

If by "clean migration" you mean, change scalaVersion from 2.x to 3.x in build.sbt and everything else just works, no that will not be possible. But this is a major version jump, the last one was circa 2006, with breaking language changes. Using a different version of a library is not an unreasonable ask of users. A small number of downstream libraries will need version specific logic, but my impression is that mouse's consumers are mainly applications not libs, that run on a single version.

On Tue, Mar 2, 2021 at 7:57 AM Lars Hupel [email protected] wrote:

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 to be conditional on the Scala version. This is very inconvenient and breaks expectations from past Scala migrations.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/typelevel/mouse/pull/182#issuecomment-788274217, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAXJZBT6GVRI4AZAF5SYS3TBP5UBANCNFSM4XZRAX2A .

benhutchison avatar Mar 01 '21 21:03 benhutchison

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.

larsrh avatar Mar 02 '21 06:03 larsrh