I am thinking of trying to learn this language through a project, but I am not sure what Scala is best at doing. For example, C is good for low-level projects, Python is good for AI-related projects and Go is good for network projects. Is there certain area that Scala thrives in?
I typically make a simple UI and a simple http client to learn a new language by doing one of the tasks in a language I already know and a new language I want to learn. I have looked into Laminar to make a web application or ScalaFX to make a gui, but I am not sure what the best beginner friendly library is for this language.
What are some good projects you would recommend making to a beginner in the language?
Well, it depends a bit on the ecosystem you are. But, in general, most Scala devs work on highly concurrent backend systems. So, a simple HTTP app is a good starting point.
We have a bunch of libraries for that, each more tailored to specific ecosystems: cask, http4s, smithy4s, zio-http, pekko-http, etc.
For the UI part, I have had good experiences with Laminar but I rarely work on the front-end. I do know there are also another bunch of alternatives.
Also why is Scala best used for concurrent backend systems? What does the language handle differently with concurrency that other languages do not? Again thank you for the help
First of all, note that what follows is a mix of personal opinions based on real-life experience. Thus, will I am trying to be objective, this is far from being universally true for everyone.
Second, note that the answer is actually split into two parts / levels: The base language, and the ecosystems and paradigms it allows.
At the first level, the base language provides a lot of tools that makes writing maintainable programs easier:
Strong type system
Rich stdlib
Allows using ADTs to model data
Immutability by default makes code safer with respect to concurrency
At the second level, we have two main paradigms that focus on concurrency.
Programs as Values, provided by either the typelevel ecosystem or the ZIO ecosystem.
Actor systems, provided by the Akka / Pekko ecosystem.
Thank you for the resources. Just to clarify, Programs as Values is defined as turning functions into classes and executing those classes at the end of main, right? Is there no Mutex or possibility of a deadlock if you can order the execution of those objects?