3 ms·
In what way is Scala not pragmatic?
by jhomedall 7y ago
In what way is Scala not pragmatic?
- hota_mazi 7y agoIt's a language that's aimed more at research, producing papers for conferences, and financing the EPFL and its PhD students than at users in the real world. There's absolutely nothing wrong with that, by the way, I love studying all the advanced concepts that Scala has pioneered over the years. But it's also the reason why it's largely in decline and why Kotlin has taken the industrial world by storm: because it is a pragmatic language.
- jhomedall 7y agoI've used Scala in production environments, and we never had any problems with it being too academic. SBT sucks, but that's another issue. Kotlin doesn't have typeclasses (something you get as a side effect of Scala implicits), ADTs, or true pattern matching (along with exhaustivity checks). In combination, all of those allow for expressive, easy-to-read code that, in my experience, tends to have few bugs. Kotlin is a step backwards from that. It's still a significant step up from Java, however. F# is the only other language I've used that I've found comes close. However it lacks typeclasses, and the large Java ecosystem.
- hota_mazi 7y agoA step backward to you is a step forward in pragmatism for the rest of the world. I understand the value of higher kinds and I'm comfortable with Haskell, but it's pretty obvious to me why Kotlin is succeeding where Scala failed. Sometimes, improvements in programming languages are reached by having fewer features, but Scala is a kitchen sink that was always unable to turn down features, just because their implementation would lead to more research papers to submit to conferences. As a result, we ended up with a monster language that contains every single feature even invented under the sun.
- pkolaczk 7y agoAFAIK Scala is much more popular than Kotlin in terms of job postings and projects in big enterprises. My data limited to some Fortune 100 companies tell me it is on par with Python in popularity. Spark, Kafka, Flink, Finangle are written mostly in Scala. Pretty impressive for an academic, non-pragmatic language that has failed, isn't it? So can you elaborate what do you mean by "failed"? Because it seems you are using a different definition of it. "Sometimes, improvements in programming languages are reached by having fewer features, but Scala is a kitchen sink that was always unable to turn down features, just because their implementation would lead to more research papers to submit to conferences." That's some different language you're talking about. Scala is built on a small set of very powerful, general, orthogonal features which cooperate nicely and allow to build most of the stuff as libraries. Its design is much more principled than Kotlin's. Kotlin has special features built into the language, that Scala needs just a library for.
- tombert 7y agoJust a note; while there aren’t typeclasses in F#, you can use statically resolved generics with a member constraint, getting you pretty close.
- pkolaczk 7y agoKotlin is just Scala with a few most advanced features taken out with no good replacement. It is not even really much faster in compilation speed when you account for its verbosity [1] and it has worse IDE support limited to just one IDE. Jetbrains is not interested in supporting other IDEs than its own. So what is so much more pragmatic about it? Also there is no decline in Scala usage, and Kotlin doesn't exist outside its Android niche really. So "taking by storm" is a wishful thinking. [1] https://stackoverflow.com/questions/34615947/why-does-kotlin-compile-faster-than-scala https://stackoverflow.com/questions/34615947/why-does-kotlin...