You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: gsoc/2017.md
+20Lines changed: 20 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -184,6 +184,7 @@ the JVM) and web-based visualization libraries such as d3.
184
184
185
185
Supervised by [@julienrf](https://github.com/julienrf)
186
186
187
+
187
188
### Connecting potential contributors with Scala projects via Scaladex
188
189
189
190
Scaladex is a cool new tool that maps out the known Scala ecosystem by
@@ -198,6 +199,25 @@ Scala.js.
198
199
Supervised by [@heathermiller](https://github.com/heathermiller)
199
200
200
201
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
+
201
221
*... 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 ...*
0 commit comments