From 3d69f64d0b4e677285eeec4d975d2d31e083f1ed Mon Sep 17 00:00:00 2001 From: Allan Renucci Date: Tue, 24 Apr 2018 17:42:42 +0200 Subject: [PATCH 1/6] Draft Dotty 0.8.0 blog post --- ...18-04-26-eighth-dotty-milestone-release.md | 180 ++++++++++++++++++ 1 file changed, 180 insertions(+) create mode 100644 docs/blog/_posts/2018-04-26-eighth-dotty-milestone-release.md diff --git a/docs/blog/_posts/2018-04-26-eighth-dotty-milestone-release.md b/docs/blog/_posts/2018-04-26-eighth-dotty-milestone-release.md new file mode 100644 index 000000000000..a724b80a5523 --- /dev/null +++ b/docs/blog/_posts/2018-04-26-eighth-dotty-milestone-release.md @@ -0,0 +1,180 @@ +--- +layout: blog-page +title: Announcing Dotty 0.7.0 and 0.8.0-RC1 +author: Allan Renucci +authorImg: /images/allan.jpg +date: 2018-04-26 +--- + +Today, we are excited to release Dotty versions 0.7.0 and 0.8.0-RC1. These releases +serve as a technology preview that demonstrates new language features and the compiler supporting them. + +If you’re not familiar with Dotty, it's a platform to try out new language concepts and compiler +technologies for Scala. The focus is mainly on simplification. We remove extraneous syntax +(e.g. no XML literals), and try to boil down Scala’s types into a smaller set of more fundamental +constructs. The theory behind these constructs is researched in +[DOT](https://infoscience.epfl.ch/record/215280), a calculus for dependent object types. +You can learn more about Dotty on our [website](https://dotty.epfl.ch). + + + +This is our eighth scheduled release according to our [6-week release schedule](https://dotty.epfl.ch/docs/usage/version-numbers.html). +The [previous technology preview](https://github.com/lampepfl/dotty/releases/tag/0.7.0-RC1) simplified +enums, introduced erased terms, improved IDE support and improved pattern matching for GADT. + +## What’s new in the 0.8.0-RC1 technology preview? + +### sbt 1 support [#3872](https://github.com/lampepfl/dotty/pull/3872) +Starting with Dotty 0.8.0, we will only support versions of sbt >= 1.1.4. Migrating to sbt 1 +lets us use the new improved incremental compiler for Scala called [Zinc](https://github.com/sbt/zinc), +and enables integration with tools such as [Bloop](https://scalacenter.github.io/bloop/). + +### Unchecked warnings [#4045](https://github.com/lampepfl/dotty/pull/4045) +Dotty now emits `unchecked` warnings like `scalac` whenever a type test is performed but cannot +safely be checked at runtime. For example: + +```scala +scala> def foo(x: Any) = x.isInstanceOf[List[String]] +1 |def foo(x: Any) = x.isInstanceOf[List[String]] + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | the type test for List[String] cannot be checked at runtime +``` + +In some cases, the Dotty compiler is smarter than `scalac` and will not emit a warning: +```scala +trait Marker + +def foo[T](x: T) = x match { + case _: T with Marker => // scalac emits a spurious warning + case _ => +} +``` + +### Kind Polymorphism [#4108](https://github.com/lampepfl/dotty/pull/4108) +Normally type parameters in Scala are partitioned into kinds. First-level types are types of values. +Higher-kinded types are type constructors such as `List` or `Map`. The kind of a type is indicated +by the top type of which it is a subtype. Normal types are subtypes of `Any`, covariant single +argument type constructors such as List are subtypes of `[+X] => Any`, and the `Map` type +constructor is a subtype of `[X, +Y] => Any`. + +Sometimes we would like to have type parameters that can have more than one kind, for instance to +define an implicit value that works for parameters of any kind. This is now possible through a form +of (subtype) kind polymorphism. Kind polymorphism relies on the special type `scala.AnyKind` that +can be used as an upper bound of a type. + +```scala +def f[T <: AnyKind] = .. +``` + +The actual type arguments of f can then be types of arbitrary kinds. So the following would all be +legal: + +```scala +f[Int] +f[List] +f[Map] +f[[X] => String] +``` + +**Note**: This feature is considered experimental and is only enabled under a compiler flag +(i.e. `-Ykind-polymorphism`). For more information, visit the [Kind Polymorphism](https://dotty.epfl.ch/docs/reference/kind-polymorphism.html) +section of our documentation. + +### Improved support for SAM type [#4152](https://github.com/lampepfl/dotty/pull/4152) +This release includes fixes to SAM types that greatly improve interoperability with Java 8 lambdas. +One can now easely write Scala code that uses Java streams: + +```scala +val myList = + java.util.Arrays.asList("a1", "a2", "b1", "c2", "c1") + +myList + .stream + .filter(s => s.startsWith("c")) + .map(_.toUpperCase) + .sorted + .forEach(println(_)) + +// C1 +// C2 +``` + +## Trying out Dotty +### Scastie +[Scastie], the online Scala playground, supports Dotty. +This is an easy way to try Dotty without installing anything. + +### sbt +Using sbt 1.1.4 or newer, do: + +```shell +sbt new lampepfl/dotty.g8 +``` + +This will setup a new sbt project with Dotty as compiler. For more details on +using Dotty with sbt, see the +[example project](https://github.com/lampepfl/dotty-example-project). + +### IDE support +It is very easy to 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) + +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.7.0..0.8.0-RC1` these are: + +``` +TODO +``` + +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 From 4cf90b5b3ca3da71ed61398a45e7b82a37922f80 Mon Sep 17 00:00:00 2001 From: Allan Renucci Date: Wed, 25 Apr 2018 19:36:12 +0200 Subject: [PATCH 2/6] Add contributions --- ...18-04-26-eighth-dotty-milestone-release.md | 20 ++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/docs/blog/_posts/2018-04-26-eighth-dotty-milestone-release.md b/docs/blog/_posts/2018-04-26-eighth-dotty-milestone-release.md index a724b80a5523..3276b49be80b 100644 --- a/docs/blog/_posts/2018-04-26-eighth-dotty-milestone-release.md +++ b/docs/blog/_posts/2018-04-26-eighth-dotty-milestone-release.md @@ -148,7 +148,25 @@ Thank you to all the contributors who made this release possible! According to `git shortlog -sn --no-merges 0.7.0..0.8.0-RC1` these are: ``` -TODO + 95 Martin Odersky + 91 liu fengyun + 91 Nicolas Stucki + 84 Allan Renucci + 73 Guillaume Martres + 67 Martin Duhem + 18 Jendrik Wenke + 16 Paolo G. Giarrusso + 8 Robert Stoll + 6 Thierry Treyer + 4 Aggelos Biboudis + 1 tokkiyaa + 1 Rajesh Veeranki + 1 Maxime Kjaer + 1 Saurabh Rawat + 1 Joan + 1 jvican + 1 Jasper Moeys + 1 Piotr Gabara ``` If you want to get your hands dirty and contribute to Dotty, now is a good time to get involved! From d2aadce3d9fa8d59587cb73257c8118f98fe919d Mon Sep 17 00:00:00 2001 From: Allan Renucci Date: Thu, 26 Apr 2018 15:50:42 +0200 Subject: [PATCH 3/6] Address review comments --- .../_posts/2018-04-26-eighth-dotty-milestone-release.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/docs/blog/_posts/2018-04-26-eighth-dotty-milestone-release.md b/docs/blog/_posts/2018-04-26-eighth-dotty-milestone-release.md index 3276b49be80b..fb07de9bd94f 100644 --- a/docs/blog/_posts/2018-04-26-eighth-dotty-milestone-release.md +++ b/docs/blog/_posts/2018-04-26-eighth-dotty-milestone-release.md @@ -29,6 +29,11 @@ Starting with Dotty 0.8.0, we will only support versions of sbt >= 1.1.4. Migrat lets us use the new improved incremental compiler for Scala called [Zinc](https://github.com/sbt/zinc), and enables integration with tools such as [Bloop](https://scalacenter.github.io/bloop/). +If you are already using Dotty with sbt 0.13, follow these simple steps to upgrade: +- update sbt version to 1.1.4 in `project/build.properties` +- update sbt-dotty plugin to the latest version: `addSbtPlugin("ch.epfl.lamp" % "sbt-dotty" % "0.2.2")` +- update usages of `.withDottyCompat()` by `.withDottyCompat(scalaVersion.value)` + ### Unchecked warnings [#4045](https://github.com/lampepfl/dotty/pull/4045) Dotty now emits `unchecked` warnings like `scalac` whenever a type test is performed but cannot safely be checked at runtime. For example: @@ -164,7 +169,7 @@ According to `git shortlog -sn --no-merges 0.7.0..0.8.0-RC1` these are: 1 Maxime Kjaer 1 Saurabh Rawat 1 Joan - 1 jvican + 1 Jorge Vicente Cantero 1 Jasper Moeys 1 Piotr Gabara ``` From 437ed16fe987335595f15475233ba501ac196a62 Mon Sep 17 00:00:00 2001 From: Allan Renucci Date: Fri, 20 Apr 2018 14:17:39 +0200 Subject: [PATCH 4/6] Update documentation for sbt 1 --- docs/_includes/getting-started.html | 2 +- docs/docs/usage/getting-started.md | 2 +- docs/docs/usage/sbt-projects.md | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/_includes/getting-started.html b/docs/_includes/getting-started.html index b78208b11821..4291768c4a40 100644 --- a/docs/_includes/getting-started.html +++ b/docs/_includes/getting-started.html @@ -15,7 +15,7 @@

