|
| 1 | +--- |
| 2 | +layout: blog-detail |
| 3 | +post-type: blog |
| 4 | +by: Jon Pretty |
| 5 | +title: "Towards A Brighter Tooling Future for Scala" |
| 6 | +--- |
| 7 | + |
| 8 | +# Towards A Brighter Tooling Future for Scala |
| 9 | + |
| 10 | +Scala has, for its entire existence, been on the back foot with its tooling |
| 11 | +support. This was true when the language first arrived in 2004 as little more |
| 12 | +than a command-line compiler, through 2010 when Typesafe's (now Lightbend's) |
| 13 | +push for commercial adoption took an early focus on improving the Scala IDE for |
| 14 | +Eclipse, through to today, as the tooling experience is very much improved |
| 15 | +thanks in part to the work of JetBrains on IntelliJ, but still lags behind the |
| 16 | +tooling support some other languages enjoy. |
| 17 | + |
| 18 | +People care about language tools, and it says a lot for Scala that its success |
| 19 | +has come without ever having had the best tooling. But a better development |
| 20 | +experience in other languages over the years has undoubtedly limited the |
| 21 | +adoption of Scala. |
| 22 | + |
| 23 | +Now, in 2018, there have been some developments primarily outside of the Scala |
| 24 | +community which present a new opportunity to change that. |
| 25 | + |
| 26 | +## The Language Server Protocol |
| 27 | + |
| 28 | +The language server protocol (LSP) initiative, started by Microsoft, but |
| 29 | +already seeing wide adoption, is a language-agnostic protocol for allowing |
| 30 | +tools which consume information about code ("clients", such as IDEs) to |
| 31 | +communicate with compilers and other tools which can provide that information |
| 32 | +("servers", or as the protocol describes them, "language smartness providers"). |
| 33 | +The LSP proposal has had early successes and has collected a lot of momentum |
| 34 | +behind it. So it's no surprise that there's already a lot of enthusiasm within |
| 35 | +the Scala community around the idea. |
| 36 | + |
| 37 | +During discussions in the last Scala Center Advisory Board meeting, one of the |
| 38 | +Scala Center sponsors proposed that the Scala Center could support the |
| 39 | +initiative, so we scheduled a meeting in January to get the ball rolling. |
| 40 | + |
| 41 | +With a many players from both commercial and open-source backgrounds already |
| 42 | +involved in tool development for Scala, we wanted to make sure that all the |
| 43 | +developers who had already contributed significantly to Scala's tooling could |
| 44 | +attend, but without having so many attendees as to make the meeting |
| 45 | +unmanageable. So we privately invited about fifty people suggested by the |
| 46 | +Advisory Board members, more than half of whom attended. |
| 47 | + |
| 48 | +This "closed doors" approach for the initial meeting was a practical |
| 49 | +compromise, made just for this one-off meeting. There are certainly other |
| 50 | +people in the community who have contributed to tooling who didn't get the |
| 51 | +chance to attend. To those we overlooked: sorry! we certainly want to include |
| 52 | +everyone who cares deeply about Scala's tooling, but it wasn't possible to run |
| 53 | +a meeting with more than about thirty attendees. |
| 54 | + |
| 55 | +## The Initial Meeting |
| 56 | + |
| 57 | +The goals of this first meeting were, nevertheless, modest. |
| 58 | + |
| 59 | +Firstly, with a number of different existing Scala tools which could play a |
| 60 | +part in Scala's LSP story, almost nobody in the meeting was familiar with them |
| 61 | +all, so to get everyone to a common understanding of the ecosystem, the largest |
| 62 | +part of the meeting was spent hearing different tool authors speak about their |
| 63 | +tools, and how they might play a part in the jigsaw. |
| 64 | + |
| 65 | +Secondly, we wanted to decide upon what our next steps should be, and how the |
| 66 | +Scala Center could help the initiative. This was a task of setting up a |
| 67 | +framework in which decisions about the Scala LSP initiative could be made in |
| 68 | +future, in a way which the majority of people supported. |
| 69 | + |
| 70 | +During the meeting, we heard presentations on |
| 71 | +[Scalameta](http://scalameta.org/) and |
| 72 | +[SemanticDB](https://github.com/scalameta/scalameta/blob/master/semanticdb/README.md), |
| 73 | +[Metals](https://github.com/scalameta/metals), |
| 74 | +[Bloop](https://github.com/scalacenter/bloop), |
| 75 | +[SBT](https://www.scala-sbt.org/), |
| 76 | +[Pants](https://www.pantsbuild.org/index.html), [Bazel](https://bazel.build/), |
| 77 | +[Ensime](https://github.com/ensime), [IntelliJ |
| 78 | +IDE](https://www.jetbrains.com/idea/), [Scala IDE](http://scala-ide.org/), |
| 79 | +[Dotty IDE](http://guillaume.martres.me/ide_paper.pdf) (Visual Studio Code), |
| 80 | +and [TASTY](http://goo.gl/Mn6EhH). |
| 81 | + |
| 82 | +Another important premise for the meeting was that the tooling should be, as |
| 83 | +much as possible, compiler-agnostic. That is to say, we should not need to use |
| 84 | +a different protocol to work with Scala 2.11 or 2.12 or Dotty, and nor should |
| 85 | +users receive a different front-end experience for any Scala-like language. |
| 86 | +This support for other compilers is important for two reasons, even though the |
| 87 | +vast majority of current users run Scalac. |
| 88 | + |
| 89 | +Firstly, compilers like Dotty and |
| 90 | +[Rsc](https://github.com/twitter/reasonable-scala) want to hit the ground |
| 91 | +running with their tooling support; waiting another decade for a new tooling |
| 92 | +ecosystem to be invented is not an option. When the time comes for Scala users |
| 93 | +to upgrade to Dotty, nobody wants the additional barrier of having to upgrade |
| 94 | +their build tool, documentation tools or IDE at the same time. They want a |
| 95 | +seamless transition. That's much easier to achieve by considering other |
| 96 | +compilers *now* than would be later. |
| 97 | + |
| 98 | +The second reason is that there is a huge amount of excitement and enthusiasm |
| 99 | +around these new compilers, and we want to channel that into the Scala LSP |
| 100 | +initiative, and take advantage of the commitment from these other developers to |
| 101 | +pull together towards a common goal. |
| 102 | + |
| 103 | +In the meeting we heard representations from the project leads of the Scalac |
| 104 | +compiler, Dotty, Rsc and Hydra about any unique features of their compiler |
| 105 | +implementations that might have any bearing on the LSP initiative. |
| 106 | + |
| 107 | +We didn't have time during the meeting for much detailed discussion, though the |
| 108 | +attendees talked about a number of ideas and concerns around what shape the |
| 109 | +initiative should take and how it should proceed. One distinction that was |
| 110 | +clear throughout the discussion was the need to separate a Scala implementation |
| 111 | +of the LSP (the protocol as described my Microsoft), from a more general "build |
| 112 | +server protocol" which would allow for the exchange of other information |
| 113 | +specific to Scala-like languages, like dependencies and classpaths, and this |
| 114 | +is reflected the main outcome of the discussion. |
| 115 | + |
| 116 | +Minutes for the meeting are available in the |
| 117 | +[scalacenter/tooling-working-groups |
| 118 | +repository](https://github.com/scalacenter/tooling-working-groups/blob/master/meetings/2018-01-17/minutes.md) |
| 119 | + |
| 120 | +## Next Steps |
| 121 | + |
| 122 | +I made a proposal during the meeting that the next steps should include the |
| 123 | +election of two working groups to take forward ideas for an implementation of |
| 124 | +LSP for Scala, and a second "Scala Tooling Protocols" group for defining other |
| 125 | +non-LSP protocols for Scala. These groups should have, |
| 126 | + |
| 127 | + - 6-9 members in each |
| 128 | + - some overlap in membership between the two groups |
| 129 | + - a mix of experts (more experience than free time) and enthusiasts (more free |
| 130 | + time than experience) |
| 131 | + - diverse representation of a variety of existing projects |
| 132 | + - at least one member from the Scala Center, but not overrepresentation |
| 133 | + |
| 134 | +As an open-source project, the dynamics of a disparate collection of developers |
| 135 | +is often better suited to innovation than shipping working software by a |
| 136 | +deadline, and a large part of the challenge will be to keep everyone on track, |
| 137 | +despite the freedom that Open Source grants us. We hope that that leadership |
| 138 | +can come from the Scala Center. |
| 139 | + |
| 140 | +## Election Process |
| 141 | + |
| 142 | +We want to encourage an open process for discussion of tooling for Scala. We |
| 143 | +want to involve many diverse minds, and we want to be inclusive. In the past, |
| 144 | +it has often been most expedient to invite a selection of known experts to take |
| 145 | +part. This has largely led to technical success, but has made it harder for |
| 146 | +many newcomers to engage with the Scala decision-making process. So to try to |
| 147 | +improve upon this, and to give the working groups greater legitimacy, we will |
| 148 | +be holding elections to choose the members of the LSP and STP working groups. |
| 149 | +This will, in part, be an experiment, but we hope it signals greater openness |
| 150 | +in how decisions which affect the entire Scala community are made. |
| 151 | + |
| 152 | +If the Scala community had a list of its members, we could invite each member |
| 153 | +to vote on the makeup of the working groups, but of course, that's not how the |
| 154 | +community works. We also do not want to open an election up to anything that |
| 155 | +could be so trivially compromised as an online poll. |
| 156 | + |
| 157 | +We will therefore take an imperfect but pragmatic approach and open voting only |
| 158 | +to those members of the Scala community who are willing to devote a small |
| 159 | +amount of their time to participating in a series of live votes, conducted |
| 160 | +online, which will take place on Wednesday, 28 February starting at 6pm GMT. |
| 161 | +Full details of the rules governing this process are [described |
| 162 | +here](https://github.com/scalacenter/tooling-working-groups/blob/master/nominations/election.md). |
| 163 | + |
| 164 | +We will announce the composition of the working groups after the voting |
| 165 | +immediately after voting has finished. |
| 166 | + |
| 167 | +## Becoming a Working Group Member |
| 168 | + |
| 169 | +Sitting as a member on either of the working groups is an opportunity to |
| 170 | +participate and influence an exciting area of development for Scala, and will |
| 171 | +be a position of some respect and privilege. But bootstrapping these groups in |
| 172 | +a way that is fair is harder than it might at first seem: the nature of our |
| 173 | +initial meeting meant that not everyone could be involved, but we do not want |
| 174 | +to exclude anyone from the opportunity to sit on these working groups. |
| 175 | + |
| 176 | +We feel that it is very important to include a combination of experience and |
| 177 | +energy in both working groups, so whilst the expertise of their members will be |
| 178 | +essential to their success, a willingness to participate and contribute are |
| 179 | +also extremely valuable selection criteria, and anyone lacking experience but |
| 180 | +having a strong desire to be involved and dedicated to the cause should not |
| 181 | +hesitate to seek candidacy: that commitment will be very valuable to the |
| 182 | +working groups. |
| 183 | + |
| 184 | +Candidates to the working group should be nominated by opening a pull request |
| 185 | +to the [scalacenter/tooling-working-groups |
| 186 | +repository](https://github.com/scalacenter/tooling-working-groups), following |
| 187 | +the [instructions described |
| 188 | +here](https://github.com/scalacenter/tooling-working-groups/blob/master/nominations/README.md), |
| 189 | +and we strongly encourage anyone with an interest in Scala's tooling, and a |
| 190 | +willingness to devote some time to participating in working group discussions |
| 191 | +to be a candidate. |
| 192 | + |
| 193 | +I will be giving a keynote about the future of Scala Tooling at [Scala |
| 194 | +Sphere](http://scala.sphere.it/) in April, a large conference in Kraków |
| 195 | +dedicated to making Scala developer tools better, now in its third year. I hope |
| 196 | +to be making some exciting announcements there about our prospects for vastly |
| 197 | +improved tooling support for Scala! Meanwhile, the working groups will have a |
| 198 | +challenging task ahead of them, but with a their collective experience, the |
| 199 | +energy and enthusiasm Scala's tooling contributors, and the support of the |
| 200 | +entire community, we can be much more optimistic about that future than ever |
| 201 | +before. |
| 202 | + |
| 203 | + |
0 commit comments