Scalax

10,945 views

Published on

Talk given at Scala Exchange 2014, Dec. 2014.

Published in: Software

Scalax

  1. 1. The Binary Compatibility Challenge Martin Odersky Typesafe and EPFL
  2. 2. The Problem in a Nutshell • Binary compatibility has been an issue ever since Scala became popular. • Causes grief when building, friction for upgrading. • The community has learned to deal with this by becoming more conservative. • But this makes it harder to innovate and improve. Break your client’s builds vs Freeze, and stop improving Is there no third way? 2
  3. 3. What is Binary Compatibility? Binary compatibility ≠ Source compatibility Source & binary incompatible object Client { msg.length } object Server { val msg = “abc” } object Server { val msg = Some(“abc”) }
  4. 4. What is Binary Compatibility? Binary compatibility ≠ Source compatibility Source incompatible, binary compatible: object Client { import a, b val x: String = 1 } object a { implicit def f(x: Int): String = x.toString } object b object a { implicit def f(x: Int): String = x.toString } object b { implicit def g(x: Int): String = ”abc” }
  5. 5. What is Binary Compatibility? Binary compatibility ≠ Source compatibility Source compatible, binary incompatible: object Apple extends Edible { def joules = 500000 } trait Edible { def joules: Double } trait Edible { def joules: Double def calories = joules * 4.184 }

×