Try Dotty

Or, you can try Dotty in your browser with Scastie.

Create a Dotty Project

-

The fastest way to create a new project in Dotty is using sbt (0.13.15+).

+

The fastest way to create a new project in Dotty is using sbt (1.1.4+).

Create a Dotty project:

sbt new lampepfl/dotty.g8
diff --git a/docs/docs/usage/getting-started.md b/docs/docs/usage/getting-started.md index 7906a5c797f2..44616ee52e82 100644 --- a/docs/docs/usage/getting-started.md +++ b/docs/docs/usage/getting-started.md @@ -12,7 +12,7 @@ title: Getting Started: Users This is an easy way to try Dotty without installing anything, directly in your browser. ### sbt -The fastest way to create a new project compiled by Dotty is using [sbt (0.13.13+)](http://www.scala-sbt.org/) +The fastest way to create a new project compiled by Dotty is using [sbt (1.1.4+)](http://www.scala-sbt.org/) Create a simple Dotty project: ```bash diff --git a/docs/docs/usage/sbt-projects.md b/docs/docs/usage/sbt-projects.md index 647cf238d212..37c47751c907 100644 --- a/docs/docs/usage/sbt-projects.md +++ b/docs/docs/usage/sbt-projects.md @@ -3,4 +3,4 @@ layout: doc-page title: "Using Dotty with sbt" --- -To try it in your project see the [Getting Started User Guide](http://dotty.epfl.ch/#getting-started). +To try it in your project see the [Getting Started User Guide](https://dotty.epfl.ch/docs/usage/getting-started.html). From ce519fd914acbe9983c03d74cdf608781384ad54 Mon Sep 17 00:00:00 2001 From: Allan Renucci Date: Fri, 27 Apr 2018 11:14:27 +0200 Subject: [PATCH 5/6] =?UTF-8?q?Dotty=20is=20Scala=203!=20=F0=9F=8E=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...2018-04-27-eighth-dotty-milestone-release.md} | 16 ++++++++++------ docs/docs/index.md | 16 ++++++++++------ 2 files changed, 20 insertions(+), 12 deletions(-) rename docs/blog/_posts/{2018-04-26-eighth-dotty-milestone-release.md => 2018-04-27-eighth-dotty-milestone-release.md} (91%) diff --git a/docs/blog/_posts/2018-04-26-eighth-dotty-milestone-release.md b/docs/blog/_posts/2018-04-27-eighth-dotty-milestone-release.md similarity index 91% rename from docs/blog/_posts/2018-04-26-eighth-dotty-milestone-release.md rename to docs/blog/_posts/2018-04-27-eighth-dotty-milestone-release.md index fb07de9bd94f..5b24e9c2ebf1 100644 --- a/docs/blog/_posts/2018-04-26-eighth-dotty-milestone-release.md +++ b/docs/blog/_posts/2018-04-27-eighth-dotty-milestone-release.md @@ -3,17 +3,21 @@ layout: blog-page title: Announcing Dotty 0.7.0 and 0.8.0-RC1 author: Allan Renucci authorImg: /images/allan.jpg -date: 2018-04-26 +date: 2018-04-27 --- Today, we are excited to release Dotty versions 0.7.0 and 0.8.0-RC1. These releases serve as a technology preview that demonstrates new language features and the compiler supporting them. -If you’re not familiar with Dotty, it's a platform to try out new language concepts and compiler -technologies for Scala. The focus is mainly on simplification. We remove extraneous syntax -(e.g. no XML literals), and try to boil down Scala’s types into a smaller set of more fundamental -constructs. The theory behind these constructs is researched in -[DOT](https://infoscience.epfl.ch/record/215280), a calculus for dependent object types. +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 realizing 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 behaviors, +- 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). diff --git a/docs/docs/index.md b/docs/docs/index.md index 53cfd5c66265..8b5e30e8bcaf 100644 --- a/docs/docs/index.md +++ b/docs/docs/index.md @@ -3,13 +3,17 @@ layout: doc-page title: "Dotty Documentation" --- -Dotty is a platform to try out new language concepts and compiler technologies for Scala. -The focus is mainly on simplification. We remove extraneous syntax (e.g. no XML literals), -and try to boil down Scala’s types into a smaller set of more fundamental constructs. -The theory behind these constructs is researched in DOT, a calculus for dependent object types. +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 realizing 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 behaviors, +- build on strong foundations to ensure the design hangs well together, +- consolidate language constructs to improve the language’s consistency, safety, ergonomics, and performance. -In this documentation you will find information on how to use the Dotty compiler on your machine, navigate through -the code, setup Dotty with your favorite IDE and more! +In this documentation you will find information on how to use the Dotty compiler on your machine, +navigate through the code, setup Dotty with your favorite IDE and more! Table of Contents ================= From d7775ee7b767fb693a6080bd5f5a8644de2b948a Mon Sep 17 00:00:00 2001 From: Allan Renucci Date: Fri, 27 Apr 2018 14:00:24 +0200 Subject: [PATCH 6/6] Address review comments --- .../2018-04-27-eighth-dotty-milestone-release.md | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/docs/blog/_posts/2018-04-27-eighth-dotty-milestone-release.md b/docs/blog/_posts/2018-04-27-eighth-dotty-milestone-release.md index 5b24e9c2ebf1..beceee0a8af0 100644 --- a/docs/blog/_posts/2018-04-27-eighth-dotty-milestone-release.md +++ b/docs/blog/_posts/2018-04-27-eighth-dotty-milestone-release.md @@ -36,11 +36,11 @@ and enables integration with tools such as [Bloop](https://scalacenter.github.io If you are already using Dotty with sbt 0.13, follow these simple steps to upgrade: - update sbt version to 1.1.4 in `project/build.properties` - update sbt-dotty plugin to the latest version: `addSbtPlugin("ch.epfl.lamp" % "sbt-dotty" % "0.2.2")` -- update usages of `.withDottyCompat()` by `.withDottyCompat(scalaVersion.value)` +- replace usages of `.withDottyCompat()` by `.withDottyCompat(scalaVersion.value)` ### Unchecked warnings [#4045](https://github.com/lampepfl/dotty/pull/4045) -Dotty now emits `unchecked` warnings like `scalac` whenever a type test is performed but cannot -safely be checked at runtime. For example: +Dotty now emits `unchecked` warnings like `scalac` whenever a type test is performed but cannot be +fully checked at runtime because of type erasure. For example: ```scala scala> def foo(x: Any) = x.isInstanceOf[List[String]] @@ -90,8 +90,9 @@ f[[X] => String] section of our documentation. ### Improved support for SAM type [#4152](https://github.com/lampepfl/dotty/pull/4152) -This release includes fixes to SAM types that greatly improve interoperability with Java 8 lambdas. -One can now easely write Scala code that uses Java streams: +This release includes fixes to [SAM types](https://www.scala-lang.org/news/2.12.0/#lambda-syntax-for-sam-types) +that greatly improve interoperability with Java 8 lambdas. One can now easily write Scala code that +uses Java streams: ```scala val myList = @@ -104,6 +105,7 @@ myList .sorted .forEach(println(_)) +// prints: // C1 // C2 ```