Dotty: An Alternative to Implicits

By Mark "Justin" Waks

On the Dotty News Watch front: the “Alternative to Implicits” PR, which has been on the table for a while (and has changed names a couple of times) is nearing completion.

Usual caveats: this isn’t official yet — it’s a proposal that Martin has been working on for some time. But it might get merged to master soon. (Which doesn’t mean it is a shoo-in for inclusion in Dotty, but it’s at least under serious consideration.) Also, all of the below is simply my interpretations, and should not be taken as gospel truth: see the linked pages for more authoritative discussion.

This one is pretty big and important — arguably the most conspicuous language change for Scala 3. The high concept is replacing most (maybe all) uses of the implicit keyword with higher-level constructs — in particular, introducing syntax to more-explicitly support typeclasses in Scala. The proposal doesn’t change semantics all that much, but it reduces the overloading of implicit with alternatives that hopefully will express the intent of code better, and reduce the boilerplate around typeclass instances a bit.

Useful pages for reading into this proposal:

It’s fascinating stuff — refocusing Scala’s most distinctive and controversial feature around its distinctive use cases.

Extensive discussion and debate can be found on the PR itself. This has evolved a lot over the past month or so, and has received a lot of discussion — if you want to understand how it got to its current state, it’s worth reading that discussion.