Wrocław Scala User Group - first meetup
In this post I want to share a short recap of first Wrocław Scala User Group (WSUG) meetup. This will be kind of TIL entry, it doesn’t aim to cover the full presentation content. You can find the full agenda at the event page. If you’d like to join the next meeting, join us at Wroclaw Scala User Group at meetup.com.
This is my second post in #100DaysToOffload.
First talk - Scala CLI - what’s the new Scala runner capable of? by Łuksz Wroński lwronski
This talk was strictly focused on scala-cli, a great command line utility for working with Scala. I’ve already introduced it in some of my articles (e.g. refined). If you’re not familiar with the tool, I strongly recommend visiting the getting started page, the documentation is really good and there’s no point rewriting it here.
In this talk Łukasz has focused on introducing the tool. Being already the active user of
scala-cli the most notable things I’ve taken from the presentation are:
There are multiple use cases for
- Education - the tool is used to teach, some universities like AGH use it for their courses
- Prototyping / experimenting - it’s getting very popular e.g. when you want to reproduce and report bugs
- Scripting - the most notable advantage over Ammonite is the flexibility when it comes to changing settings and language versions
- Single-module projects - you can start with zero configuration. when you work on a single project you don’t need to bother about the build tool. Once your project matures, you can always export the project
Things I didn’t know
You can execute the code from stdin like this:
echo 'println("Hello")' | scala-cli -
But you can also go with
echo 'println("Hello")' | scala-cli _.sc # this will execute the input as scala script echo 'println("Hello")' | scala-cli _.scala # this will execute the input as scala program, meaning you need an object with main class
Second talk - Say goodbye to implicits - contextual abstractions in Scala 3 by Magda Stożek magdzikk
In this talk, Magda told us about the
implicits and her learning journey. It was inspiring to see the road from struggling to learn implicits (how usual when learning Scala) to giving a talk about it on the meetup.
During the talk we have learned how the language is evolving in terms of contextual abstractions.
The key takeaway from the talk is that with Scala 3 you express your intention instead of just applying the mechanics.
Using implicits in Scala 2 means applying kind of patterns for implementing things like type classes, syntaxes, providing context etc. To understand the code you need to be familiar with those patterns. This is one of th reasons Scala might be difficult to learn for the newcomers.
Scala 3 attempts to make things easier by providing constructs like
extension and changing the way we import context abstractions.