Functional Scala 2020 conference
On December 3-4, the Functional Scala conference was held, this year a fully digital edition due to the covid-19 situation. As an extra, on December 2nd, a Scala3 workshop was organised by Ziverge, free to attend for all conference visitors.
The conference started off with a digital hangout area in SpatialChat, where attendees and speakers could hang out together in various landscapes, a speaker's lounge and sponsor areas, enriched with videos, live chatter and speakers Q&A after their talks. The conference is single track, meaning you don’t have to miss anything! Below a summary of the full conference, including links to slides we found outstanding.
Wednesday: John de Goes training
Functional Scala 2020 started off with a promising day of Scala3 workshop by John de Goes. It was great to finally get some hands on experience to the new features Scala3 adds to the language. Although it was a bit slow paced (there were over 200 people attending live!), it was still interesting.
John showed us the following features:
- Optional curly braces: It will use the indentation to determine where the code block begins and ends, similar to Python. Your compiler checks that all lines have the same level of indentation, nice and clean!
- End markers: Ever seen the comment, // end of myFunction, in your codebase? This is now a language feature, you can simply write end if, end try, or end myFunction
- You can remove parentheses from an if statement if you use the new then keyword: if x > 0 then println(“x is greater than 0”)
- You can remove parentheses from a while statement if you use the keyword do: while true do { .. } (obviously you can remove the curly braces here as well).
- Enums! You can now define enums in a similar fashion as Java. The meaning however is very different, and encodes cases of a sealed trait, like in scala2, but cleaner. Obviously they can also be parameterized and used with pattern matching, and the type of an enum case is the Enum itself, making type inference much, much cleaner.
- Extension methods are now easier and cleaner to write, implicits are no longer needed. extension (e: Email) def username: String = ???
- Type classes also became more manageable. The usage of the implicit keyword in scala2 was confusing at the least, and the new keywords given and using clean up this confusion, and new functionality can easily be _derived_ with the derives keyword.
Of course there are a lot more features in Scala 3, but there wasn’t any time left. There were many people attending that did not have a lot of Scala experience so John explained more than just showing the new features.
Thursday outstanding talks:
Dmitry Karlinsky: Demystifying functional effect systems, or build your own (toy) ZIO
- Dmitry started off with the live building of a basic IO monad, called TIO (Toy IO), in which he quickly incorporated lazy evaluation, error handling and concurrency. View his slides to follow him along during his fast-paced, educational talk.
- https://www2.slideshare.net/DmitryKarlinsky1/demystifying-functional-effect-systems-in-scala/DmitryKarlinsky1/demystifying-functional-effect-systems-in-scala
Willem Vermeer: What happens in ZIO, stays in ZIO
- Unfortunately there were no slides posted by Willem, his talk was really awesome and interesting. He showed us how he built a SMTP server and client using pure ZIO. Extra points for teaching us how the SMTP protocol works.
Natan Silnitsky: Functional legacy - How to incorporate ZIO in your legacy services
- Natan showed us how to start writing pure functional code in a legacy codebase. ZIO allows for `unsafeRun` on a ZIO part that you migrated, and thus using pure functional code block in parts that cannot yet be converted (due to library or other incompatibility issues). Watch him do it in his slides, and be amazed by how simple it is to enhance your scala codebase with pure functional code.
- https://www.slideshare.net/NatanSilnitsky/function...
Alexander Ioffe: Quill, Dotty, and the awesome power of inline
- Alexander gave us a high paced, highly technical overview of his library, Quill, that is empowered massively by the upcoming Scala3 release. His type safe SQL and CQL queries can now be generated and checked at compile time. Unfortunately, we couldn’t find any slides, but his twitter is filled with examples.
- https://twitter.com/deusaquilus
Daniel Ciocirlan: What I learned from teaching Scala to 30000 engineers
- Daniel is the maintainer of RockTheJVM, where he taught over 30000 in every level of Scala programming. In his talk he gave us his takeaways on this teaching experience.
- https://rockthejvm.com
Adam Fraser: Compositional Caching
- Another new library based on ZIO is coming up, and the core contributor of ZIO, Adam Fraser, prepared a very interesting talk for us. The power of pure functional programming in ZIO itself makes creating ZIO Cache a charm. In the same composable manner in which he also worked on ZLayer and ZIO, ZIO Caching is created. We’re looking forward to using it, once it’s available.
- https://github.com/adamgfraser/compositional-cachi...
Kit Langton: Stockholm Syndrome Escape Velocity
- Kit Langton’s talk was absolutely the most entertaining talk of the whole conference. His presentation style is just really engaging and fun. His talk was about ScalaJS, and showed us how you can use it to build frontend applications using ScalaJS. So if you hate JavaScript and want to use Scala instead, that’s your way to go.
- https://www.scala-js.org/
Friday outstanding talks:
Adam Fraser (Ad-hoc substitute): Live coding with ZIO ZLayer
- Due to illness of another speaker, Adam stood in with a live coding session, chosen by the attendees ad hoc to consider ZIO’s ZLayer. Adam shows us in live scala code how to create layers, wire them together and manage layers upon layers of dependencies to your ZIO powered code.
Aiswarya Prakasan: 10 Minute Command-Line apps with ZIO CLI
- Aiswarya started her talk by showing us why CLI applications are more complex than you might think. They involve parsing the parameters for example, and usually have great autocomplete and documentation. She then showed the library ZIO CLI, which simplifies a lot of things, and the best thing is you get to use ZIO. She then demonstrated how ZIO CLI solves every problem she mentioned at the start, with code examples which can also be found in her slides.
- https://github.com/zio/zio-cli
- https://www2.slideshare.net/AiswaryaPrakasan/10-minute-command-line-apps-with-zio-cli
Sam Halliday: Try this one weird trick to take down all your HTTP servers
Sam blew my mind with this talk. He started off by showing multiple ways how you can easily crash a service just by using a simple JSON payload. A lot of services have vulnerabilities while parsing the JSON. You can add a lot of whitespace for example, or some special characters, which can cause out of memory exceptions. He then demonstrated ZIO JSON, which solves all these vulnerabilities, and is a really fast JSON parsing library.
https://github.com/zio/zio-json
All in all it was a great conference, and it was worth attending. There were many great talks, a lot of which we did not mention here, and we learned quite a lot. However it was a bit strange to attend a conference online, they still managed to keep it interactive using Discord, Zoom, and SpatialChat. Hopefully we can attend it in London next year, looking forward to it!