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

Upgrade to Scala 3 #63

Open
vickumar1981 opened this issue Feb 20, 2021 · 6 comments
Open

Upgrade to Scala 3 #63

vickumar1981 opened this issue Feb 20, 2021 · 6 comments

Comments

@vickumar1981
Copy link
Owner

  • Upgrade for use with Scala 3
  • Scala 3 has new keywords for doing type classes. Old Scala 2 way, should still work, but re-writing for Scala 3 style might break backwards compatibility with Scala 2.
@vickumar1981
Copy link
Owner Author

vickumar1981 commented Jun 10, 2021

  • Possible solution: create a new github repo for Scala 3, i.e. stringdistance3 that works for more up-to-date versions of the JVM (java 14+) and Scala 3+.

  • How are existing libraries that use the type class pattern and extend my library pattern migrating to Scala 3 and handling the more clear and concise way of dealing with the implicit keyword?

@FlorianCassayre
Copy link

It's possible to migrate the project to Scala 3 while keeping a cross compilation target to both 3.X and 2.13. Old Scala implicits will still work, but I believe it is possible to replace them by the new language features without breaking compatibility (reference). I'm not sure if it is possible to compile to earlier versions though (i.e. Scala 2.12), but that shouldn't be a blocker in my opinion.

@vickumar1981
Copy link
Owner Author

@FlorianCassayre compiling to 2.12 and even 2.11 might actually be a blocker.

this issue: #50, for example, was opened so that you can add this library as a dependency in Apache Spark. Spark, from what I understand, is still using older versions of the Scala compiler (<= 2.12). I would be inclined to just drop support for those versions, but I think some consideration has to be given to ML platforms where a fuzzy matching library might be used.

@vickumar1981
Copy link
Owner Author

Thinking about this some more, I think we should target version 2.0.0 for Scala 3 and Java 14+. I think bumping to a new major version might be the easiest approach. I think that step 1 is to start a 2.0.0-SNAPSHOT branch, using Scala 3. I can start on it in the next few weeks.

@FlorianCassayre
Copy link

Nice, happy to hear that. I also believe it should be the easiest solution since most libraries are using this pattern.

@mberndt123
Copy link

Thinking about this some more, I think we should target version 2.0.0 for Scala 3 and Java 14+. I think bumping to a new major version might be the easiest approach. I think that step 1 is to start a 2.0.0-SNAPSHOT branch, using Scala 3. I can start on it in the next few weeks.

Um, allow me to disagree. The easiest approach is clearly to just cross-compile for Scala 3. You said that you need to keep a branch with the old syntax around anyway in order to support Scala 2.x, and that syntax is still fully supported by the Scala 3 compiler. So why bother with the new syntax? You can always switch to that once Scala 2.x support is no longer necessary.

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