Skip to content

Commit 0e21941

Browse files
committed
Add compiler plugin section
1 parent 040bdc6 commit 0e21941

File tree

1 file changed

+23
-5
lines changed

1 file changed

+23
-5
lines changed

docs/blog/_posts/2018-07-06-ninth-dotty-milestone-release.md

Lines changed: 23 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,13 @@ support for sbt 1, introduced improved unchecked warnings and improved SAM type
3333
The REPL now uses [JLine 3](https://github.com/jline/jline3) under the hood which improves on
3434
many aspects such as auto-completions and multi-line editing. The REPL now also works on Windows!
3535

36+
3637
### Documentation support in the IDE [#4461](https://github.com/lampepfl/dotty/pull/4461), [#4648](https://github.com/lampepfl/dotty/pull/4648)
3738
The Dotty IDE will now display documentation on code hover for symbols that were previously
3839
compiled by the Dotty compiler. In the future, we plan to let users query the documentation
3940
in the REPL as well.
4041

42+
4143
### Drop requirement that implicit functions must be non-empty [#4549](https://github.com/lampepfl/dotty/pull/4549)
4244
We decided to remove an arbitrary restriction that implicit and functions must be non-empty.
4345
We can now write:
@@ -50,8 +52,8 @@ val prod2: IntProducer = 2
5052

5153
An interesting observation is that by-name parameters can now be encoded as implicit function types:
5254
```scala
53-
def timed[T](op: => T) = ...
54-
def timed[T](op: implicit () => T) = ...
55+
def timed[T](op: => T): T = ...
56+
def timed[T](op: implicit () => T): T = ...
5557

5658
timed {
5759
fetch(url)
@@ -60,6 +62,7 @@ timed {
6062

6163
Both definitions above are equivalent.
6264

65+
6366
### Emit feature warnings for implicit conversions [#4229](https://github.com/lampepfl/dotty/pull/4229)
6467
Implicit conversions are easily the most misused feature in Scala. We now emit feature warnings
6568
when encountering an implicit conversion definition, just like Scala 2 does.
@@ -69,22 +72,37 @@ unless the conversion is an implicit class, or otherwise co-defined with the typ
6972
to which it converts, or the conversion is predefined in `scala.Predef` or is the
7073
`scala.reflect.Selectable.reflectiveSelect` conversion (we might extend this to more conversions).
7174

72-
### Optimise s and raw interpolators [#3961](https://github.com/lampepfl/dotty/pull/4229)
75+
76+
### Optimise s and raw interpolators [#3961](https://github.com/lampepfl/dotty/pull/3961)
7377
`s` and `raw` string interpolators were known to be slower than their not type-safe counterparts:
7478
```scala
7579
s"Hello $name!"
7680

77-
// versus
81+
// compared to:
7882
"Hello " + name + "!"
7983
```
8084
The compiler will now desugar the former into the later. Special thanks to
8185
[Wojtek Swiderski](https://github.com/Wojtechnology) who contributed this feature to the Dotty
8286
compiler!
8387

88+
89+
### Support for compiler plugins [#3438](https://github.com/lampepfl/dotty/pull/#3438)
90+
Dotty now supports Compiler plugins. Compiler plugins let you customise the compiler pipeline
91+
without having to modify the compiler source code. A major difference compared to Scala 2 is
92+
that Dotty plugins must run after the type checker. Being able to influence normal type checking
93+
is a very powerful feature but for production usages, a predictable and consistent type checker
94+
is more important.
95+
96+
Starting with 1.1.5 Dotty compiler plugins can be used with `sbt`. Please refer to the `sbt`
97+
[documentation](https://www.scala-sbt.org/1.x/docs/Compiler-Plugins.html) for more information.
98+
99+
For more information, visit the [Compiler Plugin](http://dotty.epfl.ch/docs/reference/changed/compiler-plugins.html)
100+
section of our documentation.
101+
84102
## Trying out Dotty
85103

86104
### sbt
87-
Using sbt 1.1.4 or newer, do:
105+
Using sbt 1.1.5 or newer, do:
88106

89107
```shell
90108
sbt new lampepfl/dotty.g8

0 commit comments

Comments
 (0)