Scala Italy 2019

Scala Italy is the Italian conference of the Scala Language now to the 7th edition – a time to meet old friends, to make new friends, to talk about programming and to attend high-quality speech about the Scala language.
This year, following the tradition, started in 2018 🙂 the conference lasted two full days.
Conference videos are published in this Vimeo channel.

Demographics

By a very rough approximation, I counted about one hundred people, organizers included. While headcount went down (last year we were about 150), the average age went up. Still not at C++ conferences level, but the number of baby programmers was quite low. Also, the female percentage was very low (on par with C++ conferences).

Maybe Scala is leaving the phase of enthusiast early adopters (usually young programmers, still in contestation years, with a lot of time, curiosity and energy to invest in something new) and going toward being something too solid and usable to be used for disputing the establishment.
This isn’t too bad and possibly a sign of maturity. Even the content of some talks of the conference seems to confirm this idea.

But I am more inclined to think that the scarce affluence is more about the split nature of the conference. Is this something appealing to personal interest, open to hobbyists, amateurs or programmers with some spare time to deepen their interest? Well the weekend time is good, but the price must be much lower, also you can do with a more modest location and save something on the food. Conversely, a conference targeted to professionals, is fine on workdays, the ticket price is right, but companies have to be more involved – more stands, more we’re-hiring, some success stories, and maybe some company promotional talks.
Also notable is that about half of the participants were at their first Scala Italy. Having new people is very good, but losing old attendees is not. I am not sure why it is like this, maybe the organizers with their feedback poll could figure it out.

Stands

There were only two stands – Vodafone and Bitrock (ex Databiz). Bitrock is a contractor company looking both for new customers and new hires. Vodafone was mainly there for headhunting and self-promotion. The gadgets were diverse but were looted almost completely at the end of the first day.
Since my company is hiring I prepared a couple of notices to stick somewhere. I hoped for a board to hang similar notes, but I couldn’t find it. When I asked, the reply was that only the sponsor could do that or speakers could insert short hiring notices in their talk.
I understand the intent, but I think it is a restriction that is taking away something from the community – sharing information, hiring announcements included is at the very core of a community.

Food&Location

Bologna is a peculiar city for many aspects. Downtown is old, with plenty of palaces, churches, and towers all from the Renaissance era. Streets are sided by traditional porches. It is worth spending some time wandering around to feel the city.
Speaking of taste, Bologna has a strong tradition of Italian food, some of the most famous Italian dishes are from Bologna – pasta al ragu and lasagne, just to name the first two that come to mind.
And speaking about mind, Bologna hosts if not the most ancient and still operating University, for sure one of the most ancient.
The location chosen was an old theatre (the building is quite old and the theatre opened at the beginning of the 19 century) in Bologna – the Duse.
Before coming to the conference I was a little dubious about the location – a theatre seemed to lack the spaces needed for networking and likely the site couldn’t host multiple tracks. In fact, the track was single, but for the rest, I was pretty wrong – the bar and courtyard offered enough space for all the needs of the attendees – networking, eating and relaxing.
There was plenty of food (included cookies and croissants during breaks) and lunches were rich in assortment and taste.
I didn’t go to the community party so I can’t comment on it.

Tracks – Day 1

Functional Object-Oriented Imperative Scala

SĂ©bastien Doeraene
Scala Center
video

SĂ©bastien followed Heather Miller at the helm of Scala Center, about one year ago. In this talk, he argued for a more relaxed approach toward OO and imperative approach. His main point was that if the interface is pure functional, you may write the implementation using your preferred paradigm (or the one more suitable to solve that specific problem).
I agree at large, but some of his examples were a bit stretched. I mean using a while loop instead of a zip could cut the performances of two orders of magnitude. But considering functions to access filesystem objects as pure functions seems a bit dangerous.
Anyway, it takes some courage to make these claims in a functional programmer lair like this. And I am happy that someone stands up for the value of OO and imperative paradigm. Nothing to take away from functional, but it would be a pity to dismiss these paradigms as obsolete and useless.

A Tour of Functional programming

John A. De Goes

