exercism / scala

Exercism exercises in Scala.
https://exercism.org/tracks/scala
MIT License
123 stars 131 forks source link

Scala3 #734

Closed LarsWestergren closed 1 month ago

LarsWestergren commented 2 years ago

Some compiler warnings, should I fix those too?

Fixes https://github.com/exercism/scala/issues/684

LarsWestergren commented 2 years ago

Dependent on https://github.com/exercism/scala/pull/735

ErikSchierboom commented 2 years ago

Just so you know: I'm back :) So let me know if you need me to test anything.

LarsWestergren commented 2 years ago

Just so you know: I'm back :) So let me know if you need me to test anything.

New project (Golang!) started today so a bit hectic at work now, but in a week or two I hope to pick this up again. Currently stuck on "testgen" which is a bigger task, I get a macro compile error from the Play JSON libs after upgrading to the Scala 3 versions (not officially released yet, at Milestone) and looking into why.

ErikSchierboom commented 2 years ago

Sure, no rush!

samuelsayag commented 1 year ago

Hello guys, Just a few comments and questions and first a thanks to @LarsWestergren :)

scala 2

Is it wise to replace the current scala2 track by a scala3 one? Would it be complicated to create another parallel track for scala3?

thanks!!

ErikSchierboom commented 1 year ago

Is it wise to replace the current scala2 track by a scala3 one?

You could argue the same thing for Python 2 vs Python 3 🤷 It will be a fact that there are a lot of code bases out there that use Scala 2, but that will hold for any new version of a language, as adoption will take time. That does not mean that we shouldn't upgrade. In general, we always like to keep our tracks on the latest version, as it'll offer the latest features and usually the documentation of the language will also refer to the latest version, making it easier for students to find things.

There are also guides available to migrate form v2 to v3, like https://scalacenter.github.io/scala-3-migration-guide/docs/external-resources/moving-from-scala-2-to-scala-3.html

Would it be complicated to create another parallel track for scala3?

It is not an option, as we'll only have one track per language. Sorry.

JonathanReeve commented 1 year ago

How's this going? Scala 3 has been out for a while now, and all the beginner books I see on Scala use Scala 3. Sticking with Scala 2, then, seems unusual. I'm a Scala beginner, but is there some way I could help?

LarsWestergren commented 1 year ago

How's this going? Scala 3 has been out for a while now, and all the beginner books I see on Scala use Scala 3. Sticking with Scala 2, then, seems unusual. I'm a Scala beginner, but is there some way I could help?

Had a light case of burnout, getting better but still taking it easy on weekends and holidays. I hope to start up again soon, but in the meantime, feel free to fork and continue the work if you want to. As you can see the exercises part should be done (unless more exercises have appeared since), I stopped at the "testgen" subproject. The upgraded Play libraries should hopefully be released now so I'll check if it compiles with Scala 3 or if code changes need to be done.

ErikSchierboom commented 1 year ago

Sorry to hear about the burnout @LarsWestergren! Definitely take it easy. There is no rush getting this merged.

NatiAris commented 1 year ago

Are you sure about replacing the existing track?
Scala 2 and Scala 3 are more dissimilar than Python 2 and Python 3 were.
Most of Scala code in existence is Scala 2 and will stay so for quite a while, so having a place to practice Scala 2 is actually quite beneficial, as most job postings are still Scala 2 as well.
Many things that were the way to go in Scala 2 wouldn't be in Scala 3 (e.g. implicits are still supported but not actually intended to be used in new code, rather only facilitating 2 to 3 migration).
Plus, with a separate track it would be possible to migrate problems one-by-one, rather than doing it in a single enormous undertaking.
I don't know how many steps creation of a separate track involves, though.

ErikSchierboom commented 1 year ago

We'll give it some thought. Thanks for your feedback

Sam647254 commented 1 year ago

Just wondering if this is still being worked on? It's been a few months since the last update, and Scala 3.3.0 is now the latest version; if others are not available to continue the migration, then I can (try to) pick it up as well.

ErikSchierboom commented 1 year ago

Just wondering if this is still being worked on? It's been a few months since the last update, and Scala 3.3.0 is now the latest version; if others are not available to continue the migration, then I can (try to) pick it up as well.

It looks like there hasn't been any progress, so I think you can safely work on it!

LarsWestergren commented 1 year ago

Just wondering if this is still being worked on? It's been a few months since the last update, and Scala 3.3.0 is now the latest version; if others are not available to continue the migration, then I can (try to) pick it up as well.

Please do! I keep hoping I can start working on it again, but i keep being busy with work stuff so it would be fantastic if someone takes over and finishes it.

apetresc commented 1 year ago

Out of curiosity, is there a way for users to sponsor/bounty a specific initiative, like this one?

ErikSchierboom commented 1 year ago

Not really, no.

edit: well, you can sponsor us at https://exercism.org/insiders, but that's more of an indirect way :)

asarkar commented 9 months ago

@LarsWestergren What are the steps one should follow if they want to pick up and finish this PR? And, roughly how much time should they expect to set aside for this task? Knowing the answer to these questions will help me decide if I can contribute.

LarsWestergren commented 9 months ago

@LarsWestergren What are the steps one should follow if they want to pick up and finish this PR? And, roughly how much time should they expect to set aside for this task? Knowing the answer to these questions will help me decide if I can contribute.

I was done with all the exercises I think. I don't think anyone has added new exercises to the Scala track since, but not sure. From what I recall, fixing the "testgen" directory sbt targets is what remains. When I was working on it, play-json (and maybe twirl-api?) had not been updated to work with Scala 3. I think they relied on macros which changed a lot in Scala 3. If the libraries have been upgraded now, there may just be a day or twos work left hopefully? If the libraries have not been ported, replacing the functionality with other libraries might be a bigger job. Difficult for me to estimate how long that would take, especially for someone else to do it. But maybe expect to set aside a couple of days or even a week for it?

For the exercises, I had done just the bare minimum to make it compile. There probably lots that can be done to make the solutions much more idiomatic and elegant Scala 3. But that is something that can be addressed in small PRs from multiple contributors once the move to Scala 3 has been merged.

ErikSchierboom commented 9 months ago

But that is something that can be addressed in small PRs from multiple contributors once the move to Scala 3 has been merged.

Absolutely.

ErikSchierboom commented 9 months ago

@LarsWestergren Let me know when I can review

ErikSchierboom commented 1 month ago

We now have Scala 3 support thanks to #836