Skip to content

Commit 7bb287c

Browse files
committed
Blog Post: Announcing Dotty 0.6.0 and 0.7.0-RC1
1 parent 70cdda2 commit 7bb287c

File tree

1 file changed

+157
-0
lines changed

1 file changed

+157
-0
lines changed
Lines changed: 157 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,157 @@
1+
---
2+
layout: blog-page
3+
title: Announcing Dotty 0.6.0 and 0.7.0-RC1
4+
author: Allan Renucci
5+
authorImg: /images/allan.jpg
6+
date: 2018-03-05
7+
---
8+
9+
Today, we are excited to release Dotty versions 0.6.0 and 0.7.0-RC1. These releases
10+
serve as a technology preview that demonstrates new language features and the compiler supporting them.
11+
12+
If you’re not familiar with Dotty, it's a platform to try out new language concepts and compiler
13+
technologies for Scala. The focus is mainly on simplification. We remove extraneous syntax
14+
(e.g. no XML literals), and try to boil down Scala’s types into a smaller set of more fundamental
15+
constructs. The theory behind these constructs is researched in
16+
[DOT](https://infoscience.epfl.ch/record/215280), a calculus for dependent object types.
17+
You can learn more about Dotty on our [website](http://dotty.epfl.ch).
18+
19+
<!--more-->
20+
21+
This is our seventh scheduled release according to our [6-week release schedule](/docs/usage/version-numbers.html).
22+
The [previous technology preview](https://github.com/lampepfl/dotty/releases/tag/0.6.0-RC1) focussed
23+
on bug fixes and stability work.
24+
25+
## What’s new in the 0.7.0-RC1 technology preview?
26+
27+
### Enums Simplicification [#4003](https://github.com/lampepfl/dotty/pull/4003)
28+
The previously introduced syntax and rules for enum were arguably too complex. We can considerably
29+
simplify them by taking away one capability: that cases can have bodies which can define members.
30+
Arguably, if we choose an ADT decomposition of a problem, it's good style to write all methods using
31+
pattern matching instead of overriding individual cases. So this removes an unnecessary choice.
32+
We now treat enums unequivocally as classes. They can have methods and other statements just like
33+
other classes can. Cases in enums are seen as a form of constructors. We do not need a
34+
distinction between enum class and enum object anymore. Enums can have companion objects just like
35+
normal classes can, of course.
36+
37+
Let's consider how `Option` can be represented as an enum. Previously using an enum class:
38+
```scala
39+
enum class Option[+T] {
40+
def isDefined: Boolean
41+
}
42+
object Option {
43+
case Some[+T](x: T) {
44+
def isDefined = true
45+
}
46+
case None {
47+
def isDefined = false
48+
}
49+
50+
def apply[T(x: T): Option[T] = if (x == null) None else Some(x)
51+
}
52+
```
53+
54+
And now:
55+
```scala
56+
enum Option[+T] {
57+
case Some(x: T)
58+
case None
59+
60+
def isDefined: Boolean = this match {
61+
case None => false
62+
case some => true
63+
}
64+
}
65+
66+
object Option {
67+
def apply[T](x: T): Option[T] = if (x == null) None else Some(x)
68+
}
69+
```
70+
71+
You can visit our website for more information about [enumerations](/docs/reference/enums/enums.html)
72+
and how we can use them to model [Algebraic Data Types](/docs/reference/enums/adts.html).
73+
74+
### Unused Parameters [#3342](https://github.com/lampepfl/dotty/pull/3342)
75+
TODO
76+
77+
## Trying out Dotty
78+
### Scastie
79+
[Scastie], the online Scala playground, supports Dotty.
80+
This is an easy way to try Dotty without installing anything.
81+
82+
### sbt
83+
Using sbt 0.13.13 or newer, do:
84+
85+
```shell
86+
sbt new lampepfl/dotty.g8
87+
```
88+
89+
This will setup a new sbt project with Dotty as compiler. For more details on
90+
using Dotty with sbt, see the
91+
[example project](https://github.com/lampepfl/dotty-example-project).
92+
93+
### IDE support
94+
It is very easy to start using the Dotty IDE in any Dotty project by following
95+
the [IDE guide](http://dotty.epfl.ch/docs/usage/ide-support.html).
96+
97+
98+
### Standalone installation
99+
Releases are available for download on the _Releases_
100+
section of the Dotty repository:
101+
[https://github.com/lampepfl/dotty/releases](https://github.com/lampepfl/dotty/releases)
102+
103+
We also provide a [homebrew](https://brew.sh/) package that can be installed by running:
104+
105+
```shell
106+
brew install lampepfl/brew/dotty
107+
```
108+
109+
In case you have already installed Dotty via brew, you should instead update it:
110+
111+
```shell
112+
brew upgrade dotty
113+
```
114+
115+
## Let us know what you think!
116+
If you have questions or any sort of feedback, feel free to send us a message on our
117+
[Gitter channel](https://gitter.im/lampepfl/dotty). If you encounter a bug, please
118+
[open an issue on GitHub](https://github.com/lampepfl/dotty/issues/new).
119+
120+
## Contributing
121+
Thank you to all the contributors who made this release possible!
122+
123+
According to `git shortlog -sn --no-merges 0.6.0-RC1..0.7.0-RC1` these are:
124+
125+
```
126+
TODO
127+
```
128+
129+
If you want to get your hands dirty and contribute to Dotty, now is a good time to get involved!
130+
Head to our [Getting Started page for new contributors](http://dotty.epfl.ch/docs/contributing/getting-started.html),
131+
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).
132+
They make perfect entry-points into hacking on the compiler.
133+
134+
We are looking forward to having you join the team of contributors.
135+
136+
## Library authors: Join our community build
137+
Dotty now has a set of widely-used community libraries that are built against every nightly Dotty
138+
snapshot. Currently this includes ScalaPB, algebra, scalatest, scopt and squants.
139+
Join our [community build](https://github.com/lampepfl/dotty-community-build)
140+
to make sure that our regression suite includes your library.
141+
142+
143+
[Scastie]: https://scastie.scala-lang.org/?target=dotty
144+
145+
[@odersky]: https://github.com/odersky
146+
[@DarkDimius]: https://github.com/DarkDimius
147+
[@smarter]: https://github.com/smarter
148+
[@felixmulder]: https://github.com/felixmulder
149+
[@nicolasstucki]: https://github.com/nicolasstucki
150+
[@liufengyun]: https://github.com/liufengyun
151+
[@OlivierBlanvillain]: https://github.com/OlivierBlanvillain
152+
[@biboudis]: https://github.com/biboudis
153+
[@allanrenucci]: https://github.com/allanrenucci
154+
[@Blaisorblade]: https://github.com/Blaisorblade
155+
[@Blaisorblade]: https://github.com/Blaisorblade
156+
[@Duhemm]: https://github.com/duhemm
157+

0 commit comments

Comments
 (0)