Scala Center Summer 2021 Update

The mission of the Scala Center is to steward open-source development and education in the Scala ecosystem. The Scala Center creates high-quality free educational material, it creates open-source tools increasing the productivity of Scala developers, and it guides and supports the Scala community.

Dear community,

In this post, we would like to share what the Scala Center engineering team has achieved during the summer.

Education and Documentation

Effective Programming in Scala Course

  • Monitoring of discussion forums
  • Update to Scala 3.0.2
  • Improvement of assignments based on the feedback of the learners.

Scala Documentation Website

We have been working on making the Scala documentation simpler and better, as presented here. In particular, during the summer we have worked on the following items:

Let’s Talk About Scala Video Series

We have published new videos during the summer:

Tooling

Scala Debug Adapter

  • Reworked the two-way mapping of the source files with the class files:
    It used to be done in Metals using scalameta. In order to prepare for expression evaluation during debug sessions we needed to move it to the scala-debug-adapter.
    It now uses the name of the source file that is stored in the class files.
    Because Scala source paths do not always reflect the name of the package, this method does not work 100% of the time. However we came up with a heuristic that handles the large majority of cases.
    Some metrics are available here.
  • Added expression evaluation in Scala 2.12 and Scala 2.13.
    We helped him with integration and cross-compilation in the existing code base.
    It will soon be released under scala-debug-adapter 2.0.0.

Metals

  • Reworked the tests on the integration with sbt server to improve stability.
  • Preparing expression evaluation during debug sessions.
  • Inferred type Scala 3 action
  • Allow organize imports on unsaved code.
  • Support for Scala 3.0.2 and 3.1.0-RC1.
  • JDK 17 support
  • Code action to switch to braces/parenthesis
  • Fixes for organize imports scalafix rule in Scala 3

Bloop

  • Better support for Maven multimodule projects

Gradle

  • Support for Scala 3

Scalafmt

  • Fixes for parsing Scala 3 code.
  • General bugfixing

sbt 1.6

  • Improved BSP workspace/reload error reporting.
  • Added -Dsbt.script to start sbt server, so that .jvmopts and .sbtopts files are properly loaded.
  • Made BSP requests robust to individual build target failures.

Scalafix

  • Fixed a bug in scalameta that was impacting scalafix users. In fact, Some rules rely on the warning messages to apply some fixes. Since 2.12.13 and 2.13.x, the number of warnings stored by scalameta depended on a compiler option -Xmaxwarns, which limits the number of fixes applied during each run, and the user had to configure this scalacOption to catch more warnings. Now Scalameta reports all warning independently of this scalacOptions
  • Released the 0.930` version

Scaladex

We are redesigning Scaladex to make the maintenance easier, the design more scalable, and the data more accurate.

  • Create tables and inserted actual elastic search data into PosgreSQL
  • Project page is now relying only on the database to read and write data.
  • Support searching for Scala 3 artifacts in the search API

Scastie

  • Allow users to choose among different Scala 3 versions
  • Allow users to choose among different Scala versions when the target is Scala.js
  • Add worksheet support for Scala 3 snippets
  • Fix scalafmt integration for Scala 3 snippets
  • Add support Scala 3 dependencies

Platforms

Scala Native

  • We have partially ported Java ForkJoinPool and java.util.concurrent classes, allowing for basic multithreaded usages.

  • We are working on Immix/Commix GC concurrency awareness and synchronization between mutator threads.

  • We have added support for Scala 2.12.14

  • We have identified issues in the Scala 3 compiler blocking us from adding Scala Native support - blockers should be fixed in Scala 3.1.0

Scala.js

  • Finalized the fixed version of java.util.Pattern with the correct semantics
  • Fixed small issues
  • Published Scala.js 1.7.0, which had zero known issue at the time of release
  • Configure the sbt versionScheme on all the Scala.js artifacts, including satellite projects
  • Worked with the community to transfer maintainership of scalajs-dom to the community

Compiler

TASTy Reader For Scala 2

  • Fix a case where an illegal cyclic reference error could be caused by two sealed classes sharing the same children - we increase laziness in reading sealed children (scala/scala#9699)
  • Fix a case where extending a parameterized class with cyclic bounds caused a null pointer exception when reading from TASTy - we increase laziness in reading lambda types (scala/scala#9716)
  • Fix the automatic insertion of default parameters for case classes read from TASTy, where the apply method in the companion is synthetic - we reuse the constructor’s default parameters (scala/scala#9730)
  • Fix a case of a spurious incompatible override error, when reading a class from TASTy, caused by an overridden type member being resolved to a definition of a parent class - we preserve prefixes of types in more cases (scala/scala#9746)

Scala 3 Compiler improvements

  • Prevent stack overflow in compilation of large union types of singletons (lampepfl/dotty#12972)
  • Automatic compiler synthesis of scala.reflect.Manifest when requested by implicit search (lampepfl/dotty#13142)
  • Fix a bug where a synthetic ClassTag for a union of Array types caused a compiler crash (lampepfl/dotty#13156)

Other

Google Summer of Code

  • Mentors have been guiding and supporting the work of their students during the summer. GSoC 2021 is finished, all students passed.

Scala Symposium

  • Organization of the Scala Symposium, notably handling the Program Committee
13 Likes