



The Scala survey 2022 is here and reveals some interesting facts about Scala 2 and Scala 3. Learn how Scala is used and more.
The 2022 year is slowly coming to an end, and it’s high time to share the Scala survey’s results and analysis. This year the questions focused mainly on the status of the ecosystem, the perception of libraries, and how Scala is being used. To see the aggregated results, you can visit the scala-lang page.
The State of Scala 2022 survey was conducted in October and attracted 2236 responses, mostly from Scala developers.
According to the survey’s results, a majority of respondents use Scala 2.13 as the main version. Notably, 40% said that they use Scala 3. We are happy to report that this number is even bigger than we hoped for and tells us that Scala 3 adoption is growing rapidly.
Almost everyone targets the JVM platform. However, many Scala users selected the platforms Scala.js and Scala Native. Since 2019 Scala.js has grown by 1.3% and Scala Native by 4.5%. Keep in mind that sample differences may have contributed to this observation.
The most popular Scala paradigm is immutability. Over 95% of respondents stated that they use immutable vals, collections, and data structures often (>= 4). The purely functional approach using dedicated libraries was selected by almost 80% of respondents, frequently (>= 3). For the same threshold, 65,5 % of respondents selected the object-oriented approach. Mutable vars, collections, and data structures are used rarely, with over 80% of responses being 2 or lower.
The most widely used new Scala 3 features are the enums, extension methods, and top-level definitions. Union types and opaque type aliases are employed less frequently, but most respondents still use them quite often. Exports are the only new feature that appears to be lacking significant adoption.
In the survey, we attempted to measure the perception and spread of various ecosystems, such as com.lihaoyi, Typelevel, ZIO, and other libraries. We will refer to the concept of the user retention ratio. This means, the ratio of responses signalling the number of users, who use the library, compared to the number of users that were using it in the past but discontinued it. A high user retention rate shows that the library either already has a strong standing in the community or has the potential to become a favourite.
50% of the respondents knew libraries from the com.lihaoyi ecosystem. The most widely used ones are PPrint and uPickle. Both have significantly high user retention ratios. The PPrint user retention ratio is 30:1, and uPickle is 4:1. Os-Lib, a Scala Toolkit library, had the second-highest user retention ratio, being 17:1.
Almost every respondent recognized cats-core and cats-effect. Moreover, over 50% of survey participants used these libraries. They also have a significantly large user retention ratio at, respectively, 14:1 for cats-core and 8.5:1 for cats-effect. Other libraries that are notably well-recognized and liked are http4s and fs2.
ZIO ecosystem stands out, with many respondents declaring willingness to test it in the future. However, these libraries received a lower but significant percentage of responses stating that respondents are unwilling to use them despite never have tryed them. ZIO and ZIO-streams, the most popular components of the ecosystem, scored high in the user retention ratio with 15:1 for ZIO and 13:1 for ZIO-streams.
Most respondents recognised Akka library in the survey. However, it has a highly controversial sentiment as it has a 1:1 user retention ratio.
Spark and Kafka are both widely used and well-liked libraries. Most notably, Kafka has a survey-wide record of a user retention ratio of 43:1.
The most popular front-end libraries for Scala in this survey were Laminar and scalajs-react. Laminar has the highest user retention ratio.
ScalaTest and ScalaCheck are the most widely used testing frameworks. Interestingly, the highest user retention ratio belongs to the munit. This is good news, as munit will be a part of the Scala Toolkit.
Pureconfig, sttp, gatling, and tapir received many responses stating that the respondents are using them. Among them, tapir, despite being popular, has many programmers willing to test it.
Unsurprisingly, the most popular IDE is IntelliJ IDEA. However, a significant number of respondents said that they use VS Code with Metals, and a considerable number want to give them a shot.
Sbt is the most widely used build tool. It has a significantly large user retention ratio, slightly below 9:1. 20% of the respondents are already using scala-cli, while over 50% use it or are planning to. Yet still, over 30% don’t recognize it.
Over 80% of respondents use scalafmt. The compiler warnings are the second most popular selection for linting, and the third one is scalafix. It’s important to note that they do not have fully overlapping feature sets, so these statistics are likely a result of respondents using them together in the same projects.
In the survey, we asked respondents to select up to 3 aspects of working in Scala that they would like to see improved. The most important one was the Compile and build speed. The next two that follow are tooling and memory usage. It’s exciting to see Scala Native with 20% of respondents voting for it – especially given its current rapid development.
The most popular languages used by the respondents besides Scala are Java, Python, and JavaScript. Given that interop with Java and JavaScript is already here, it may be interesting to see some work done in the area of working with Scala and Python.
The respondents mostly use Scala for web applications, data processing, and writing libraries and frameworks. They work primarily in projects with 10k to 100k lines (40.8%) of code and corporations with 101 to 1000 employees (33.2%). Most respondents are based in the United States, the United Kingdom, and Poland.
If you want to read more about Scala and Scala 3 we suggest following these links: