Skip to content

Blog post. Scala 2 Roadmap Update: the Road to Scala 3 #1098

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

Merged
merged 2 commits into from
Dec 18, 2019

Conversation

lrytz
Copy link
Member

@lrytz lrytz commented Dec 18, 2019

No description provided.

@lrytz lrytz requested a review from sjrd December 18, 2019 10:19
Copy link
Member

@sjrd sjrd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have a few suggestions below, but overall LGTM.

@adriaanm
Copy link
Contributor

Thanks for the suggestions! I batched them all but then when trying to commit it turns out I don't have permission. @lrytz could you either check the box to allow outside committers or redo the accept all changes?

@lrytz
Copy link
Member Author

lrytz commented Dec 18, 2019

Hmm, it's checked
image

Not sure what's the problem...

@adriaanm
Copy link
Contributor

@sjrd: is this ok to merge today given the follow up commit?


* **Runtime performance of generated code**. The code generation phase of the Scala 3 compiler is the same as in Scala 2.13, and also the ABI (the way Scala features are encoded in class files) in Scala 3.0 will be the same. We expect that code compiled with Scala 3 will perform the same, and we will work with the community to verify that this is the case. The Scala 2 optimizer will also be available in Scala 3.

* **Performance-oriented language features**. While value classes continue to work, Scala 3 brings [opaque type aliases](https://dotty.epfl.ch/docs/reference/other-new-features/opaques.html) that provide type abstraction without any overhead. [Inline methods](https://dotty.epfl.ch/docs/reference/metaprogramming/inline.html) can be used for methods that are guaranteed to be inlined at compile-time. Scala 3 currently does not implement specialization. We will work with maintainers of performance-sensitive projects to find out what variants of specialization need to be supported. This work will likely land in a Scala 3.x minor release.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Given that the Scala 2 library uses specialization for Function1 etc. and Tuple2 etc., doesn't this mean that even seemingly innocuous code like

def foldInts(zero: Int, op: (Int, Int) => Int, array: Array[Int]) = {
  var acc = zero
  var i = 0
  while (i < array.length) { acc = op(acc, array(i)); i += 1 }
  acc
}

is going to get like 40x slower due to boxing?

Or is this already fixed? If it's fixed, now is probably a good time to mention it.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We handle function specialization by hand so that one is probably OK.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might be worth mentioning it, then. Maybe link to any docs on what is handled by hand (just function literals?). Most uses of specialization are rather esoteric, but this one isn't.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would be great to have this discussion on discourse!


Together with the Scala 3 team at EPFL (aka the Dotty team), led by Martin Odersky, we have decided that, rather than developing Scala 2.14, our efforts should go to Scala 3 instead.

While we're very excited to shift our focus to Scala 3, we will continue to maintain Scala 2.13 to ensure the community has ample time to carefully transition to Scala 3.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"While we're very excited" should probably be "While the Lightbend team is very excited", since otherwise the "we" here defaults to include Martin, who shifted his focus to Scala 3 a long time ago.

@sjrd
Copy link
Member

sjrd commented Dec 18, 2019

@adriaanm OK to merge from me, yes.

Copy link
Member

@SethTisue SethTisue left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the confusion about "we" right at the start really ought to be improved before this is published. (see resolved conversation) Everything else is strong, I think. (I see many good changes and additions since the last draft I saw 👍 )

@adriaanm
Copy link
Contributor

Thanks everyone. I think it's more important this goes out today so that we can discuss on contributors over the next few days before the break.

@adriaanm adriaanm merged commit 552fc70 into scala:master Dec 18, 2019
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

Successfully merging this pull request may close these issues.

6 participants