Skip to content

Commit ba5323f

Browse files
Merge pull request #513 from SethTisue/scalafix-and-scala-2
make Scalafix blog post not so entirely Dotty-centric
2 parents 1940983 + 1a41b3e commit ba5323f

File tree

1 file changed

+38
-15
lines changed

1 file changed

+38
-15
lines changed

blog/_posts/2016-10-24-scalafix.md

Lines changed: 38 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,24 +2,21 @@
22
layout: blog
33
post-type: blog
44
by: Ólafur Páll Geirsson
5-
title: "Introducing Scalafix: a migration tool for Scalac to Dotty"
5+
title: "Introducing Scalafix: a code migration tool for Scala"
66
---
77

88
I am excited to announce the first release of
99
[scalafix](http://scalacenter.github.io/scalafix/), a new tool to
10-
prepare Scala 2.x code for [Dotty](http://dotty.epfl.ch/), a next
11-
generation Scala compiler. This effort follows the Scala Center Advisory
10+
prepare Scala code for future Scala versions, including Scala 2.13
11+
and beyond as well as [Dotty](http://dotty.epfl.ch/), a next
12+
generation Scala compiler.
13+
14+
This effort follows the Scala Center Advisory
1215
Board proposal:
1316
["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).
1417

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

2421
Scalafix takes care of easy, repetitive and tedious code transformations
2522
so you can focus on the changes that truly deserve your attention. In a
@@ -30,7 +27,34 @@ many unsupported features as possible. There will be cases where
3027
scalafix is unable to perform automatic migration. In such situations,
3128
scalafix will point to the offending source line and provide
3229
instructions on how to refactor the code. The objective is that your
33-
Scala 2.x codebase gets up and running faster with Dotty.
30+
existing Scala code base gets up and running faster with new Scala versions.
31+
32+
Scalafix and Scala 2
33+
------------------------
34+
35+
Scala 2.13 is still being planned, so we don't know yet exactly what
36+
language changes it will include. But with Scalafix available to help
37+
migrate existing code, changes could become possible that would
38+
previously have been considered too disruptive because they would
39+
require too much code to be updated by hand. Possible examples include:
40+
41+
* Rewriting code to avoid the use of the now-disfavored
42+
`language.postfixOps` syntax
43+
* Deprecation of `any2StringAdd`, in favor of string interpolation
44+
* Deprecation of procedure syntax, as in Dotty
45+
* Changes to the Scala collections API
46+
47+
Scalafix and Dotty
48+
------------------------
49+
50+
There is a lot to be excited over in Dotty,
51+
[faster compilation times](http://www.slideshare.net/Odersky/scala-days-nyc-2016),
52+
[faster+smaller binaries](https://d-d.me/talks/scaladays2015/#/) and
53+
[awesome error messages](http://www.scala-lang.org/blog/2016/10/14/dotty-errors.html)
54+
to name a few things. However, some Scala 2.x applications can't
55+
immediately enjoy these benefits due to several breaking changes in
56+
Dotty. Scalafix is part of our strategy to smoothen the migration
57+
process for those applications.
3458

3559
What can scalafix do?
3660
-------------------------
@@ -64,10 +88,10 @@ def main(args: Seq[String]): Unit = { // note ': Unit ='
6488
}
6589
~~~
6690

67-
Dropping procedure syntax is part of a general effort in Dotty to
91+
Deprecating or dropping procedure syntax is part of a general effort to
6892
simplify the Scala language.
6993

70-
The `VolatileLazyVal` rewrite adds a `@volatile` annotation to lazy vals,
94+
The `VolatileLazyVal` rewrite adds Dotty's `@volatile` annotation to lazy vals,
7195
like this:
7296

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

214238
[gitter]: https://gitter.im/scalacenter/scalafix
215-

0 commit comments

Comments
 (0)