vickumar1981 / stringdistance

A fuzzy matching string distance library for Scala and Java that includes Levenshtein distance, Jaro distance, Jaro-Winkler distance, Dice coefficient, N-Gram similarity, Cosine similarity, Jaccard similarity, Longest common subsequence, Hamming distance, and more..
https://vickumar1981.github.io/stringdistance/api/com/github/vickumar1981/stringdistance/index.html
Other
78 stars 15 forks source link

Upgrade to Scala 3 #63

Open vickumar1981 opened 3 years ago

vickumar1981 commented 3 years ago
vickumar1981 commented 3 years ago
FlorianCassayre commented 3 years ago

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 commented 3 years ago

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

this issue: https://github.com/vickumar1981/stringdistance/issues/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 commented 3 years ago

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 commented 3 years ago

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

mberndt123 commented 2 years ago

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.