Skip to content

Commit 6c04f8d

Browse files
committed
Dotty 0.10.0-RC1 blog post
1 parent 85f109f commit 6c04f8d

File tree

1 file changed

+248
-0
lines changed

1 file changed

+248
-0
lines changed
Lines changed: 248 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,248 @@
1+
---
2+
layout: blog-page
3+
title: Announcing Dotty 0.10.0-RC1
4+
author: Allan Renucci
5+
authorImg: /images/allan.jpg
6+
date: 2018-10-10
7+
---
8+
9+
After a long summer break, we are excited to release Dotty version 0.10.0-RC1.
10+
This release serves as a technology preview that demonstrates new language features and the
11+
compiler supporting them.
12+
13+
Dotty is the project name for technologies that are considered for inclusion in Scala 3. Scala has
14+
pioneered the fusion of object-oriented and functional programming in a typed setting. Scala 3 will
15+
be a big step towards realising the full potential of these ideas. Its main objectives are to
16+
17+
- become more opinionated by promoting programming idioms we found to work well,
18+
- simplify where possible,
19+
- eliminate inconsistencies and surprising behaviours,
20+
- build on strong foundations to ensure the design hangs well together,
21+
- consolidate language constructs to improve the language’s consistency, safety, ergonomics, and
22+
performance.
23+
24+
You can learn more about Dotty on our [website](https://dotty.epfl.ch).
25+
26+
<!--more-->
27+
28+
This is our 10th scheduled release according to our
29+
[6-week release schedule](https://dotty.epfl.ch/docs/usage/version-numbers.html).
30+
31+
## What’s new in the 0.10.0-RC1 technology preview?
32+
33+
### Java 9+
34+
35+
Dotty now supports the latest versions of Java inlcuding Java 11!
36+
37+
### Type-level programming: Match Types
38+
39+
We've introduced a new form of types called match types. A match types is a mechanism for checking a
40+
type against a pattern. A match type reduces to one of a number of right hand sides, depending on a
41+
scrutinee type. E.g:
42+
43+
```scala
44+
type Elem[X] = X match {
45+
case String => Char
46+
case Array[t] => t
47+
case Iterable[t] => t
48+
}
49+
```
50+
51+
This defines a type that, depending on the scrutinee type `X`, can reduce to one of its right hand
52+
sides. For instance,
53+
54+
```scala
55+
Elem[String] =:= Char
56+
Elem[Array[Int]] =:= Int
57+
Elem[List[Float]] =:= Float
58+
Elem[Nil] =:= Nothing
59+
```
60+
61+
Here `=:=` is understood to mean that left and right hand sides are mutually subtypes of each other.
62+
63+
This feature is still experimental and subject to changes. For more information, visit the
64+
[Match Types](http://dotty.epfl.ch/docs/reference/match-types.html) section of our documentation.
65+
66+
### Documentation in the REPL
67+
68+
The previous release added documentation support for the IDE. Users can now query the documentation
69+
of sources previously compiled with Dotty within the REPL:
70+
71+
```scala
72+
scala> /** An object */ object O { /** A def */ def foo = 0 }
73+
// defined object O
74+
75+
scala> :doc O
76+
/** An object */
77+
78+
scala> :doc O.foo
79+
/** A def */
80+
```
81+
82+
### Tail-recursive methods can now be polymorphic
83+
84+
Previously, a tail recursive call would be optimised only if the type arguments of the method
85+
or the enclosing class did not change at call site. E.g.
86+
87+
```scala
88+
@tailrec def loop[T](x: T): Int = {
89+
...
90+
loop[Int](1)
91+
}
92+
```
93+
94+
```shell
95+
loop[Int](1)
96+
^^^^^^^^^^^^
97+
Cannot rewrite recursive call: it changes type arguments on a polymorphic recursive call
98+
```
99+
100+
This restriction has now been removed. We also improve upon `scalac` which is not able to optimise
101+
methods that change the type of `this` on a polymorphic recursive call.
102+
[Examples](https://github.com/lampepfl/dotty/blob/7a45a4a386d33180e5b7b21aa74271a77cce4707/tests/neg-tailcall/tailrec.scala#L43-L44)
103+
can be found in our test suite.
104+
105+
### Experimental support for generic Tuples
106+
107+
We augmented the `Tuple` class with generic methods such as `head`, `tail`, `apply`, `*:` and `++`.
108+
109+
```scala
110+
scala> val t0 = (1, "2", 3L)
111+
val t0: (Int, String, Long) = (1,2,3)
112+
113+
scala> val head = t0.head
114+
val head: Int = 1
115+
116+
scala> val tail = t0.tail
117+
val tail: (String, Long) = (2,3)
118+
119+
scala> val t1 = 0.0 *: t0
120+
val t1: (Double, Int, String, Long) = (0.0,1,2,3)
121+
122+
scala> val t2 = t0 ++ t0
123+
val t2: (Int, String, Long, Int, String, Long) = (1,2,3,1,2,3)
124+
```
125+
126+
### And much more!
127+
128+
Please read our [release notes](https://github.com/lampepfl/dotty/releases/tag/0.10.0-RC1)
129+
for more details!
130+
131+
## Breaking changes
132+
133+
Dotty 0.10.0-RC1 requires sbt 1.2.3 and sbt-dotty 0.2.4.
134+
135+
## Trying out Dotty
136+
137+
### sbt
138+
139+
Using sbt 1.1.5 or newer, do:
140+
141+
```shell
142+
sbt new lampepfl/dotty.g8
143+
```
144+
145+
This will setup a new sbt project with Dotty as the compiler. For more details on
146+
using Dotty with sbt, see the
147+
[example project](https://github.com/lampepfl/dotty-example-project).
148+
149+
### [Mill](http://www.lihaoyi.com/mill/)
150+
151+
Mill version 0.2.6 introduced experimental support for Dotty. For more details on using Dotty with
152+
Mill, see the [example project](https://github.com/lampepfl/dotty-example-project/tree/mill).
153+
154+
### IDE support
155+
156+
Start using the Dotty IDE in any Dotty project by following
157+
the [IDE guide](https://dotty.epfl.ch/docs/usage/ide-support.html).
158+
159+
### Standalone installation
160+
161+
Releases are available for download on the _Releases_
162+
section of the Dotty repository:
163+
[https://github.com/lampepfl/dotty/releases](https://github.com/lampepfl/dotty/releases)
164+
165+
We also provide a [homebrew](https://brew.sh/) package that can be installed by running:
166+
167+
```shell
168+
brew install lampepfl/brew/dotty
169+
```
170+
171+
In case you have already installed Dotty via `brew`, you should instead update it:
172+
173+
```shell
174+
brew upgrade dotty
175+
```
176+
177+
## Let us know what you think!
178+
179+
If you have questions or any sort of feedback, feel free to send us a message on our
180+
[Gitter channel](https://gitter.im/lampepfl/dotty). If you encounter a bug, please
181+
[open an issue on GitHub](https://github.com/lampepfl/dotty/issues/new).
182+
183+
## Contributing
184+
185+
Thank you to all the contributors who made this release possible!
186+
187+
According to `git shortlog -sn --no-merges 0.9.0..0.10.0-RC1` these are:
188+
189+
```
190+
219 Martin Odersky
191+
142 Nicolas Stucki
192+
67 Paolo G. Giarrusso
193+
52 Allan Renucci
194+
48 Guillaume Martres
195+
39 Martin Duhem
196+
23 Liu Fengyun
197+
15 Olivier Blanvillain
198+
10 Dmytro Melnychenko
199+
10 Abel Nieto
200+
10 Sébastien Doeraene
201+
7 Jaemin Hong
202+
7 Eugene Melekhov
203+
5 Saloni Vithalani
204+
3 Daniel Li
205+
3 Dale Wijnand
206+
3 Jasper Moeys
207+
2 lloydmeta
208+
2 Aggelos Biboudis
209+
2 Greg Pevnev
210+
1 Adriaan Moors
211+
1 Lukas Rytz
212+
1 Kazuhiro Sera
213+
1 Justin du Coeur, AKA Mark Waks
214+
1 Jan Rock
215+
1 Fengyun Liu
216+
1 Szymon Pajzert
217+
1 Chris Birchall
218+
1 benkobalog
219+
1 Martijn Hoekstra
220+
```
221+
222+
If you want to get your hands dirty and contribute to Dotty, now is a good time to get involved!
223+
Head to our [Getting Started page for new contributors](https://dotty.epfl.ch/docs/contributing/getting-started.html),
224+
and have a look at some of the [good first issues](https://github.com/lampepfl/dotty/issues?q=is%3Aissue+is%3Aopen+label%3Aexp%3Anovice).
225+
They make perfect entry-points into hacking on the compiler.
226+
227+
We are looking forward to having you join the team of contributors.
228+
229+
## Library authors: Join our community build
230+
231+
Dotty now has a set of widely-used community libraries that are built against every nightly Dotty
232+
snapshot. Currently this includes ScalaPB, algebra, scalatest, scopt and squants.
233+
Join our [community build](https://github.com/lampepfl/dotty-community-build)
234+
to make sure that our regression suite includes your library.
235+
236+
[Scastie]: https://scastie.scala-lang.org/?target=dotty
237+
238+
[@odersky]: https://github.com/odersky
239+
[@DarkDimius]: https://github.com/DarkDimius
240+
[@smarter]: https://github.com/smarter
241+
[@felixmulder]: https://github.com/felixmulder
242+
[@nicolasstucki]: https://github.com/nicolasstucki
243+
[@liufengyun]: https://github.com/liufengyun
244+
[@OlivierBlanvillain]: https://github.com/OlivierBlanvillain
245+
[@biboudis]: https://github.com/biboudis
246+
[@allanrenucci]: https://github.com/allanrenucci
247+
[@Blaisorblade]: https://github.com/Blaisorblade
248+
[@Duhemm]: https://github.com/Duhemm

0 commit comments

Comments
 (0)