Scale By the Bay Scale By the Bay

functional

Thursday, October 28, 2021

- PDT
Solving the Rubik's Cube with Group Theory
Stewart Stewart
Stewart Stewart
Mission Lane, Principal Engineer

We've heard all about Monoids, but have you thought about Groups? Group theory has numerous applications in diverse fields, yet the group typeclass usually receives only a passing mention in connection with monoids. As it turns out, groups can be a powerful tool for reasoning about transformations of state.

In this talk, we'll approach group theory from an intuitive angle. We'll learn about the `Group` typeclass and permutations, then see see how theory and functional programming combine to inform the development of a DSL for solving the Rubik's Cube. The presentation will feature live coding and conclude with a demonstration of such a solution using a bluetooth enabled Rubik's Cube. It is my hope that you'll leave with an increased appreciation for the symbiosis between math and FP when it comes to problem-solving, and be able to spot use cases for groups in future problems.

- PDT
Lessons Learned from 15 Years of Scala in the Wild
Dean Wampler
Dean Wampler
Domino Data Lab, Principal Software Engineer

Scala 3 was introduced earlier this year. It introduced significant changes to the language, many of which were motivated by the lessons learned from the past 15 or so years of actual use in many open-source and commercial applications.

I'll explore these lessons and how Scala 3 addresses them. Many revolve around the pros and cons of implicits. Also, changes to the type system make it more "regular", robust, and expressive. Finally, the new, optional, and controversial "Python-like" syntax promotes even more brevity. It also acknowledges how influential and pervasive Python has become across our industry.

But there are areas where future work is required, many of which are arguably outside the scope of Scala itself. We still live in "dependency hell". We still use too many obsolete idioms that hide accidental complexity, rather than forcing us to fix it. What should we do about these issues?

- PDT
Shape safety in tensor programming is easy for a theorem prover
Peng Cheng
Peng Cheng
Schedule One, Lead Engineer

