I have to both agree and disagree with some of the commenters here regarding why scala declined in usage. There are several reasons.
1. People just got fed up with the push toward pure FP and the complexity. Pure FP and category theory, and effect libraries are just not for the average audience.
2. Android support for Kotlin drastically reduced the momentum as well
3. Spark usage was pretty heavy driver for using Scala and I’m not sure about it’s used as much.
4. Scala became more and more niche as a result of item 1 above.
This being said, I switched to Kotlin for all server side work. I think a language and in particular the ecosystem, needs the vision/stewardship that can offer more practicality and balance in the language design, programming style, tooling, and frameworks. Kotlin just became a simpler language with better support for all of the above.
I can’t think of a better company to drive the development than Jetbrains. I don’t agree with all the choices, but Kotlin overall is a beautiful, simpler language, with all the practicality, and support needed to keep it going.
However, now that Java is making strides in the language features, as compared to historical improvements at the VM level, I’m curious to see how the market share for Kotlin outside of android is going to be affected.
Personally, I still prefer Kotlin for the practical FP support, Ktor as an HTTP server, and pretty good compatibility with Java. And lastly, I think there is enormous potential in multiplatform, as a strong alternative to typescript/react native for mobile.
Disclosure: I am biased as I’m developing some libraries and soon to be made (more) public server framework.
And it's faster (or maybe my laptop is faster).