Feed icon 28x28
Pnwscala logo original

The Pacific Northwest Scala Conference is a regional event focusing on a wide range of Scala-related topics, and will bring together Scala enthusiasts from the Pacfic Northwest and far beyond.

Pacific Northwest Scala 2014 Schedule

November 14 - 15, 2014

( 16 available presentations )
Vlcsnap 2014 12 17 12h34m35s171 thumb
Rating: Everyone
Viewed 500 times
Recorded at: November 14, 2014
Date Posted: December 17, 2014

Rapture is a collection of libraries for everyday programming tasks like I/O, JSON & XML processing and cryptography, with a focus on beautiful, concise and intuitive code. Rapture packs a lot of power into a single line of code, and Jon will race through fifty of Rapture's smartest one-liners faster than one-a-minute, showing you how easy it is to perform everyday file and network I/O, structured data and cryptography operations, without compromising type safety. All the code in the talk will be easy for beginners to understand, but more advanced developers may also learn some new tricks, so there should be something for everyone!

Vlcsnap 2014 12 15 07h22m50s113 thumb
Rating: Everyone
Viewed 574 times
Recorded at: November 14, 2014
Date Posted: December 15, 2014

We've all seen them on the corner of our local software development neighborhoods: FP purists, shamelessly peddling scalaz to unsuspecting developers. Lured in by promises of Free Monoids, Semigroups, and Endofunctors these developers soon seem lost in throes of ecstatic coding.

To the skeptical and stubbornly practical among us, the above might ring a little true – especially if read in Rob Serling's voice. Images of gibbering horrors lurking in the depths of mathematical perfection swim before our eyes.

