Support upcoming Scala 3 indentation-based syntax in Scala 2.13

To generalize a little, you are suggesting to backport a Scala 3 feature to 2.13 to give it more exposure. I see that this would be a practical way to test a new feature broadly.

However, this raises the question what features should be backported to 2.13 - enums were already suggested in this thread. Deciding what features are worth testing in this way is really non-obvious. I fear that the selection would be heavily biased by the feasibility, implementation complexity and risk for regressions.

There is also a chicken and egg problem: we want to backport a feature only once we know how it’s going to work in Scala 3. Many features I really wouldn’t want to backport to 2.13 right now, given the pace at which things still evolve in Dotty. But then it’s too late for testing and evaluating: it is now that we need to gather feedback about the new features, to get them finalized and decide if they’re viable.

I also have the feeling that backporting features would give a wrong incentive. Our goal should be to support projects in migrating and cross-compiling with Scala 3, to actually test Scala 3, the interaction of new features, the robustness of the new compiler, the quality of the backwards compatibility, etc.

5 Likes

Thanks for your detailed reply. I think maybe “back port” is too big of a word, but I understand where you’re coming from. The proposal here was to have experimental support under a flag only for the indentation-based syntax changes, so I intentionally drew a line here between this particular set of syntactic changes and the others because they are (a) easy enough to implement in the parser and (b) controversial enough that might warrant an exception to the rule of not backporting changes from Scala 3 and instead focus on the migration. This line might seem arbitrary and in a way it is… so yeah, I agree there might be other things worthier of attention.

3 Likes

For example, I might want to try out infix operators at the beginning of the line but the PR isn’t merged.

1 Like