Skip to content

Commit dfcee12

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

File tree

1 file changed

+154
-0
lines changed

1 file changed

+154
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,154 @@
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+
## Trying out Dotty
75+
### Scastie
76+
[Scastie], the online Scala playground, supports Dotty.
77+
This is an easy way to try Dotty without installing anything.
78+
79+
### sbt
80+
Using sbt 0.13.13 or newer, do:
81+
82+
```shell
83+
sbt new lampepfl/dotty.g8
84+
```
85+
86+
This will setup a new sbt project with Dotty as compiler. For more details on
87+
using Dotty with sbt, see the
88+
[example project](https://github.com/lampepfl/dotty-example-project).
89+
90+
### IDE support
91+
It is very easy to start using the Dotty IDE in any Dotty project by following
92+
the [IDE guide](http://dotty.epfl.ch/docs/usage/ide-support.html).
93+
94+
95+
### Standalone installation
96+
Releases are available for download on the _Releases_
97+
section of the Dotty repository:
98+
[https://github.com/lampepfl/dotty/releases](https://github.com/lampepfl/dotty/releases)
99+
100+
We also provide a [homebrew](https://brew.sh/) package that can be installed by running:
101+
102+
```shell
103+
brew install lampepfl/brew/dotty
104+
```
105+
106+
In case you have already installed Dotty via brew, you should instead update it:
107+
108+
```shell
109+
brew upgrade dotty
110+
```
111+
112+
## Let us know what you think!
113+
If you have questions or any sort of feedback, feel free to send us a message on our
114+
[Gitter channel](https://gitter.im/lampepfl/dotty). If you encounter a bug, please
115+
[open an issue on GitHub](https://github.com/lampepfl/dotty/issues/new).
116+
117+
## Contributing
118+
Thank you to all the contributors who made this release possible!
119+
120+
According to `git shortlog -sn --no-merges 0.6.0-RC1..0.7.0-RC1` these are:
121+
122+
```
123+
TODO
124+
```
125+
126+
If you want to get your hands dirty and contribute to Dotty, now is a good time to get involved!
127+
Head to our [Getting Started page for new contributors](http://dotty.epfl.ch/docs/contributing/getting-started.html),
128+
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).
129+
They make perfect entry-points into hacking on the compiler.
130+
131+
We are looking forward to having you join the team of contributors.
132+
133+
## Library authors: Join our community build
134+
Dotty now has a set of widely-used community libraries that are built against every nightly Dotty
135+
snapshot. Currently this includes ScalaPB, algebra, scalatest, scopt and squants.
136+
Join our [community build](https://github.com/lampepfl/dotty-community-build)
137+
to make sure that our regression suite includes your library.
138+
139+
140+
[Scastie]: https://scastie.scala-lang.org/?target=dotty
141+
142+
[@odersky]: https://github.com/odersky
143+
[@DarkDimius]: https://github.com/DarkDimius
144+
[@smarter]: https://github.com/smarter
145+
[@felixmulder]: https://github.com/felixmulder
146+
[@nicolasstucki]: https://github.com/nicolasstucki
147+
[@liufengyun]: https://github.com/liufengyun
148+
[@OlivierBlanvillain]: https://github.com/OlivierBlanvillain
149+
[@biboudis]: https://github.com/biboudis
150+
[@allanrenucci]: https://github.com/allanrenucci
151+
[@Blaisorblade]: https://github.com/Blaisorblade
152+
[@Blaisorblade]: https://github.com/Blaisorblade
153+
[@Duhemm]: https://github.com/duhemm
154+

0 commit comments

Comments
 (0)