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

Add 🌟 Scala 3 🌟 support #5

Merged
merged 10 commits into from
Jul 28, 2024
Merged

Add 🌟 Scala 3 🌟 support #5

merged 10 commits into from
Jul 28, 2024

Conversation

danicheg
Copy link
Contributor

Santa appears to have arrived early this year 😄
I'll add some notes on the controversial points below in the PR body.

val Scala212 = "2.12.19"
val Scala213 = "2.13.13"
val Scala3 = "3.3.3"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Perhaps it's the most controversial thing. The recent version of Scala 3 is 3.4.2. But since Scala 3 doesn't keep forward compatibility between minor versions, we should barely stick with it. Also, Scala 3.3 is an LTS — https://virtuslab.com/blog/technology/scala-3-roadmap-for-2024/#at-least-one-lts-patch-for-every-two-next-patch-releases. Last but not least, many libraries I used to contribute have decided to stick with 3.3. I propose to act similarly.

Comment on lines 1 to 3
package contrib.shapeless3

trait Replacer[L <: Tuple, U, V]:
Copy link
Contributor Author

Choose a reason for hiding this comment

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

As a matter of fact, the full-fledged migration of shapeless-2 to Scala 3 is currently in progress (milessabin/shapeless#1200 — it's such a monumental work, I'm just shocked). So we need to migrate Replacer and Selector ourselves for a while.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

But yeah, I think some clarifications should be put into the comments. I'll go over it tomorrow.

Copy link
Owner

Choose a reason for hiding this comment

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

I wonder if the native derivation capabilities of Scala 3 are sufficiently powerful to eschew shapeless altogether?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I can imagine a solution powered by a Macro. However, it should also work with Scala 2 Macros. But I don't know if Scala 3 has anything out of pocket for replacing shapeless.Generic.

Copy link
Owner

Choose a reason for hiding this comment

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

I meant this: https://docs.scala-lang.org/scala3/reference/contextual/derivation.html#how-to-write-a-type-class-derived-method-using-low-level-mechanisms-1. But after a closer look it does not seem powerful enough (yet?). And I don’t like that using it seems to require writing a lot of asInstanceOf code.

@stanch
Copy link
Owner

stanch commented Jul 15, 2024

Whoa! This is awesome! I’ve never even used Scala 3 so happy to trust your judgement.

@danicheg
Copy link
Contributor Author

I’ve never even used Scala 3

The same here 🙈 But it doesn't stop me from contributing to its ecosystem (even if it's not Lean™ as some guys might wish).

@danicheg
Copy link
Contributor Author

So, I think that version is the ultimate of what I planned to do with it.

@danicheg
Copy link
Contributor Author

@stanch let me know if I can assist with anything to get this merged.

@stanch
Copy link
Owner

stanch commented Jul 28, 2024

Sorry for (another) delay. I have been working on this :D (and this)

@stanch stanch merged commit c86cc07 into stanch:master Jul 28, 2024
2 checks passed
@stanch
Copy link
Owner

stanch commented Jul 28, 2024

According to https://github.com/stanch/zipper/actions/runs/10134741271/job/28021338445, 0.7.0 is on Sonatype for 2.12, 2.13 (latest, per #6) and 3.3.

@danicheg danicheg deleted the scala-3 branch July 29, 2024 04:34
@danicheg
Copy link
Contributor Author

@stanch Wow, it really looks amazing! I can imagine how much joy crafting it brings :)

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.

None yet

2 participants