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 support #149

Open
aartigao opened this issue May 20, 2021 · 5 comments
Open

Scala 3 support #149

aartigao opened this issue May 20, 2021 · 5 comments

Comments

@aartigao
Copy link

Not an issue, just a question: now that Scala 3 is a reality, are there any plans to support it? Specially for UNION types and removing the Shapeless dependency? Thanks!

@yzia2000
Copy link

yzia2000 commented Dec 3, 2021

I think shapeless 3 is out: https://github.com/dotty-staging/shapeless/tree/shapeless-3. However, dependency on scala-reflect will be a concern. Is this issue on the roadmap?

@patryk-celinski
Copy link

I'm struggling with updating the application using avrohugger from Scala 2 to Scala 3. I did extensive research on the matter.

shapeless-3 won't be much of help - avrohugger will need a complete rewrite to Scala 3. The thing is that Scala 3 removes the need for shapeless and if you look at shapeless 3 this is just a bunch of utils that help to automatically derive type classes - its more of a showcase of how cool Scala 3 is and shapeless is not needed anymore - than a newer version of shapeless.

In Scala 3 the Tuple type is a replacement for HList so generic programming is becoming a language-level feature. Tuples are covering the Product side of the problem, there is a problem with Coproduct/Sum side (related to inheritance, sealed traits family, enums basically) that they don't have their counterparts in Scala 3. It requires expertise in Scala 3 metaprogramming to recreate them - not sure if just inlining + type class derivation, or macros would be needed by avrohugger to update to Scala 3. I think it will be much easier than updating avrohugger to Scala 3 would be writing a new avrohugger-3 using Scala 3 features from start.

@patryk-celinski
Copy link

I found out that avrohugger uses treehuger that uses scala 2.12 - which also affects the chances of updating this project to Scala 3. Probably in Scala 3 build treehugger can be replaced only by Scala 3 macros.

@vesko-vujovic
Copy link

Are there any updates about plans to rewrite everything in Scala 3? Is this in the roadmap?

@julianpeeters
Copy link
Owner

Thanks for the helpful assessments, and inquiries. Long term, Scala 3 is a "yes", but I don't foresee having concrete plans or an ETA (PRs welcome, of course).

Current status: crossbuilding for 2.12, 2.13, and 3

  • kept treehugger by using CrossVersion.for3Use2_13
  • dropped scala-reflect and associated reflective compilation functionality
  • punted on unions

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

5 participants