Skip to content

Commit f102f50

Browse files
committed
Merge conflict resolved
2 parents ae34f9b + f224f26 commit f102f50

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

gsoc/2017.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,7 @@ the JVM) and web-based visualization libraries such as d3.
184184

185185
Supervised by [@julienrf](https://github.com/julienrf)
186186

187+
187188
### Connecting potential contributors with Scala projects via Scaladex
188189

189190
Scaladex is a cool new tool that maps out the known Scala ecosystem by
@@ -198,6 +199,25 @@ Scala.js.
198199
Supervised by [@heathermiller](https://github.com/heathermiller)
199200

200201

202+
### New line-wrapping algorithm for scalafmt
203+
204+
[Scalafmt](https://olafurpg.github.io/scalafmt/) is a code formatter for Scala.
205+
A key feature of scalafmt is that users can define a maximum width (for example 80 characters)
206+
so that long code lines get automatically wrapped into shorter lines.
207+
Currently, scalafmt uses a [token-based best-first search algorithm](https://geirsson.com/assets/olafur.geirsson-scalafmt-thesis.pdf) to wrap long lines.
208+
Both [dartfmt](http://journal.stuffwithstuff.com/2015/09/08/the-hardest-program-ive-ever-written/)
209+
and [clang-format](https://www.youtube.com/watch?v=s7JmdCfI__c) use a similar approach.
210+
This token-based best-first algorithm has [known issues](https://olafurpg.github.io/scalafmt/#Deeplynestedcode) in scalafmt.
211+
212+
The goal of this project would be to explore and implement an alternative line wrapping algorithm for scalafmt.
213+
One promising alternative is the [dynamic-programming algorithm employed by rfmt](https://www.researchgate.net/profile/Phillip_Yelland/publication/284724851_A_New_Approach_to_Optimal_Code_Formatting/links/5657f1e608ae4988a7b58558.pdf)
214+
(see [Python implementation](https://github.com/google/rfmt)).
215+
Another promising algorithm is Philip Wadler's ["prettier printer"](http://homepages.inf.ed.ac.uk/wadler/papers/prettier/prettier.pdf).
216+
The prettier-printer algorithm has been successfully employed by the [prettier](https://github.com/jlongster/prettier) JavaScript formatter.
217+
218+
Supervised by [@olafurpg](https://github.com/olafurpg)
219+
220+
201221
*... Mentors: please insert your projects here. You can use the following template and submit a PR [here](https://github.com/scala/scala-lang). Note that student applications will end on April 3, 2017 ...*
202222

203223
### *Project name*

0 commit comments

Comments
 (0)