Skip to content

Add blogpost for 0.12.0-RC1 and 0.11.0 #5737

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 21, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
199 changes: 199 additions & 0 deletions docs/blog/_posts/2019-01-17-12th-dotty-milestone-release.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,199 @@
---
layout: blog-page
title: Announcing Dotty 0.12.0-RC1
author: Aggelos Biboudis
authorImg: /images/aggelos.jpg
date: 2019-01-21
---

Happy New Year to all with the first release of Dotty for 2019! ✨🎊🎉

Today we are excited to release the version 0.12.0-RC1 of the Dotty compiler.
This release serves as a technology preview that demonstrates new language features and the
compiler supporting them.

Dotty is the project name for technologies that are considered for inclusion in Scala 3. Scala has
pioneered the fusion of object-oriented and functional programming in a typed setting. Scala 3 will
be a big step towards realising the full potential of these ideas. Its main objectives are to

- become more opinionated by promoting programming idioms we found to work well,
- simplify where possible,
- eliminate inconsistencies and surprising behaviours,
- build on strong foundations to ensure the design hangs well together,
- consolidate language constructs to improve the language’s consistency, safety, ergonomics, and
performance.

You can learn more about Dotty on our [website](https://dotty.epfl.ch).

<!--more-->

This is our 12th scheduled release according to our
[6-week release schedule](https://dotty.epfl.ch/docs/usage/version-numbers.html).

## What’s new in the 0.12.0-RC1 technology preview?

### Extension Methods

We are excited to announce that extension methods are now offered through dedicated language support!
Extension methods allow one to add methods to a type after the type is defined and up until now they were encoded through the powerful mechanism of implicits.
Previously, one had to place the desired method in the trait with the receiver object to extend, as part of the parameter list.
The infix-ness of the method was being restored by manually writing the implicit class, resolving `implicitly` that extended object.

Now, in Dotty we can express an extension method by writing the method and prepending its name with the type to be extended.

```scala
case class Circle(x: Double, y: Double, radius: Double)

def (c: Circle) circumference: Double = c.radius * math.Pi * 2
```

Read the [relevant documentation](https://dotty.epfl.ch/docs/reference/other-new-features/extension-methods.html) about generic extension methods, higher-kinded extension methods and more.

### TASTy Reflect goodies

We implement a new decompiler for TASTy files and we also offer a new VS Code Extension.
The decompiler allows to view both decompiled scala source code and the pretty printed TASTy tree when opening a .tasty file.
The feature is similar to opening .class files in IntelliJ.

![]({{ site.baseurl }}/images/dotty-ide/decompiler.png "Decompiler")

The decompiler can be invoked with the corresponding flag: `dotc -decompile xyz.tasty`.

On the programmatic side of TASTy we are rolling out changes according to our plan discussed at [Macros: The Plan for Scala 3](https://www.scala-lang.org/blog/2018/04/30/in-a-nutshell.html).
In this release, we make progress following the _Next Steps_ of the aforementioned blogpost by offering constructors that work directly with reflect trees.
Consequently, TASTy extractors meet their dual, TASTy constructors!
We also connect the new lower-level reflection layer to the existing principled macro system based on quotes and splices offering, two new expression methods for `Expr[T]`:

- `unseal` that unseals an `Expr[T]` (non traversable code) into a `Term` and
- `seal` that seals back a `Term` into an `Expr[T]`.

Read the [relevant documentation](https://dotty.epfl.ch/docs/reference/other-new-features/tasty-reflect.html) to learn how to go from quotes and splices to TASTys Reflect trees and back .

### Alignments with the Scala Improvement Process

In this version we improve the implementation of by-name implicits making it compliant with the [By-name Implicits](https://docs.scala-lang.org/sips/byname-implicits.html) SIP and we implement the `ValueOf` operator which yields the unique value of types with a single inhabitant, effectively syncing it up with the [Literal-Based Singleton Types](https://docs.scala-lang.org/sips/42.type.html) SIP.

### Improvements to GADT support

In this release, we're also rolling out the first batch of improvements to GADT support - namely, variable unification.
To keep it short, from knowing that `A <: B` and `B <: A`, we can now deduce that `A = B`, and from `A = B` and `B <: C` we deduce that `A <: C`.
This kind of reasoning is necessary for many advanced GADT usages!

### And much more!

Please read our [release notes](https://github.com/lampepfl/dotty/releases/tag/0.12.0-RC1)
for more details!

## Trying out Dotty

### sbt

You can set up a new sbt project with Dotty as the compiler by running:

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

For more details on using Dotty with sbt, see the
[example project](https://github.com/lampepfl/dotty-example-project).

### [Mill](http://www.lihaoyi.com/mill/)

The Mill build tool version 0.2.6 introduced experimental support for Dotty. For more details on
using Dotty with Mill, see the
[example project](https://github.com/lampepfl/dotty-example-project/tree/mill).

### IDE support

Start using the Dotty IDE in any Dotty project by following
the [IDE guide](https://dotty.epfl.ch/docs/usage/ide-support.html).

### Standalone installation

Releases are available for download on the _Releases_
section of the Dotty repository:
[https://github.com/lampepfl/dotty/releases](https://github.com/lampepfl/dotty/releases)

For MacOs users, we also provide a [homebrew](https://brew.sh/) package that can be installed by
running:

```shell
brew install lampepfl/brew/dotty
```

In case you have already installed Dotty via `brew`, you should instead update it:

```shell
brew upgrade dotty
```

## Let us know what you think!

If you have questions or any sort of feedback, feel free to send us a message on our
[Gitter channel](https://gitter.im/lampepfl/dotty). If you encounter a bug, please
[open an issue on GitHub](https://github.com/lampepfl/dotty/issues/new).

## Contributing

Thank you to all the contributors who made this release possible!

According to `git shortlog -sn --no-merges 0.11.0-RC1..0.12.0-RC1` these are:

```
109 Martin Odersky
64 Nicolas Stucki
34 Martin Duhem
25 Allan Renucci
16 Guillaume Martres
12 Aleksander Boruch-Gruszecki
11 Tobias Bordenca
10 Miles Sabin
10 Liu Fengyun
7 Aggelos Biboudis
7 Jaemin Hong
5 Paolo G. Giarrusso
3 duanebester
3 Dotty CI
2 Sébastien Doeraene
2 Saurabh Rawat
2 Vlastimil Dort
1 tOverney
1 Denis Buzdalov
1 Hermes Espínola González
1 Ivan Youroff
1 João Pedro de Carvalho
1 Neeraj Jaiswal
1 Olivier Blanvillain
1 poechsel
1 Abel Nieto
```

If you want to get your hands dirty and contribute to Dotty, now is a good time to get involved!
Head to our [Getting Started page for new contributors](https://dotty.epfl.ch/docs/contributing/getting-started.html),
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).
They make perfect entry points into hacking on the compiler.

We are looking forward to having you join the team of contributors.

## Library authors: Join our community build

Dotty now has a set of widely-used community libraries that are built against every nightly Dotty
snapshot. Currently this includes ScalaPB, algebra, scalatest, scopt and squants.
Join our [community build](https://github.com/lampepfl/dotty-community-build)
to make sure that our regression suite includes your library.

[Scastie]: https://scastie.scala-lang.org/?target=dotty

[@odersky]: https://github.com/odersky
[@DarkDimius]: https://github.com/DarkDimius
[@smarter]: https://github.com/smarter
[@felixmulder]: https://github.com/felixmulder
[@nicolasstucki]: https://github.com/nicolasstucki
[@liufengyun]: https://github.com/liufengyun
[@OlivierBlanvillain]: https://github.com/OlivierBlanvillain
[@biboudis]: https://github.com/biboudis
[@allanrenucci]: https://github.com/allanrenucci
[@Blaisorblade]: https://github.com/Blaisorblade
[@Duhemm]: https://github.com/Duhemm
[@AleksanderBG]: https://github.com/AleksanderBG
[@milessabin]: https://github.com/milessabin
Binary file added docs/images/dotty-ide/decompiler.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.