|
| 1 | +--- |
| 2 | +layout: contact |
| 3 | +title: Scala Center Activity Report for 2024 Q1 |
| 4 | +--- |
| 5 | + |
| 6 | +Scala Center team: |
| 7 | +Darja Jovanovic, 100%; |
| 8 | +Anatolii Kmetiuk, 100% until March 15; |
| 9 | +Adrien Piquerez, 80%; |
| 10 | +Jamie Thompson, 100%; |
| 11 | +Sébastien Doeraene, 100%; |
| 12 | +Guillaume Martres, 20%; |
| 13 | +Valérie Meillaud: 30%. |
| 14 | +VirtusLab team: Jędrzej Rochala, 100%. |
| 15 | + |
| 16 | +## At a Glance |
| 17 | +{: .no_toc} |
| 18 | + |
| 19 | +* Table of Contents |
| 20 | +{:toc} |
| 21 | + |
| 22 | + |
| 23 | +## Language, Compiler, Standard Library |
| 24 | + |
| 25 | +### Maintainance of the Scala 3 Compiler |
| 26 | + |
| 27 | +For Scala 3. |
| 28 | + |
| 29 | +Every month, about 100 new issues are opened on [the Scala 3 repository](https://github.com/lampepfl/dotty/). |
| 30 | +The project welcomes any help it can get in triaging, bug-fixing, PR reviewing, etc. |
| 31 | + |
| 32 | +Our goal is to solve long-standing issues while keeping up with new ones. |
| 33 | +We also aim to get more people involved in working on the compiler to ensure the sustainability of the project. |
| 34 | + |
| 35 | +We contributed PRs for bug fixes in various areas. |
| 36 | + |
| 37 | +### Improving Performance of the Scala 3 compiler |
| 38 | + |
| 39 | +For Scala 3. |
| 40 | + |
| 41 | +#### Support for pipelined concurrent compilation |
| 42 | + |
| 43 | +We merged PRs [scala/scala3#18880] and [scala/scala3#20153], which from Scala 3.5.0 enable support for pipelined builds in sbt (pipelined Scala 2 builds are supported since 2020). |
| 44 | +Pipelining enables multi-project builds to increase throughput by compiling upstream sub-projects in parallel with a downstream sub-project. |
| 45 | +In the contributors forum, [early testers report](https://contributors.scala-lang.org/t/try-out-pipelined-builds-in-scala-3-5-nightly/6627) improvements from 10%-30% in build times. |
| 46 | +The maximum potential for improvements really depends on each individual build layout. |
| 47 | + |
| 48 | +The pipeline compilation mode will act as the basis for further compilation modes that can increase parallelism in builds, such as an initial outline typing mode, currently incubating in PR [scala/scala3#19589]. |
| 49 | + |
| 50 | +We also improved the Java type checker in the compiler (PR [scala/scala3#19747]), which is necessary for pipeline builds which export Java definitions to TASTy format. |
| 51 | + |
| 52 | +#### Computing compilation metadata in parallel. |
| 53 | + |
| 54 | +Another way to potentially improve compilation times is move computation of various data formats used by Scala tooling to a separate thread. |
| 55 | +We are currently supervising a student project at EPFL to compute Zinc metadata using TASTy Query -- which can be offloaded to a separate thread after the pickler phase is completed. |
| 56 | +Typically, computation of Zinc metadata adds 10% time to the build of a single project. |
| 57 | +We hope to reduce that overhead. |
| 58 | + |
| 59 | +### Scala.js-specific Minifier |
| 60 | + |
| 61 | +For Scala 2 and 3. |
| 62 | + |
| 63 | +During this quarter, we implemented various optimizations reducing code size of Scala.js projects. |
| 64 | +The main ingredient was a global property renamer for the Scala.js linker, which we call the minifier. |
| 65 | +The minifier is enabled by default when the Google Closure Compiler cannot be used, which is notably the case when emitting ECMAScript modules. |
| 66 | + |
| 67 | +Other optimizations apply in all configurations, and include: |
| 68 | + |
| 69 | +* purity analysis of constructors in order to better elide unused fields and modules |
| 70 | +* dealiasing of `val`s in top-level objects when their right-hand-sides are constants, references to other objects, or references to fields of other objects |
| 71 | +* "inlining" of local `val`s that are used only once |
| 72 | + |
| 73 | +We shipped all of these as part of [Scala.js 1.16.0](https://www.scala-js.org/news/2024/03/19/announcing-scalajs-1.16.0/). |
| 74 | +Most feedback reports from users suggest converge on 35-40% code size reduction for real-world applications. |
| 75 | + |
| 76 | +### WebAssembly backend for Scala.js |
| 77 | + |
| 78 | +For Scala 2 and 3. |
| 79 | + |
| 80 | +In collaboration with VirtusLab, we have developed an initial version of a [WebAssembly backend for Scala.js](https://github.com/tanishiking/scala-wasm). |
| 81 | +The implementation already passes the full test suite of Scala.js, with the exception of `@JSExport`ed members in Scala classes. |
| 82 | + |
| 83 | +The code produced is not yet optimized. |
| 84 | +Code size is however comparable to the minified output for JavaScript. |
| 85 | +This suggests that after optimizations, we will reach significantly smaller bundles. |
| 86 | +We do not know yet what the performance profiles will look like. |
| 87 | + |
| 88 | +The next steps on this project are to merge the work into Scala.js core and ship it as part of the next release. |
| 89 | +We will then look into enabling the Scala.js optimizer in the WebAssembly backend. |
| 90 | + |
| 91 | +### TASTy Reader for Scala 2 |
| 92 | + |
| 93 | +For Scala 2. |
| 94 | + |
| 95 | +We added support in Scala 2.13.13 (PR [scala/scala#10670][scala/scala#10670]) for TASTy produced by Scala 3.4. |
| 96 | +This update integrates support for two major changes: |
| 97 | + |
| 98 | +* the ability to read from classpath entries that only contain TASTy files, such as when using pipeline compilation. |
| 99 | +* the ability to read Java definitions from TASTy. |
| 100 | + |
| 101 | +### Scala Improvement Process |
| 102 | + |
| 103 | +For Scala 3. |
| 104 | + |
| 105 | +The [Scala Improvement Process](https://docs.scala-lang.org/sips/) coordinates the evolution of the language. |
| 106 | +It ensures that the decisions are made by taking into account the needs of all the stakeholders of the language. |
| 107 | + |
| 108 | +Several SIPs were approved for Implementation in the past quarter. |
| 109 | +The binary literals SIP made it all the way to final approval, and will ship in Scala 3.5.0. |
| 110 | + |
| 111 | +## Developer Experience |
| 112 | + |
| 113 | +### Debugger in Metals |
| 114 | + |
| 115 | +For Scala 2 and 3. |
| 116 | + |
| 117 | +We released the [4.x major version](https://github.com/scalacenter/scala-debug-adapter/releases/tag/v4.0.0) of the Scala Debug Adapter, which features pretty stack traces, run-time evaluation and hot-code replace: |
| 118 | + |
| 119 | +* In the pretty stack traces (scala 3 only) we print the fully typed Scala signatures instead of the erased Java ones. |
| 120 | +* The run-time evaluator (Scala 2 and 3) is able to evaluate Java-like expressions using run-time information of the program. It speeds up the watches and the debug console, and allows to access members without casting. The compiler-based evaluation is still used as a fall-back to evaluate Scala expressions: overload resolution, pattern matching, lambdas, implicit resolution, macro expansion, etc. |
| 121 | +* The hot-code replace feature (Scala 2 and 3) allows to re-compile code during the debug session and to load it. It changes the implementation of methods that are already loaded by the debugged JVM. |
| 122 | + |
| 123 | +This new version of the Scala Debug Adapter is available in Metals since version 1.3.0. |
| 124 | + |
| 125 | +### Presentation Compiler |
| 126 | + |
| 127 | +For Scala 3. |
| 128 | + |
| 129 | +We are always working on improving the IDE experience. |
| 130 | +During this quarter, we fixed a number of issues in the presentation compiler, which powers autocompletion, signature hints, etc. |
| 131 | + |
| 132 | +We also invested some time into a significant refactoring in the autocompletion implementation. |
| 133 | +That refactoring helped us bring two improvements: |
| 134 | + |
| 135 | +* introducing fuzzy search for completions, making them more resilient to user input, and |
| 136 | +* improving the heuristic for completions of constructors and `apply` methods to classes and values. |
| 137 | + |
| 138 | +They will be shipped in Scala 3.3.4 in the LTS line, and 3.5.0 in the Next line. |
| 139 | + |
| 140 | +### sbt 2 |
| 141 | + |
| 142 | +For Scala 2 and Scala 3. |
| 143 | + |
| 144 | +We pursued the migration of sbt to Scala 3: |
| 145 | + |
| 146 | +* We cleaned up parts of the sbt codebase: [reducing abstraction in Execute](https://github.com/sbt/sbt/pull/7444), [using Tuple.Map instead of AList](https://github.com/sbt/sbt/pull/7456), [removing usage of Manifest](https://github.com/sbt/sbt/pull/7490). |
| 147 | +* We fixed many of the pending tests: mostly in [#7522](https://github.com/sbt/sbt/pull/7522), but also in [#7492](https://github.com/sbt/sbt/pull/7492), [#7494](https://github.com/sbt/sbt/pull/7494), [#7517](https://github.com/sbt/sbt/pull/7517), [#7519](https://github.com/sbt/sbt/pull/7519), [#7521](https://github.com/sbt/sbt/pull/7521), and [#7538](https://github.com/sbt/sbt/pull/7538). |
| 148 | + |
| 149 | +We use the [#7462 meta issue](https://github.com/sbt/sbt/issues/7462) to track the progress of porting sbt to Scala 3. |
| 150 | + |
| 151 | +Additionally, we are supporting the development of remote caching in sbt 2 by reviewing pull requests ([#7464](https://github.com/sbt/sbt/pull/7464), [#7525](https://github.com/sbt/sbt/pull/7525)) and contributing ([#7539](https://github.com/sbt/sbt/pull/7539)). |
| 152 | + |
| 153 | +### Zed Editor Support for Scala |
| 154 | + |
| 155 | +For Scala 2 and 3. |
| 156 | + |
| 157 | +The Zed text editor become open source in early 2024, and gathered a lot of attention across the industry. |
| 158 | +We investigated adding support for Scala with Metals as an LSP extension. |
| 159 | +In the process, we identified and reported a bug in Zed's LSP client implementation (see issue [zed-industries/zed#7091][zed-industries/zed#7091]). |
| 160 | +We also coordinated with other community members. |
| 161 | +A Scala plugin has now been accepted to the Zed extension store. |
| 162 | + |
| 163 | +### Metals maintenance |
| 164 | + |
| 165 | +For Scala 2 and 3. |
| 166 | + |
| 167 | +We are generally working on improving the stability of Metals. |
| 168 | +One major difficulty is that effectively reporting issues is difficult for users, notably in the presence of crashes. |
| 169 | + |
| 170 | +To get better insight into everyday issues, we are implementing a telemetry system inside Metals. |
| 171 | +It will allow users to opt in to automatically sending reports in the event of crashes. |
| 172 | +We expect that these additional data will help us make Metals more robust in the future. |
| 173 | + |
| 174 | +## Community and Contributor Experience |
| 175 | + |
| 176 | +For Scala 2 and Scala 3 throughout. |
| 177 | + |
| 178 | +### Ambassador Program |
| 179 | + |
| 180 | +We incubated the [Scala Ambassador program](https://github.com/scalacenter/ambassadors). |
| 181 | +This is a program to foster a new generation of Scala community leaders, able to competently answer community questions. |
| 182 | +Those people will also be empowered to organize local community events and otherwise help their local communities thrive. |
| 183 | + |
| 184 | +Currently, the program is in its early stages, as we welcome our first Ambassadors on an invitation basis. |
| 185 | +The program is meant to recognize and support the independent work of active community leaders. |
| 186 | +We publicly announced it at Scalar 2024 and [on our website](https://www.scala-lang.org/blog/2024/03/28/ambassadors-initiative.html). |
| 187 | + |
| 188 | +The ambassador program will strengthen the community, amplify the official story around Scala and increase activity in the local Scala communities. |
| 189 | + |
| 190 | +### Google Summer of Code |
| 191 | + |
| 192 | +Google Summer of Code has been a long-standing vehicle for the Scala Center to attract newcomers to the Scala OSS world. |
| 193 | + |
| 194 | +This year, the Scala Center was accepted again as an organization. |
| 195 | +We received 15 good proposals from students, supported by 11 mentors from across the Scala community. |
| 196 | +We are in the process of submitting the proposals to Google for ranking. |
| 197 | +After we find out how many projects Google will accept for the implementation stage, we will mentor students and support other mentors throughout the program. |
| 198 | + |
| 199 | +### Scala.IO |
| 200 | + |
| 201 | +We organized a Scala Spree co-located with the Scala.IO conference. |
| 202 | +We also gave a talk there about the Scala 3 Compiler Academy, which covers how to bootstrap and develop similar projects. |
| 203 | + |
| 204 | +### Scalar Conference |
| 205 | + |
| 206 | +At Scalar, Warsaw, we presented a talk about how to use type class derivation "Mirrors for operations, not data". |
| 207 | +The talk raises awareness about the new type-class derivation feature of Scala 3. |
| 208 | +It proposes new directions to take it in, such as synthesizing web services from descriptions. |
| 209 | + |
| 210 | +Our team also held a booth at Scalar. |
| 211 | +At the booth, we answered questions from the community, collected feedback and worked to establish new corporate partnerships. |
| 212 | + |
| 213 | +### Scala Website Scams |
| 214 | + |
| 215 | +In February and March 2024, the Scala community was the target of an elaborate scam scheme. |
| 216 | +We took immediate action to warn the community, shut down domain names used by the scammers, and support victims--to the extend possible. |
| 217 | + |
| 218 | +Among the most effective measures we took, we added warning banners to the official Scala websites. |
| 219 | +Since the fraudulent sites copied major sections of our websites, many links take potential victims to the real site, where they see our warning. |
| 220 | +We have had reports that this actually helped to prevent more people become victims to this scam. |
| 221 | + |
| 222 | +We extensively communicated about the scams and our response. |
| 223 | +You can find more details in [an initial warning blog post](https://www.scala-lang.org/blog/2024/03/01/fake-scala-courses.html) and [an update on our response](https://www.scala-lang.org/blog/2024/03/18/scam-response.html). |
| 224 | + |
| 225 | +We have not received further complaints in April, which we hope means the end of this particular attack. |
| 226 | + |
| 227 | +### Scala in Embedded Systems programming |
| 228 | + |
| 229 | +We have been consulting with the Embedded Systems Laboratory at EPFL on a project to create a framework for developing FPGA accelerators in Scala, based upon the Chisel DSL. |
| 230 | +We aim to promote Scala's abstraction capabilities to make it easier for hardware engineers to do their work. |
| 231 | + |
| 232 | +### Compiler Sprees |
| 233 | + |
| 234 | +We maintained our involvement in the [Scala 3 Compiler Academy Issue Spree](https://www.scala-lang.org/blog/2022/11/02/compiler-academy.html). |
| 235 | +We collaborated with both new and experienced contributors on issues such as [dotty#19464](https://github.com/lampepfl/dotty/pull/19464) and [dotty#19463](https://github.com/lampepfl/dotty/pull/19463). |
| 236 | + |
| 237 | +Since its inception, the compiler spree has helped close [more then a hundred issues](https://github.com/lampepfl/dotty/issues?q=is%3Aissue+sort%3Aupdated-desc+label%3ASpree+is%3Aclosed) with the help of over 80 contributors. |
| 238 | + |
| 239 | +[scala/improvement-proposals#67]: https://github.com/scala/improvement-proposals/pull/67 |
| 240 | +[scala/scala3#18880]: https://github.com/scala/scala3/pull/18880 |
| 241 | +[scala/scala-lang#1604]: https://github.com/scala/scala-lang/pull/1604 |
| 242 | +[scala/docs.scala-lang#2993]: https://github.com/scala/docs.scala-lang/pull/2993 |
| 243 | +[zed-industries/zed#7091]: https://github.com/zed-industries/zed/issues/7091 |
| 244 | +[scala/scala#10670]: https://github.com/scala/scala/pull/10670 |
| 245 | +[pipeline-thread]: https://contributors.scala-lang.org/t/try-out-pipelined-builds-in-scala-3-5-nightly/6627 |
| 246 | +[scala/scala3#19747]: https://github.com/scala/scala3/pull/19747 |
| 247 | +[scala/scala3#19589]: https://github.com/scala/scala3/pull/19589 |
| 248 | +[scala/scala3#20153]: https://github.com/scala/scala3/pull/20153 |
| 249 | +[scala/scala3#19838]: https://github.com/scala/scala3/pull/19838 |
0 commit comments