Skip to content

make Scalafix blog post not so entirely Dotty-centric #513

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
Nov 8, 2016
Merged
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
53 changes: 38 additions & 15 deletions blog/_posts/2016-10-24-scalafix.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,21 @@
layout: blog
post-type: blog
by: Ólafur Páll Geirsson
title: "Introducing Scalafix: a migration tool for Scalac to Dotty"
title: "Introducing Scalafix: a code migration tool for Scala"
---

I am excited to announce the first release of
[scalafix](http://scalacenter.github.io/scalafix/), a new tool to
prepare Scala 2.x code for [Dotty](http://dotty.epfl.ch/), a next
generation Scala compiler. This effort follows the Scala Center Advisory
prepare Scala code for future Scala versions, including Scala 2.13
and beyond as well as [Dotty](http://dotty.epfl.ch/), a next
generation Scala compiler.

This effort follows the Scala Center Advisory
Board proposal:
["Clarification of Scala to Dotty migration path"](https://scala.epfl.ch/minutes/2016/06/06/may-9-2016.html#proposal-scp-002-clarification-of-scala-to-dotty-migration-path).

There is a lot to be excited over in Dotty,
[faster compilation times](http://www.slideshare.net/Odersky/scala-days-nyc-2016),
[faster+smaller binaries](https://d-d.me/talks/scaladays2015/#/) and
[awesome error messages](http://www.scala-lang.org/blog/2016/10/14/dotty-errors.html)
to name a few things. However, some Scala 2.x applications can't
immediately enjoy these benefits due to several breaking changes in
Dotty. Scalafix is part of our strategy to smoothen the migration
process for those applications.
What can scalafix do?
-------------------------

Scalafix takes care of easy, repetitive and tedious code transformations
so you can focus on the changes that truly deserve your attention. In a
Expand All @@ -30,7 +27,34 @@ many unsupported features as possible. There will be cases where
scalafix is unable to perform automatic migration. In such situations,
scalafix will point to the offending source line and provide
instructions on how to refactor the code. The objective is that your
Scala 2.x codebase gets up and running faster with Dotty.
existing Scala code base gets up and running faster with new Scala versions.

Scalafix and Scala 2
------------------------

Scala 2.13 is still being planned, so we don't know yet exactly what
language changes it will include. But with Scalafix available to help
migrate existing code, changes could become possible that would
previously have been considered too disruptive because they would
require too much code to be updated by hand. Possible examples include:

* Rewriting code to avoid the use of the now-disfavored
`language.postfixOps` syntax
* Deprecation of `any2StringAdd`, in favor of string interpolation
* Deprecation of procedure syntax, as in Dotty
* Changes to the Scala collections API

Scalafix and Dotty
------------------------

There is a lot to be excited over in Dotty,
[faster compilation times](http://www.slideshare.net/Odersky/scala-days-nyc-2016),
[faster+smaller binaries](https://d-d.me/talks/scaladays2015/#/) and
[awesome error messages](http://www.scala-lang.org/blog/2016/10/14/dotty-errors.html)
to name a few things. However, some Scala 2.x applications can't
immediately enjoy these benefits due to several breaking changes in
Dotty. Scalafix is part of our strategy to smoothen the migration
process for those applications.

What can scalafix do?
-------------------------
Expand Down Expand Up @@ -64,10 +88,10 @@ def main(args: Seq[String]): Unit = { // note ': Unit ='
}
~~~

Dropping procedure syntax is part of a general effort in Dotty to
Deprecating or dropping procedure syntax is part of a general effort to
simplify the Scala language.

The `VolatileLazyVal` rewrite adds a `@volatile` annotation to lazy vals,
The `VolatileLazyVal` rewrite adds Dotty's `@volatile` annotation to lazy vals,
like this:

~~~scala
Expand Down Expand Up @@ -212,4 +236,3 @@ experiments on millions of lines of Scala code? Come chat with us on
developer tools of the future!

[gitter]: https://gitter.im/scalacenter/scalafix