4 ms·
> Scala libraries need to be cross compiled with different Scala versions. This seems like a big turn off. Question to any Scala dev's out there. Does this g
by jmartrican 6y ago
> Scala libraries need to be cross compiled with different Scala versions.
This seems like a big turn off. Question to any Scala dev's out there. Does this get in the way? And does it make upgrading Scala versions difficult?
- MrPowers 6y agoUpgrading Spark from Scala 2.11 to Scala 2.12 was a huge effort. See here for more discussion: https://contributors.scala-lang.org/t/spark-as-a-scala-gateway-drug-and-the-2-12-failure/1747 https://contributors.scala-lang.org/t/spark-as-a-scala-gatew... Some projects are easier to upgrade, but for complex projects, minor Scala version bumps can be quite challenging.
- AheadOfTime295 6y agoAnd the story goes on: upgrading Spark to Scala 2.13 https://issues.apache.org/jira/browse/SPARK-25075 https://issues.apache.org/jira/browse/SPARK-25075
- thinkharderdev 6y agoScala minor versions are not binary compatible. So if you try and use a library compiled for 2.12 in a project that is using 2.13 it won't work. In practice though it is not a major issue. It is easy for library authors to cross-compile for different versions and SBT handles fetching to correct binary dependency for your project. And in general, binary incompatibility doesn't mean source incompatibility. So generally uprgrading your projects scala version is as simple as changing the scalaVersion in your build.sbt. The exceptions are: 1. If you have a dependency that hasn't been cross-compiled for the new Scala version yet. So if you are trying to upgrade as soon as a new Scala minor version comes out then you may have issues if you have a lot of dependencies. 2. If you are trying to publish a library compiled for multiple older Scala versions then you can run into source compatibility issues. For instance, if you are using a method/interface that is new as of Scala 2.13 you won't be able to cross-compile to Scala 2.12.