We present shapesafe (https://github.com/tribbloid/shapesafe) - the most comprehensive compile-time verifier for scala linear algebra - by only exploiting scala's type system as a theorem prover. This new paradigm allows type-level tensor computations, even those as complex as composite neural network blocks, to be rewritten, simplified and verified while being written. We will talk about its design and limitations, and most important, what we have observed and learned from it

- PDT
Advanced Features of Scala 3
Bill Venners
Bill Venners
Artima Software, President

Scala 3 has a lot of new, advanced features. This talk will give you an overview of these features so you will know what is available. We will cover features such as macros, opaque types, type lambdas, dependent function types, polymorphic function types, match types, compile-time operations, and more.

- PDT
Algebraic Data Types, Categorically
Vlad Patryshev
Vlad Patryshev
machinify.com, engineer

To understand what we are dealing with when we have ADT, one needs to get a bit deeper into Lawvere theories. Then things become clearer. To see how ADT are models of Lawvere theories, one needs some (not very deep) dive into categories (and free algebras). In this talk I'll try to explain all this in an as clear way as possible.

- PDT
Distributed Systems with Swift
Konrad Malawski
Konrad Malawski
Apple, Senior Engineer

Swift is a fast, safe and expressive modern general purpose programming language. One of Swift’s primary goals is to make code simpler to read, write and maintain. As more developers face the need to develop highly distributed, concurrent applications, our goal is to scale the language and library ecosystem to meet those needs.

With its rich language features, such as built-in extensible serialization mechanisms, as well as structured and actor-based concurrency, Swift is a perfect match for modern distributed systems development. In this talk we’ll explore some of the specific approaches and techniques we can make use of to build awesome, and reusable, distributed systems in Swift.

Friday, October 29, 2021

- PDT
Troubleshooting Techniques for Complex Codebases
Anatolii Kmetiuk
Anatolii Kmetiuk
EPFL, Software Engineer

Fixing issues in Scala 3 compiler codebase is hard. One part of it is, given an issue, to understand why it is happening, what in the codebase causes it. And this task is complicated because the compiler is big and complex. The challenge here is navigation and awareness of what's going on in the code.

To my experience, having the right setup makes a huge difference when doing pretty much any task. Abraham Lincoln is quoted with the following: "If I only had an hour to chop down a tree, I would spend the first 45 minutes sharpening my axe."

Over the last years, I spent some time thinking and playing with different setups to allow getting yourself to a root cause of an issue fast through the codebase. In this talk, I'd like to present what techniques reduce overhead when reproducing the issues and navigating the compiler codebase to trace them.

- PDT
Functional streams for factorians
Kévin Rauscher
Kévin Rauscher
Tomahna, Senior Scala developper

Crashed on an alien planet, surrounded by a horde of biters, you are left alone against all with only your functional programming knowledge. Will you be able to use it to create the industry that will allow you to escape ?

In this beginners talk, you will learn about FS2 a functional stream library in scala using examples based on factorio. We will cover the basics of streams and more complex examples illustrated by the game.

- PDT
Next Generation of Scala
Adam Fraser
Adam Fraser
Ziverge, Co-founder, Solution Architect

For the last 10 years, developers in the Scala community have been exploring solutions based on concepts from functional programming. But so far these ideas have had a limited impact on programming "in the large" at most companies. In this talk, we'll discuss why that is and how a rapidly growing framework for writing cloud-native applications called ZIO may be changing that. If you haven't looked at Scala recently this is the perfect time to see what you have been missing!

- PDT
Distributed Tracing with Swift
Tim Condon
Tim Condon
Broken Hands, Founder

Large applications invariably involve complexity somewhere. One solution to managing this complexity is to split the application up into small microservices. However debugging errors and problems with microservices can be difficult without the right tools. In this talk we’ll cover the basics of distributed tracing and why we might want to use it. We’ll cover how to implement it in Swift and see how some of the upcoming concurrency language features make this even easier.

- PDT
Single-Serving Values with Linear Types in Scala
James Douglas
James Douglas
Reonomy, Director of Data Engineering

Have you ever had a program try to read a file after the handle had been closed, or query a database after the transaction had been committed? How about shadow a variable and accidentally use the wrong one?

Linear types require that values are used once and only once. In this talk, we learn about how linear types can be used in Scala programs to prevent runtime errors like these by detecting them at compile time.

We begin with some motivating examples before diving into what linear types are and how to implement them in Scala. We then introduce linear types as a substructural type system, and touch on implementations in Rust and Haskell. Next, we see how Scalafix can be used to extend the Scala compiler through custom linting rules. Finally, we look at a linear types implementation in Scala using Scalafix, and apply it to the real-world examples we started with.

Attendees will leave this talk with a new tool in their functional programming toolbox that they can start using to solve real-world problems.

- PDT
What I Learned about FP when Writing a Book About It
Sergei Winitzki
Sergei Winitzki
Workday, Senior Software Engineer

Why did I decide to write another book on functional programming, given that there are already many books on that topic? I will describe the motivations and the approach I chose. Working on this book has been a journey of discovery as I embarked on deriving everything in functional programming from scratch - no stones left unturned and no claims taken on faith. The final arbiter is practical working code, not appeals to mathematical mystique or academic authority. I encountered a number of surprises and found a new perspective on the scope of a theory that is necessary for practical functional programming.

- PDT
Retrofit your Java App with a Reactive Flow Pipeline
Mary Grygleski
Mary Grygleski
IBM, Developer Advocate
Fabio Tiriticco
Fabio Tiriticco
Fontem Ventures B.V., Software Engineer

Legacy applications that were developed in bygone days may appear to be close to unsalvageable. In reality, these applications are still running in production and carrying out the important day-to-day missions for their respective companies. After all, companies have spent a considerable amount of time and money on developing those applications, and despite the lack of perfection, these applications nonetheless keep their companies in operation. So does it make sense for an entire legacy application to be re-written? Keep in mind that the implementation of certain business functionality can be a daunting task for the busy developers. How about if we redesign the system, and identify pieces of the complex business functionality in the legacy system that can potentially be "recycled", and retrofit them into the new system that leverages on the power of the reactive data flow pipeline?

This presentation will be a lively discussion with hands-on coding to illustrate how to construct a reactive, event-driven data flow pipeline, which are composed of different library implementations of the Reactive Streams specification, such as Akka Streams, Eclipse Vert.x and RxJava. The sample use case will mimic a real-life example of data being collected from multiple distributed sources, which will then be fed to a legacy processor as "wrapped" by a reactive microservice for transformation, after which the resulting data will flow to a "sink" to be prepared for further processing. We will highlight the strength of the Reactive Streams in controlling backpressure during processing.

- PDT
Functional Programming + Dependent Types ≡ Verified Linear Algebra
Ryan Orendorff
Ryan Orendorff
Facebook, Research Scientist

Linear algebra is the backbone of many critical algorithms such as self driving cars and machine learning. Modern tooling makes it easy to program with linear algebra, but the resulting code is prone to bugs from index mismatches and improperly defined matrices.

In this talk, we will formalize basic linear algebra operations by representing a matrix as a function from one vector space to another. This "matrix-free" construction will enable us to prove basic properties about linear algebra; from this base, we will show a framework for formulating optimization problems that is correct by construction, meaning that it will be impossible to represent improperly formed matrices. We will compare the Agda framework to similar frameworks written in Python and in dependently typed Haskell, and demonstrate proving properties about neural networks using this framework.