30

In hist recent talk at Strange Loop Martin Odersky shed the light on his vision of Scala's future version called Dotty. I understand this is work-in-progress and it even may not flow into Scala (at least not very fast) due to many possible backward-compatibility issues. But if it happens, how should we program in Scala today to be forward-compatible with Dotty? I didn't get all the ideas from the talk so I'd like someone more profound to summarize the changes and describe how can we prepare to them.

Tvaroh
  • 6,645
  • 4
  • 51
  • 55

2 Answers2

36

The only other advice I would give is to also stay away from structural types containing a type members. Those type members are the elements that make type-checking in Scala turing complete, and I am not yet sure whether we want to support that in Dotty. Structural types that contain only vals and defs will likely stay supported.

Lii
  • 11,553
  • 8
  • 64
  • 88
Martin Odersky
  • 20,470
  • 9
  • 51
  • 49
  • 2
    Martin, do libraries heavily relying on higher-kinded types, like Scalaz, ought to be rewritten in alternative style? As I understand there will be no backward binary compatibility and code compiled with pre-Dotty Scala version won't work with Dotty, am I right? – Tvaroh Nov 22 '13 at 14:23
  • 1
    It's too early to tell. We will maintain some backwards compatibility with higher-kinded types as long as it requires not more than reasonable effort. – Martin Odersky Nov 22 '13 at 16:43
  • 2
    Are these answers still relevant today? – Jasper-M Dec 07 '16 at 08:59
11

Towards the end of the talk, he says "if your program is compiled without any language feature imports for higher-kinded and existentials then you should be ok".

So if I understand it correctly the only thing you would need to be aware of is any possible usage of existential types or higher-kinded types in your code.

Knut Arne Vedaa
  • 15,372
  • 11
  • 48
  • 59