Noel Walsh argues that Scala has a reputation as a complex language, but that it doesn’t need to be complicated. There are six core topics he believes are essential for learning Scala, but focused on three of them: Algebraic Data Types (ADT), Structural Recursion, and Sequencing Computations. ADTs are the combination of case classes and traits that allows us to model data as logical ands and logical ors. Structural recursion refers to the transformation of ADTs, and can be implemented with pattern matching or polymorphism. Sequencing computations refers to transforming values via functional programming, primarily relying on fold, map and flatMap. Noel asserts that these three patterns represent 90% of Scala code.
Evan Chan gave a presentation full of practical tips for building a production system that uses Akka. He found that in production that the Actor model was easier to understand than a Futures-based model, but that a simpler linear data flow through actors is easier to understand than a more complex arrangement. One issue with Akka applications is that stack traces are often useless. His solution is to stack a trait on an actor that sends message identity information to a collector along with identities of the current actor and the sending actor for later analysis.
Michael Nash presented the results of a comparison test where the same Akka/HTTP application was load tested using a CRUD-style backend and a CQRS/ES backend. They found that the CQRS/ES backend could handle substantially higher load with a more consistent response time without increasing complexity of the application code. However, they also found that tuning was far more important to the CQRS/ES backend than the CRUD backend, suggesting that it may be easy to miss out on the performance benefits.
Grzegorz Kossakowski discussed measures that the Scala team is taking to improve their ability to add new features to the language while not sacrificing stability. Tools and automation are essential to minimize the time to get feedback on a proposed change to the language. One aspect of this is automating pull request validation with Jenkins. Another aspect is a project called Dbuild, which is a build performed every night with 80+ community projects. This build allows the Scala team to find subtle bugs much quicker than they would without automation. Finally, he presented statistics indicating that the community outside of EPFL and Typesafe are more involved in Scala 2.11 than they were in 2.10, as measured by commits and number of committers.
Rex Kerr presented his solution for performing data validation that allows him to focus on transformation rather than handling errors, but still captures errors that occur at runtime and provides good performance when processing large datasets. One essential piece of this solution is replacing exception throwing with stack-less exceptions using the key pattern. The key pattern requires the caller to handle possible errors while avoiding the performance penalty of throwing exceptions.
Roland Kuhn gave an update on the latest in Akka HTTP, gave a tutorial on Akka Streams, and demonstrated a scenario where backpressure in Akka HTTP allows the rate of a file upload to be regulated. Much of the content in this presentation is in the live demos, however, so watch for the recording to become available.
Brendan McAdams gives a very practical introduction to disjunction and validation in scalaz along with examples of how they overcome limitations in Either and Option.