How will Dotty change pure functional programming in Scala?

Since 2013, Mr. Odersky notes that β€œit’s too early to talk about whether libraries like Scalaz will be able to” (at least in their current state) under Dotty, due to castration of higher and existential types .

Has it turned out over the years that the consequences of Dotty for Scalaz and Cats have been clarified? Will the proposed features, such as built-in effects and recordings, change the scale of these projects?

I understand that Dotty is still not able to replace scalac, but since I am considering investing time by applying purely functional constructs and methodologies to my work, I consider it important to consider the future of my flagship libraries.

+7
scala scalaz scala-cats dotty
source share
1 answer

One example of the last of Dotty is Scala Scaling by Chris McKinley (December 15, 2016) (the same article also mentions the situation with Scalaz and Cats)

Martin Odersky leads Dotty , a new research compiler based on the Dependent Object Types (DOT) calculus (mostly a simplified version of Scala) and ideas from the functional programming database community (FP).

The Dotty development team has shown some remarkable improvements in prior art, especially with respect to compilation time. I asked Odersky what he thought of Dotty architecture and helped end users. Here is what he said:

Two things come to mind:

  • Firstly, it is closely related to formal foundations, giving us the best guidance on designing a sound type system. This will result in fewer surprises for users along the way.
  • Secondly, it has an essentially functional architecture. This simplifies the extension, simplifies obtaining validity, and leads to the creation of more robust APIs that use the compiler as a service for IDEs and meta-programs.

Although Dotty opens up a number of interesting language opportunities (especially depending on the full range of types, a la Agda and Idris ), Odersky decided to give priority to making it immediately useful to the community. The language differences are quite small, and most of them are designed to simplify the language (for example, to remove the procedure syntax) or to correct errors (incorrect pattern matching) or both (early initializers).

However, I couldn't help asking him if there is a chance that all types depending on the full spectrum end in Scala at some point. Here is what he said:

Never say never:-). In fact, we are currently working with Victor Kunkak to integrate Leon with Scala, which requires richer dependent types than now. But this is currently a rigorous study, with a completely open result.

The Scala and Dotty teams work closely with the convergence for Scala 2.x and Dotty, and they indicated that they take continuity very seriously. Scala 2.12 and 2.13 have language flags that unlock functions incubated in Dotty (for example, existential types), and the Dotty compiler has Scala 2 compatibility mode. Theres even a migration tool .

+3
source share

All Articles