How many Python developers would like a 10-20x faster version of the language with better parallelism and concurrency, or Java developers a more concise language better suited for rapid development on top of the huge ecosystem they built their systems on? Scala provides both.
There are a bunch of confusing frameworks from Scala's early days that leant it a bad rap, or niche tools that do not fit everyone's use case, but you don't need to use them. I've personally never used Shapeless/Akka/Scalaz/Cats in my entire career and I've gotten by OK. I haven't used SBT for years now. You can use these things if you want, and some people do, but only if you really want to. The Scala community is a Big Tent.
Really, every language is converging on Scala: a concise, hybrid OO/FP language with a rich, inferred static type system it uses for bug-catching, tooling support, and performance. Python has got static types and case classes, is getting pattern matching and type-driven compilation. Ruby is getting static types. C# is getting pattern matching and case classes. Java got lambdas, is getting type inference and pattern matching and case classes. Haskell is getting OO-style dot-syntax for records. Go is getting generics.
This is a spot in the language design space everyone is trying to get to, and Scala is already there and works great. I use it professionally to implement programming languages, distributed systems, websites, etc. and it really works as well as you'd expect "Superfast Python with static types" or "Java without all the Java-verbosity problems" to work. A true general-purpose high-level language
* os-lib: allows for nice filesystem operations
* upickle: allows for sane JSON
* utest / munit: sane testing (rather than Scalatest)
* scalafmt: great go-like automatic code formatting
As long as Scala keeps replicating all the features in other programming languages, it'll have a bright future. It's a really powerful programming language.
I do kind of miss it though. Right now I’m pretty happy with Typescript...
To be clear, these complex features are still there, it's just that people tend to not use/overuse/abuse them as much. Just like how Python has metaclasses and import-hook metaprogramming, but it's not something that a typical developer has to deal with on a day-to-day or even year-to-year basis
Those thankfully have largely disappeared. The design space of programs in Scala is still large (detractors might say too large), but it's way better explored now and there's a much clearer idea of the various tradeoffs among the various approaches as well as how to harmonize one with another.
Actually, languages with rich type systems in general seem to really struggle in this space.
I suspect there's two factors.
First, I think the current crop of languages with "rich type systems" (I imagine you're thinking of Haskell, Scala, ML and the like?) basically all are in this weird uncanny valley where people get tempted into trying all sorts of cool type tricks to make everything line up, and the type systems are just not _quite_ expressive enough to make it all go well.
Most of the time if you just use arrays/your language's usual collection type of numbers (or arrays of arrays... etc.) in those static languages you'll do great.
To take it to next level and really model ML faithfully I think you probably will need some version of dependent types and there just aren't really any good implementations of that at the moment.
Secondly, a lot of ML is powered by data scientists and statisticians to whom dynamic languages mesh probably better with their own educational background (when was the last time you saw types written out in a stats textbook?). It's really kind of jarring and annoying to have to deal with type systems when you've never done any professional programming before.
Julia has a very rich type system. It's not exactly popular (yet?) but it's certainly very usable and good for numerical work and ML. but they started out with the goal of building a numerical language from day one.
I can imagine if you have a completely general purpose language, and want to provide an library that's an interface to low-level numerical libraries, NumPy style, that this task might be more difficult to get right in a language with more complicated types. There seem to be a lot of half-assed unfinished numerical libraries in both Scala and Rust.
Now that all the APIs are centered around Dataframes, Scala's rich type system has been relegated to providing implicits for the SQL-like DSL, which is a shame, but it's still an eminently Scala-centric tool.
Everything's great until you join a team which uses it...
As one data point, "slow Scala compiles" was the #1 biggest developer complaint at my company when I joined in 2017, and nowadays that complaint doesn't even break the top 10. Scala compiles are not great, but not terrible.
A lot about Scala sucked in 2015, and I wouldn't recommend 2015 Scala to anyone, but it's not 2015 any more. 2021 Scala is what I'm talking about
I would dispute the former means Haskell is getting OO features (more the case that it's finally realized that having proper records a la Purescript or Elm is pretty important for day-to-day code; records and objects are quite different beasts) and Go getting generics is Go getting functional (or OO features, I don't find Go particularly OO to begin with).
> Really, every language is converging on Scala
I think this is more symptomatic of Scala trying to do so much to begin with, such that any change any language makes can be tied to some feature Scala has.
That being said, I'm really happy to see Scala 3 reining in a lot of those choices (except a new parallel set of whitespace-based syntax... that seemed like a gratuitous cost to one's novelty budget, but time will tell; the community already seems to be warming to it).
To those starting out with Scala, lihaoyi's book is a great place to begin!
I'll offer one piece of advice (to those beginners, not lihaoyi, who I'm sure needs none of my advice). These days when I talk to people about Scala who've never used it before, I don't like talking about it as a hybrid FP/OO language.
I prefer to describe it as an OO language with a lot of syntax sugar and standard library choices to enable emulation of FP on top when desired. It is useful to think of Scala the base language, i.e. what everything desugars to, as an OO language.
This is neither good, nor bad. However, I think this realization helps illuminate a lot of strategies around coding in Scala. If your having performance issues, drop down to the desugared OO layer and you'll probably find ways to squeeze out more performance. If you're having a hard time understanding how some of the FP constructs work, step through their desugared OO equivalents (e.g. there aren't really higher-order functions, just an automatic instantiation of FunctionN classes wrapping methods at call sites).
Scala 3 has smoothed out a lot of the mismatch so that its most obvious issues are gone (monomorphic functions vs polymorphic methods, weird eta expansion issues, weird subtyping requirements for implicit prioritization, etc.), but I've still found treating OO as the core of Scala to be a general rule of thumb which is useful for new Scala programmers when they come across something they think should work but doesn't. As you work more and more in Scala and that conversion of FP to OO primitives becomes extremely fluid and natural for you, a lot of choices and quirks that Scala has become far easier to explain and a lot easier to deal with.
At my work it's pretty OO, with FP used where convenient. People join and start reading/writing Scala with zero experience or training, and it works out OK.
At Stripe, I understand their Scala is pure FP, with the first onboarding docs discussing "What is a Monad". I assume they need more training for people who don't have a pure-FP background, but if it works for them who am I to judge.
My own personal style is somewhere in between, certainly more FP than at my work, but nowhere near as FP as those who are really into it.
I use my own Castor actor library for some of my own projects where Actors were really becoming necessary, but at 2 files and 200 lines of code it would be a stretch to call it a framework.
If you really think the "Akka-way" is what fits your thinking, go ahead and use it, but it's by no means necessary, and I think most people can get by just fine without it.
It’s also at least 10-20x more complex a language. Can’t see the appeal to Python users.
You clearly have never actually learned a functional programming language, because functional programming tends to make it easier to handle errors and side effects precisely because they are more contained, instead of allowing any arbitrary code to throw an exception, or having to remember to handle error codes, etc. I strongly suggest that you build a small toy program in a language like Haskell—it really does change how you approach problems, even in more mainstream, imperative languages.
> Please stop pitching garbage ideas to the rest of us realists.
trolling much!?
> It is implemented in Java, so suffers ALL of the performance issues of Java (and then some).
Uhm no. You can create native binaries or javascript code as well. I think your knowledge is from many years ago.
https://stackoverflow.com/questions/210835/what-is-referenti...
I know it's all old hat to the IntelliJ crowd, but I just don't like using an industrial IDE if I can help it. Metals lets me stick with a lightweight editor like Emacs or VSCode while keeping the great tooling that a powerful type system like Scala's enables.
I still fire up IntelliJ from time to time for certain types of mechanical refactoring, but as Metals has improved I find those cases come up less and less.
Big props to the Metals team, and thanks for all the hard work.
I've been using Scala for a few years and IntelliJ with Scala plugin has been pretty amazing for Scala use. 90% of time the suggestions it makes to fix everyday blunders (like missing imports, basic typos) are right on the mark.
Have not hit any realy pain points with sbt either. I do not want to spend time messing with configuration.
Compared to say using VS Code with Python plugin Scala development feels so much nicer that I am considering switching to PyCharm.
I'm happy with my Emacs setup, and in particular I spend a lot of time editing code in other languages as well as text docs like markdown or org. In the past, while this workflow was great for most things, I'd usually have to switch over to IntelliJ for serious scala editing. But now I don't have to any more!