Scala 2.13 and Scala 3 share the same Application Binary Interface (ABI).
The ABI is the representation of Scala code in bytecode or Scala.js IR. It determines the run-time behavior of Scala programs.
Compiling the same source code with Scala 2.13 and Scala 3 produces very similar bytecodes. The difference being that some features have changed, for instance the initialization of lazy vals has been improved.
Sharing the ABI also ensures that Scala 2.13 and Scala 3 class files can be loaded by the same JVM class loader.
Similarly, that Scala 2.13 and Scala 3
sjsir files can be linked together by the Scala.js linker.
Furthermore it relieves us from surprising behaviors at runtime. It makes the migration from Scala 2.13 to Scala 3 very safe in terms of run-time crashes and performance.
At first sight the run-time characteristics of a Scala program is neither better nor worse in Scala 3 compare to Scala 2.13. However some new features will help you optimize your program:
Contributors to this page:
- Compatibility Reference
- Source Level
- Classpath Level
- Tour of the Migration Tools
- Scala 3 Migration Mode
- Migration Tutorial
- Porting an sbt Project (using sbt-scala3-migrate)
- Porting an sbt Project (by hand)
- Cross-Building a Macro Library
- Mixing Scala 2.13 and Scala 3 Macros
- Scala 3 Syntax Rewriting
- Incompatibility Table
- Syntactic Changes
- Dropped Features
- Contextual Abstractions
- Other Changed Features
- Type Checker
- Type Inference
- Compiler Options
- Compiler Options Lookup Table
- New Compiler Options
- Scaladoc settings compatibility between Scala2 and Scala3
- Compiler Plugins
- Kind Projector Migration
- External Resources