Amidst the polemics about his person not been welcome in part of the Scala community, John De Goes proved to be a great speaker presenting a very interesting talk. His talk was somewhat on the opposite side of SĂ©bastien’s position during the previous hour. John argued that the evolution in programming paradigms led us to functional programming and that the next step is declarative programming.
I found the talk very inspiring, and John was very good at conveying the idea about structure, architecture and the richness coming from a compact representation that can solve an incredible amount of problems. Algebras are really a way to describe the structure of a problem letting the programmer solving a general problem.
Also, John stressed the point that functional programming and imperative programming are orthogonal concepts that do not clash.
The running example was a simple service that responds to an HTTP request by looking up a DB. The solution is improved step by step going from structured, functional and eventually to declarative.
In declarative programming, you lay out the information flow declaring what has to be done on which event and then let the declaration to be executed.
Declarative is not easier, at least, at first sight, to write and read, but it allows a great degree of freedom in decomposition and flexibility.
If you are new to FP and you have to watch only one speech from this conference, this is the one to watch.

Integrating Developer Experiences – Build Server Protocol and beyond

Justin Kaeser @ebenwert
JetBrains
This video is from another conference, but it is basically the same presentation
This blog post is the content of the presentation.

Justin works at JetBrains and in this speech talks about his experience in designing and implementing the Build Server Protocol. Stemming from Language Server Protocol the BSP aims at simplifying the integration of IDE and Build Tools by providing concepts missing in LSP.
BSP is being integrated into fury and sbt.

Side-effects within the Business logic core

Filippo Vitale
Netscout

In his speech Filippo analyzed and described object mock up for testing purposes. His approach was very practical showing how reducing dependecies simplifies testing.

Mocks are invaluable to test effects, but they increase the coupling between test and code and for this reason they are usually hard to maintain.

His advice about the cost of abstraction is very valuable and too often overlooked: given a choice of solutions pick the least powerful solution capable of solving your problem.

Endpoints — A quest for the right level of coupling

Julien Richard-Foy
Scala Center
video slides

When moving from a monolithic approach to a distributed system you gain in scalability, but lose in simplicity. More precisely every distributed function call yields a Future[T] rather than a simple T.
In this talk, Julien analyzes several ways to a couple of distributed components together. Along the way, the listener will be provided with examples and lists about the strengths and weaknesses of each solution.
Although there is no silver bullet, gRPC wins many points. The final example is about using metaprogramming to define endpoints. Despite the lacking of tools, this is the one chosen by the speaker.

Pragmatic Object-Oriented Tagless final

Wojtek Pituła @ Sony Electronics // @Krever01
video slides

If you, like me, are an old school programmer who learned the Craft with imperative languages and later with OO concepts, you may be quite lost when these youngsters talk about monads, algebras, and whatnot.
With some patience and by picking the right source you can quite easily conquer the monad concept. Once you are comfortable with flatMap and identity, those little devils start talking about shapeless, tagless and final… that’s not the final you were used to, but something completely different.
In this talk, Wojtek tries to shed some light on these concepts. The presentation was really good, but in the end, I felt like being just one bit away from the final understanding. Anyway I reckon that it would be enough to watch the talk once more to eventually grasp the tagless final concept.

Mind the Heap – techniques for allocation free programming in Scala

Zahari Dichev

When Sun started its promotional campaign for Java, the idea of a general-purpose interpreted language on a virtual machine didn’t conquer every programmer’s hearth. Java had the drawbacks of compiled languages (it has to be compiled) and the drawbacks of interpreted languages (lack of performances). Sun worked hard both technically and marketingly to overcome the performance problem. Although many improvements have been achieved on the JVM in these years, the garbage collector is still there to hamper the performance.
Scala increases the abstraction level and hides implementation details further away from the programmer, speed goes down and memory consumption goes up, invoking the garbage collector more often causing the program to behave non-deterministically.
Now when you are in the OO realm, the garbage collector problem may be solved by using object pools. You allocate statically a number of objects and then manage manually allocation and deallocation of such objects. Once an object is deallocated it gets recycled for reuse.
But… but in FP objects are immutable, you can’t recycle unless you need an object with exactly the same values.
Zahari shows some pattern where it is not so easy to spot extra object allocations and eventually proposes to use the “unsafe” interface – a somewhat unsupported Java interface to access chunks of memory bypassing the GC.
The drawback is that the memory allocated in this way is untyped, so its use must be carefully planned so that it could spare the creation of objects for real. Also, unsafe is completely managed by the programmer who has to writes her/his allocation management code.

