Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to program in Scala to be forward-compatible with Dotty

Tags:

scala

dotty

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.

like image 725
Tvaroh Avatar asked Nov 21 '13 19:11

Tvaroh


2 Answers

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.

like image 108
Martin Odersky Avatar answered Oct 15 '22 05:10

Martin Odersky


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.

like image 11
Knut Arne Vedaa Avatar answered Oct 15 '22 07:10

Knut Arne Vedaa