<commit_before>---
layout: blog-page
title: Announcing Dotty 0.18.1-RC1 – switch to the 2.13 standard library, indentation-based syntax and other experiments
author: <NAME>
authorImg: /images/anatolii.png
date: 2019-08-30
---

Greetings! With this post, we are proud to announce the 18th release of Dotty. With this release, we have switched to the 2.13 standard library (which is why the patch version of Dotty is now `1`)🎉. We are also conducting more experiments with the language syntax which will hopefully result in a better, cleaner way to write Scala programs.

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 being 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 together well,
- 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 18th scheduled release according to our
[6-week release schedule](https://dotty.epfl.ch/docs/contributing/release.html).

# What’s new in the 0.18.1-RC1 technology preview?
The hottest change of this release is a series of experiments with the language syntax. Some of them are controversial, some of them are almost unanimously considered useful. Regardless, the underlying motivation for all of them is something all of us want, we believe d: to make programming in Scala easier to write and read, drop unnecessary boilerplate, facilitate idiomatic programming.

We are thrilled to have this unique opportunity to experiment while Scala 3 is still in its inception and malleable. This is the only time we can try out significant language changes, and we are determined to make the most out of it.

Our view on these trials is that, like with any big change, we need time to see if these are good ideas. We don't know if they will work or not. We believe that the only way to find out is to play with them for some time.

Some of these changes will end up in Scala 3, some of them will be deemed not worth it. One way or another, trying the new look of an old language is an educational and fun experience.

Keeping that in mind, let us proceed to the nitty-gritty!

## Switch to Standard Library 2.13
Dotty is now using the standard library 2.13 instead of the previous 2.12.8. This fact is reflected in the patch version 1 in 0.18.1-RC1 which Dotty will be using from now on.

## `@main` functions
Bootstrapping a new Scala application is as hard as a new Java application. How do you write a main method? Normally, something like that:

```scala
object Test {
  def main(args: Array[String]): Unit = println(s"Hello World")
}
```

You need to define at least two things that serve no real purpose: an object and `(args: Array[String])`.

Not anymore! Meet the `@main` functions:


```scala
@main def test: Unit = println(s"Hello World")
```

The above generates the following code at the top-level of the compilation unit (source file):

```scala
final class test {
  <static> def main(args: Array[String]): Unit =
    try Main$package.test() catch<commit_msg>Remove misleading sentence about the patch version from the blog article<commit_after>---
layout: blog-page
title: Announcing Dotty 0.18.1-RC1 – switch to the 2.13 standard library, indentation-based syntax and other experiments
author: <NAME>
authorImg: /images/anatolii.png
date: 2019-08-30
---

Greetings! With this post, we are proud to announce the 18th release of Dotty. With this release, we have switched to the 2.13 standard library (which is why the patch version of Dotty is now `1`)🎉. We are also conducting more experiments with the language syntax which will hopefully result in a better, cleaner way to write Scala programs.

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 being 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 together well,
- 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 18th scheduled release according to our
[6-week release schedule](https://dotty.epfl.ch/docs/contributing/release.html).

# What’s new in the 0.18.1-RC1 technology preview?
The hottest change of this release is a series of experiments with the language syntax. Some of them are controversial, some of them are almost unanimously considered useful. Regardless, the underlying motivation for all of them is something all of us want, we believe d: to make programming in Scala easier to write and read, drop unnecessary boilerplate, facilitate idiomatic programming.

We are thrilled to have this unique opportunity to experiment while Scala 3 is still in its inception and malleable. This is the only time we can try out significant language changes, and we are determined to make the most out of it.

Our view on these trials is that, like with any big change, we need time to see if these are good ideas. We don't know if they will work or not. We believe that the only way to find out is to play with them for some time.

Some of these changes will end up in Scala 3, some of them will be deemed not worth it. One way or another, trying the new look of an old language is an educational and fun experience.

Keeping that in mind, let us proceed to the nitty-gritty!

## Switch to Standard Library 2.13
Dotty is now using the standard library 2.13 instead of the previous 2.12.8.

## `@main` functions
Bootstrapping a new Scala application is as hard as a new Java application. How do you write a main method? Normally, something like that:

```scala
object Test {
  def main(args: Array[String]): Unit = println(s"Hello World")
}
```

You need to define at least two things that serve no real purpose: an object and `(args: Array[String])`.

Not anymore! Meet the `@main` functions:


```scala
@main def test: Unit = println(s"Hello World")
```

The above generates the following code at the top-level of the compilation unit (source file):

```scala
final class test {
  <static> def main(args: Array[String]): Unit =
    try Main$package.test() catch
{'fraction_non_alphanumeric': 0.05839620005588153, 'fraction_numerical': 0.0131321598211791, 'mean_word_length': 4.334575260804769, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4041754', 'n_tokens_mistral': 1926, 'n_tokens_neox': 1788, 'n_words': 1094}