The talk is clear and detailed. And if you are forced to be constrained in the JVM it is very useful. On the other hand, from a pragmatic point of view, I think that when you need to go this way it is likely that you have picked the wrong tool. An old design principle for interpreted language is to move complex operation in native code and have them executed by a single interpreted instruction. This design still holds, and by using JNI can be applied proficiently in Scala.

Tracks – Day 2

Tour of Scala 3

Martin Odersky
video slides

Martin needs no presentation at all for everyone involved in Scala, for those who aren’t, Martin is the designer of Scala Language. In this talk, he presents all the new features of the upcoming Scala 3. The presentation has the format “the 3 best new feature for X” where X are beginners, everyday programmers and library developers.
The talk has been interesting, but not that exciting. I appreciate the courage that it takes to deem some feature of the current language version as problematic or incomplete, but I am not so easy at the idea to solve the problems by creating a new language incompatible with Scala2.
Although the last line is formally true, it sounds a little harsh. In fact, the new language is strongly based on the old one and many lines will compile without change. But I come from the C/C++ church where even the smallest incompatibility is weighted and ruminated over and over by the ISO committee until all (and I mean all) the stakeholders agree on the change or agree to dump it (usually to dump it).
Sure Scala has a stricter semantic than C++ and possibly automated translation tools could perform better, but I am dubious that they can do all the translation with no human help at all.
Anyway, I found the new features that were presented very interesting. Fewer limitations (no need for ‘new’, all kinds of objects can be declared at the top-level). More features (enums, union types, postconditions). Refinements (implicits replaced by extension methods and given constructs).

Regardless of the changes in the syntax, Martin ensures that binary compatibility will be preserved thanks to the Tasty format. I guess it is true for components with simple interfaces or at least with interfaces that do not sports new features.

Anyway the talk is worth watching if you are interested in where the Scalaverse is going.

Akka Persistence Typed

Renato Cavalcanti – Lightbend
@renatocaval

In this talk, Renato (who, as he hurried to point out, is not Italian) presented the persistence for typed actors, i.e. the last incarnation of Akka actors.
The persistence for Actors is mainly used for event sourcing, i.e. bringing actors in the very same state they were before a crash/power cycle/shutdown.
The idea is simple – save every event received from the actor and then play them back on restart.
I lost myself somewhere in taking notes, so I can’t report much on this. (One of my notes, though was “Yet another example where money amount is stored using a Double.” Now, that’s Wrong.)

Overall Akka typed seems to address all the flaws of Akka vanilla actors and the Akka typed persistence seems something that you can easily study yourself when you need it.

Flawless testing for the functional folks

Jakub Kozłowski
Ocado Technology
slides

In Scala, we are used to testing frameworks that usually provide their own (obscure) DSL to define tests and their relationship. Jakub wants to tackle testing with a different take. He proposes to use purely functional approach and let all the tests run without stopping at the first failure.

The advantages of functional testing are basically the same of the functional code – more predictability and composability. The speaker is the author of flawless a functional testing library similar to ZIOtest.

At this point, I had to leave the conference (for an “objective problem”) to return home. In doing so I missed the last four talks – “Rock your Scala editor with Metals” by Gabriele Petronella, “Scio – Data Processing at Spotify” by Neville Li, “Building RPC microservices with mu” by Fede FernĂ ndez and “Composable concurrency with Ref + Deferred” by Fabio Labella.

Personal thoughts

As written at the beginning I found this Scala Italy edition very enjoyable and exciting, with high-quality talks and brilliant speakers. I hope for some more people to attend, with some less turnover. And possibly some more sponsor/exhibitor booths.

The Scalaverse, at least judging from this event is still developing and full of unrest energy. There are people doing real world stuff in Scala and people exploring language potentiality and evolution. The Italian community is somewhat uncertain, many people are interested, but I am afraid that the huge turnover at Scala Italy means that as many people consider Scala just in the explorative phase and not as a tool to be employed in their everyday work.

Finally kudos to the organization, I found it very professional and capable of setting up a great conference. None of the problems of the past editions affected Scala Italy 2019.

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.