Closed patryk-celinski closed 9 months ago
plan for Scala 3 migration
extra&idea
There are several things in the library that need a clean up but it would be better to address after the Scala 3 support is released. I believe it's better to allow users to keep using the same features with latest Scala as that would allow for a smoother transition.
Among the things I would like to clean up is in fact the Scala 2 support. This is a very simple library whose primary functionality is quite stable and most users are happy with it. So once a path towards Scala 3 is given, removing Scala 2 would allow to also remove a lot of warts or convoluted code.
Other changes that I would like to address would be:
fast parse
which, yeah, it's fast, and also a hell to maintain (it was basically a macro-porn library with very obscure compilation error messages). As you can see in the code, there is a benchmark using atto
parser, the choice of using Scala parser combinators was done based on the fact that being slower than fastparse
, it was faster than atto
and easy to maintain. Regardless of that, it's true that this is ripe for an improvement and I'm happy to explore the possibilities of other libraries.cron4s-js-joda
module either.Happy to hear about other proposals. In way, I like the idea of keeping the library simple as hell, just being a glorified parser of CRON expressions and a calculator for future dates with a very simple user experience that way other projects can build more advanced systems around it.
Hi, I would be quite interested in a release of cron4s with scala 3 support. If there are things to fix, I can offer some help. Let me know. Cheers,
hi @mbaechler, to be fair, everything should be more or less ready, the code in main
is already compatible with Scala 3 the only remaining bit is publishing it.
We have an attempt some time ago that failed and live got in the way and I didn't have much time to look into it: https://github.com/alonsodomin/cron4s/actions/runs/5462541330/job/14789162567
I'll try to trigger the build once again so I can see what the problem is and get the published version through the line.
Hi @alonsodomin , thank you for your answer, i can't find your new try at publishing the artifacts, if you run it, I can probably have a look at the logs.
Cheers,
Hi @mbaechler just made a general upgrade of the dependencies and gave it another go. The build is failing at the stage in which it generates the Scala docs for Scala 3. You can see the run here:
https://github.com/alonsodomin/cron4s/actions/runs/7366389197
Seems similar to the following issue, although somewhat unrelated... https://github.com/lampepfl/dotty/issues/14143
Hi @alonsodomin
I think I nailed the issue here : https://github.com/alonsodomin/cron4s/pull/552
Could you have a look?
thanks a lot @mbaechler
cron4s with support for Scala 3 has been published with version 0.7.0
Are there any plans to update cron4s for Scala 3?
I see that shapeless is used in 10 files and there are some plugins like macro paradise and kind projector that I'm not sure how to assess their influence. Albeit macro paradise uses partialVersion so this is probably not a problem. Shapeless is the main blocker and the fact that it is not needed in Scala 3 and supposedly was replaced by language-level features.