But what if there is true value in the world of scalaz? What if it is possible to use these tools for good (and a little bit of evil – it's fun to use learning for evil!) and profit... Without getting hopelessly lost in the opium dens of FP?

In this talk we will look at some of the "gateway drugs" of scalaz: Validation, NonEmptyList, \/, OptionT, and more. How do they work from a practical standpoint? What is their value for real world applications? And just how fun is it to *really* code with these tools?

Vlcsnap 2014 12 12 08h10m07s34 thumb
Rating: Everyone
Viewed 798 times
Recorded at: November 14, 2014
Date Posted: December 12, 2014

At first glance, the pattern matcher appears to be a mechanism merely for choosing among structural conditions of your data structures. However, scalac is much more powerful than that; many patterns have interesting type-level consequences on the other side of their associated rocketships (=>). This is a powerful tool for modeling in a functional style, as well as a source of interesting type-system bugs. We'll examine various type-level effects of patterns, how you can use them to write safer programs, and what pitfalls arise in scalac's current implementation.

Vlcsnap 2014 12 12 08h09m52s141 thumb
Rating: Everyone
Viewed 567 times
Recorded at: November 14, 2014
Date Posted: December 12, 2014

Streaming algorithms are a set of techniques for computing on data streams in which the stream of data is presented as a sequence of elements with each element only being processed once. Additionally, these methods are only allowed a constant memory footprint, independent of the size of the input stream. These constraints often lead to required tradeoffs. Solutions are often correct to a threshold, with approximations being required. Understanding the vast application of these methods and how to best integrate them into their software should be a core competency in the modern engineers toolbox.

This talk will weave together

real-world applications of streaming algorithms encountered here at Socrata,
the types and data structures (with open-source implementations in Scala) used internally to implement our streaming algorithm data pipeline,
the theory and data structures behind approximation algorithms including the popular Count-Min Sketch and HyperLogLog as well as other lesser-known techniques, and
references to and examples of integrating JVM-based implementations of these methods found in Twitter’s Algebird and Clearspring’s stream-lib into the working engineer’s data pipeline.

Vlcsnap 2014 12 12 08h10m01s230 thumb
Rating: Everyone
Viewed 2,834 times
Recorded at: November 14, 2014
Date Posted: December 12, 2014

This session introduces you to Spark by starting with something basic: Scala collections and functional data transforms. We then look at how Spark expands the functional collection concept to enable massively distributed, fast computations. The second half of the talk is for those of you who want to know the secrets to make Spark really fly for querying tabular datasets. We will dive into row vs columnar datastores and the facilities that Spark has for enabling interactive data analysis, including Spark SQL and the in-memory columnar cache. Learn why Scala's functional collections are the best foundation for working with data!

Vlcsnap 2014 12 12 08h09m46s84 thumb
Rating: Everyone
Viewed 2,052 times
Recorded at: November 14, 2014
Date Posted: December 12, 2014

In this talk we will step into Spark over Cassandra with Spark Streaming and Kafka. Then put it in the context of an event-driven Akka application for real-time delivery of meaning at high velocity. We will do this by showing how to easily integrate Apache Spark and Spark Streaming with Apache Cassandra and Apache Kafka using the Spark Cassandra Connector. All within a common use case: working with time-series data, which Cassandra excells at for data locality and speed.

Vlcsnap 2014 12 12 08h09m57s191 thumb
Rating: Everyone
Viewed 512 times
Recorded at: November 15, 2014
Date Posted: December 12, 2014

Generics are now a must-have in any statically typed programming language. Yet, there is a strong tension between the uniform interface exposed to programmers and the low level implementation, which has to deal with data of different sizes and semantics: booleans, integers, floating-point numbers and heap objects. Different languages have taken in very different paths to implementing generics, each with its own advantages and drawbacks. In Java and other JVM languages the standard is boxing primitive values, meaning that heap objects are used to carry primitive values. This leads to significant slowdowns and increased heap consumption, especially when using generic collections for primitive types.

Scala proposes specialization as an alternative to boxing: the compiler can duplicate and adapt user code for each primitive type, thus using unboxed data. Specialization has been shown to reliably speed up code and is extensively used in established community libraries, such as spire (non/spire) and breeze (scalanlp.org). But statically duplicating code can result in significant jar sizes and long compilation times. For example, specializing a 3-element tuple, which takes three type parameters, yields 1000 almost-identical classes.

In the miniboxing project we set out to reduce the static bytecode size while maintaining optimality: we build on the idea of tagged union, thus offering a single variant of the code for all primitive value types. This means the 3-element tuple can now be specialized with just 8 classes. But matching the performance of specialization was a long and convoluted journey. In this presentation I will explain the basics of miniboxing and show what we had to do to match the speed of specialized code.

The project's website, scala-miniboxing.org, contains all you need to get started: the miniboxing compiler plugin, documentation, usage examples and benchmarks.

Vlcsnap 2014 12 15 07h23m51s213 thumb
Rating: Everyone
Viewed 2,508 times
Recorded at: November 15, 2014
Date Posted: December 15, 2014

Scala has many, well-known WTF LOLs that result from the language too enthusiastically attempting to help the programmer. Scala can also be written across a wide range of styles from the Typelevel to the Better Java.

The Scala ecosystem has static analysis and linting tools which can help avoid confusing behavior, baffling compiler messages, and divergent coding styles. We'll survey the available tools, considering which can be best applied in greenfield and existing projects.

Attendees will leave with steps to immediately improve their production builds and strategies to introduce more sweeping changes with time.

Vlcsnap 2014 12 15 07h23m46s165 thumb
Rating: Everyone
Viewed 918 times
Recorded at: November 15, 2014
Date Posted: December 15, 2014

Brushfire is a framework for distributed, supervised learning of ensembles of decision trees. It is designed to be extremely scalable (both in number of observations and number of features) and extremely customizable: it makes heavy use of Scala generics and typeclasses to allow easy parameterization of each stage of the tree building algorithm. This talk will walk through the overall architecture and algorithm, then show some simple concrete examples of using Brushfire with Scalding to build trees on Hadoop.

Vlcsnap 2014 12 15 07h23m27s225 thumb
Rating: Everyone
Viewed 517 times
Recorded at: November 15, 2014
Date Posted: December 15, 2014

Programming in Scala, by Martin Odersky et al., is one of the most comprehensive and the de facto reference for Scala.

However, the book, originally published in 2008 for Scala 2.7.2, has not been updated since its second edition in 2010, covering up until Scala 2.8.1. In the meantime, Scala had 3 major releases with numerous fresh and advanced features.

While we wait for a third edition of Programming in Scala to describe all the latest and greatest Scala features introduced in the last 4 years, this talk presents the main features introduced in Scala 2.9, 2.10, and 2.11:

Parallel collections
Value classes, implicit classes, and extension methods
String interpolation
Futures and Promises
Akka actors
Macros and quasiquotes
Reflection
Modularization
Dynamic types
Error handling with Try
The App trait
New methods in collections
Case classes with more than 22 parameters
Predef.???
sbt incremental compilation
2.12 and beyond: what's in Scala future?

Vlcsnap 2014 12 15 07h23m30s254 thumb
Rating: Everyone
Viewed 665 times
Recorded at: November 15, 2014
Date Posted:

How do three people build a scalable backend in a language only one has ever used before in just three months? By getting something else to do the heavy lifting.

When Conspire graduated from TechStars and began planning our revamped product, we knew we needed a backend that was resilient, scalable and simple to understand. I was the company’s first hire and the only person on the team with any Scala experience but I convinced them to go with Akka and Scala. In roughly four months, we built exactly the backend we envisioned.

That system has been in production for over a year. I'll discuss the challenges we faced with Scala and Akka and the lessons we've learned as we adapt our system to the changing needs of the business. Most importantly, I'll talk about what we did wrong and how we're addressing those issues going forward. (Bonus: the story of how our cluster crashed and burned the first time we put it into production!)

Vlcsnap 2014 12 15 07h23m20s154 thumb
Rating: Everyone
Viewed 458 times
Recorded at: November 15, 2014
Date Posted: December 15, 2014

This talk will explore the hands-on beginner experience of making things with Scala.js. In particular, it will cover a few topics:

How to make a standalone Scala.js single-page web app
How to make and publish a cross-platform (JS/JVM) Scala library
How to make a client-server Scala.js website with shared code
Each topic will take 25 minutes, and will take you through the entire process from "clone this repo from Github" to "complete, usable project". By the end of this, anyone who's familiar with both Scala and web-dev should be ready to begin cranking out their next project in Scala.js, whatever that may be.

Bring your computers with SBT and IDEs ready to follow along!

Vlcsnap 2014 12 15 07h23m23s183 thumb
Rating: Everyone
Viewed 417 times
Recorded at: November 15, 2014
Date Posted: December 15, 2014

If computers are supposed to be good at math, then why is it so hard to do math correctly with computers? We have trained programmers to reach for floating point types, and to deal with the fallout using some combination of profanity, resignation, and numerical analysis.

We will explore alternatives, focusing on computable real numbers as implemented in Spire, as well as discussing alternatives such as Algebraic numbers and Continued fractions. The focus will be on practical use cases, as well as the benefits of laziness and functional programming when implementing and using these exotic types.

Vlcsnap 2014 12 15 07h23m37s71 thumb
Rating: Everyone
Viewed 655 times
Recorded at: November 15, 2014
Date Posted: December 15, 2014

Aren't you tired of just nodding along when your friends starts talking about morphisms? Do you feel left out when your coworkers discuss a coproduct endofunctor? From the dark corners of mathematics to a programming language near you, category theory offers a compact but powerful set of tools to build and reason about programs. What's a category? What's a functor? This talks aims to present the basic concepts and why they matter to everyday coding.

Next time, you too can be the soul of the party and impress your friends with category theory!*

*(results may vary)

Vlcsnap 2014 12 15 07h23m33s32 thumb
Rating: Everyone
Viewed 1,107 times
Recorded at: November 16, 2014
Date Posted: December 15, 2014

Here at Whitepages, we are redesigning a search system that must execute tasks concurrently, while providing smart flow-control and recovery in the presence of failures.

We need a nuanced handling of errors for a variety of failure modes, which standard Futures alone do not provide. The system must also support timeouts at multiple levels in a way that allows recovery of useful information. Furthermore, the plan definition code must be clear, concise, and correct.

In order to achieve the above goals in a functional and type-safe manner, we need a new, powerful abstraction. We decided to build a new future for ourselves! We would very much like to talk about our experience using and adapting Scalaz and Shapeless to implement functional, multi-faceted error handling of concurrent tasks.

Vlcsnap 2014 12 15 07h23m41s111 thumb
Rating: Everyone
Viewed 1,073 times
Recorded at: November 16, 2014
Date Posted:

SBT 0.13.5 introduced AutoPlugins as the future of SBT plugin development. AutoPlugins provide interesting features that simplify plugin development while enabling exciting new possibilities for plugin composition. At the Allen Institute for Artificial Intelligence, we are composing some core AutoPlugins into "Archetype" plugins for Library, CLI, WebService, and WebApplication projects. This strategy has proven to greatly simplify our SBT builds while enforcing consistency across projects (something we value very much at AI2!).