Migrating to Scala 3

I am still fairly new to Scala and working on my very first project where all code I write myself will be Scala (that said: I of course continue to use libraries written in Java).

I am now wondering at what point I should move on to Scala 3. I think, the smaller the code base is the easier the migration will be which would mean an early switch.

On the other hand, since I am not a Scala expert yet, every problem I have would be first be checked if it is something I do wrong with Scala or a bug in Scala 3.

What are your thoughts on that?

2 Likes

Are you also going to use libraries written in Scala? If yes, then you would have to wait for those to become available for Scala 3. Continuing to use Java libraries should not be a problem as long as these are available in a recent version of Java.

I think it depends on what you’re doing it for. If it’s mainly for fun and self-education, it might be worth trying in Scala 3, since that’s the future.

But for anything more serious, I’d say it’s premature. As @curoli points out, only a modest number of libraries have been ported to Scala 3 yet, so there are likely to be some roadblocks there. Perhaps more importantly, it’s still a moving target: while the Scala 3 language is gradually settling down, it’s nowhere near complete yet – it’s certain that some details are still subject to change, and it wouldn’t surprise me if code written today would need to be adjusted a couple of times before 3.0 is actually released.

2 Likes

IIUC Scala 2.13 libraries can be used in Scala 3 projects but not yet the other way around.

At this stage of the project I will probably use only Akka and lightbend-config as a Scala dependency.

Thank you! It’s both self-education and serious, but the focus is on latter so I think I will stick with Scala 2 then.