The future of Scala: Pioneering features are now commonplace so what comes next?

The future of Scala: Pioneering features are now commonplace so what comes next?

Scala creator Martin Odersky and key library author and maintainer Li Haoyi have described their plans for the future of the language, with the hope of maintaining its relevance in the modern programming landscape.

The open-source language was first released in 2003, with its strongest feature being the fusion of functional and object oriented programming. Scala primarily compiles to Java bytecode, though there it can also target JavaScript via Scala.js. Apache Kafka, a popular event streaming platform, is written mainly in Scala, and Scala is the core language of Apache Spark, used for data analysis and machine learning. 

Li Haoyi is a software engineer at Databricks, an analytics company which uses Scala extensively. Databricks was built by the original creators of Apache Spark.

According to Odersky and Haoyi, Scala is “no longer riding the wave of hype it had in the mid-2010s” but is maintaining its position just outside mainstream languages. One can nevertheless detect some anxiety for the future of Scala in their post, which references issues around poor IDE support and learnability, and describes the call to freeze all feature development as a “common request” but one that would doom the language to “stagnation and failure.”

The authors see Scala as a bleeding-edge language, providing more features but with less polish and stability than Java; but this status has been undermined by the progress of Java and other languages such as Kotlin. Features such as lambdas and pattern matching were pioneered in Scala, at least within the JVM (Java Virtual Machine) ecosystem, but “much of what used to be unique to Scala is now common,” they write.

Odersky and Haovi set out a number of objectives for Scala and its community. These include:

  • Increasing safety with features such as explicit nulls, which make types non-nullable by default
  • More convenience features such as named tuples, allowing reference to type elements by name
  • Fixing long-standing annoyances
  • Improving learnability, for example by prioritizing code and documentation for simpler libraries including the Scala Toolkit, and aligning Scala syntax with other languages where possible
  • Improving IDE support, including work on Metals, the Scala language server used by VS Code
  • Improving build tooling, because many find the standard build tool, called sbt, too complex, despite its name being an acronym for “simple build tool.”

Although these look like sensible objectives, they may not be enough to reposition Scala and revive its popularity. 

Scala 3, released in May 2021, was a major update but not entirely compatible with Scala 2, and a 2023 survey found that only 49 percent of Scala developers were using Scala 3 at all. This is a typical problem when language designers release improved but incompatible versions; despite the benefits, it tends to fracture the ecosystem, as happened with Python 2 and 3.

“If anything the Scala situation seems much worse than the Python situation. The language looks completely different and there is no easy migration path” said one developer still using Scala 2.13.

The counter-argument, as another developer put it, is that “Scala 3 is really what Scala was supposed to be. The language is just about perfect, and the most important and popular libraries and tools … are all supporting the new version for years already.”