6 ms·
Why is Scala not more popular? It seems like such an awesome language, is it because of it academic origins or because it's not functional enough?
by type0 7y ago
Why is Scala not more popular? It seems like such an awesome language, is it because of it academic origins or because it's not functional enough?
- Traubenfuchs 7y agoThere are well established programming languages for every single niche requirement. What's Scalas unique selling point? Where are they supposed to get/"steal" their users from?
- type0 7y agoWell the oblivious answer would be Java, but I get that my contempt for it is the only thing causing me to look at Scala and that's by no means universal as most people are pretty happy with the latest versions.
- manojlds 7y agoWell, it's the language of choice for Spark. That fills the big data niche.
- lmm 7y agoAt a concrete use case level, it's a language where you can write Java- or C#-like code with no "magic": no reflection, no AOP, none of the stuff that tends to be the biggest cause of bugs in real-world Java/C# codebases. All of the stuff that you would need reflection or AOP (or metaclasses or macros, in other languages) for, you can do in plain old Scala code. In the abstract, it's the only mainstream language to offer both higher-kinded types and traditional OO ("extends") inheritance. From one side it offers all the good stuff of OCaml, F#, Swift, Kotlin, or Rust, but with a better type system that makes handling secondary concerns via "context-like" types a breeze. From the other side, it offers similar power to Haskell, but with more understandable performance, a better library/tool ecosystem (IDE, profiler and so on), less reliance on memory-unsafe code in practice (a lot of things in Haskell require C-wrapping libraries for things like image formats, whereas the corresponding cases in Scala wrap Java instead), and the ability to use traditional OO style if you want.
- mac01021 7y agoI've been turned off of it by SBT in the past.
- aphexairlines 7y agoA lot of Java shops moved from Maven to Gradle, and Gradle builds Scala projects: https://docs.gradle.org/current/userguide/scala_plugin.html https://docs.gradle.org/current/userguide/scala_plugin.html Bazel works well too: https://github.com/bazelbuild/rules_scala https://github.com/bazelbuild/rules_scala
- lmm 7y agoMaven itself works fine. In nine years of Scala I've never understood what problem SBT is supposed to solve - it seems very complicated to no real benefit.
- swish_bob 7y agoI loved the incremental compile/watch tests stuff myself. It's been a while, but I do miss having all my tests run every time I save a file. But I do accept that sbt is not everybody's cup of tea.
- lmm 7y agoI had heard that use case mentioned now that I think about it. To my mind it makes much more sense to have the IDE handle that part; the IDE knows which file I've edited and when I've saved it rather than having to scan the filesystem. But I guess some people must find it useful.
- flurdy 7y agoI have never fully understood why people are often upset with SBT. Sure it is not perfect, but the alternatives are much worse and most of the issues people have with SBT projects are other people abusing the build file. The REPL, fast incremental builds, continuous unit testing, shared SBT sessions, etc makes my day so much better. I live all day long with: `~testOnly *WalabySpec -- -z killRoo`. Whenever I have to jump into an app using Maven or only slightly better Gradle it is so frustrating.
- mrkeen 7y agoNon-FP folks can hate on it because FP is confusing. FP folks can hate on it because it doesn't have pure functions. I don't believe the "best of both worlds" selling point. Anyway I don't think it's worth dwelling on popularity. Networking and political effects seem to be more powerful than the merits of a language.
- type0 7y ago> I don't believe the "best of both worlds" selling point Not best of both, but it's the ability to solve the task with either FP or OO depending on the task and do it seamlessly. > Networking and political effects seem to be more powerful than the merits of a language. That's probably more true than anything, also it's not hipster enough to convince your regular clojurescript aficionados.
- mrkeen 7y agoI'm doubling down on my "both worlds" point, whether you state it as (scala = FP and OO) or (scala = FP or OO). My choice to be null-free does not survive my coworkers' choice to use null. Likewise with mutability, purity, inheritance etc. The feature that I want is to look at (n : T) and understand that T is T, not (T | ? extends T) and that n is n, not (n | null), or n now and n' later.
- pas 7y agoIt's not Scala's fault if a team can't decide on a coherent coding style/standard, but I feel your point :( That's why Rust's safety first creed is so welcome. (And that there's --strict in TypeScript.)
- andrewingram 7y agoFrom an outsider perspective (but my last company used Scala heavily), Scala supports nearly every language feature under the sun to the point that idiomatic use of the language is hard to define (unlike say Python, which has very strong idioms). It seems that if you want a multi-paradigm language, Scala is excellent. But if you just want to go down the functional route or OO route (without overlap), there are arguably better choices.
- manojlds 7y agoIt's because of the compiler and SBT to be frank. They are very very clunky.
- aphexairlines 7y agoYou don't need SBT. Gradle builds Scala projects just fine.
- raphaelj 7y agoExcept Gradle is worst ...
- aphexairlines 7y agoFeel free to use Bazel or Pants or Mill or Maven or Fury if Gradle isn't your cup of tea.
- swish_bob 7y agoGradle is so much better than maven it's not even funny. Every time I check out a project in maven these days, I flinch.
- pjmlp 7y agoEvery time I get to do a Gradle build I have enough time to go out for lunch.
- danielscrubs 7y agoIf true, I’m curious as to why. They call the same compiler and both support incremental compilation.
- pjmlp 7y agoBecause Gradle requires an additional daemon sucking up 2GB and uses Groovy for plenty of its tasks, instead of using declarative builds implemented in Java without using background daemons. I seldom see conference talks how to optimize Maven builds, Gradle talks about build optimization, at least one per Java conference, and several per Android one. Just Google IO 2019 had three talks about it.
- sqrt17 7y agoThe academic origins give the language a clarity that's great, at the same time macros and implicits and other language features make IDE support slow and error-prone and the compilation process as a whole rather slower than Java's or Kotlin's. On top of that, the designers introduce breaking changes in every minor release, which makes it a poor choice for software that you want to last very long. All of these factors contributed to Scala adopters like LinkedIn subsequently retracing their steps and doing new development only in Java. So, academic origins are fine (many good programming languages have academic or at least research-influenced origins), but an academic attitude to the development work that a language should support (predictability of breaking changes, possibility of good IDE support) harms the adoption of a language.
- danielscrubs 7y agoLinkedIn might also want cheap Java-labor. It’s one of the first languages you get in contact with after all.
- new4thaccount 7y agoMost of my background is in Python, but I've dabbled in a lot of languages out there from Haskell, lisp, Perl...etc. The point being I don't mind trying new things. I don't know Java and the JVM very well though and a lot of hosted languages like Scala, Clojure, Kotlin...etc seem to assume that you're intimately familiar with it which is a pain. Also, the Scala tooling when I last checked ~2 years ago was complex. I just wanted to write a simple app and started drowning in the complexity of SBT and gave up pretty quick. Your mileage may vary, especially if you're already familiar with the Java ecosystem. I've had more success with F# and OCaml. Note that I'm not saying Scala is bad, it just wasn't an easy enough transition for me to justify climbing the plateau. Clojure ended up being a similar situation. These languages are also optimized around writing large software projects and that was a hindrance rather than a benefit to someone that does more scripting than anything.
- fulafel 7y agoClojure is great for scripting now.
- new4thaccount 7y agoDoes it still require you to magically know a ton of Java classes?
- fulafel 7y agoNope. Also many people are doing scripting on Node runtime instead of JVM.
- stunt 7y agoScala is only 15 years old. It's quite popular if you consider its age. Sometimes Scala teams are more expensive to set up. So there are budget-friendlier alternatives (Java, PHP, Python, NodeJS) for many projects.