Lambda Days 2020: Day 1

18 Feb 2020

Lambda Days 2020: Day 1

5 minute read

Lambda Days is a conference focused on Functional Programming, where the “academia meets industry”. The conference happens in Krakow, Poland, and this year I had the chance to attend for the first time, and share a bit of my knowledge. I’d like to say thank you to the organisation, for having me alongside a team of such remarkable names of the FP world.

As the title suggests, this post is my summary of the first day attending Lambda Days 2020.

Keynote: Functional programming for array-based parallelism by Gabriele Keller

Gabriele started the first keynote with a question: why functional programming? There are many answers, but it’s unlikely that speed and performance will figure on top of the list. Gabriele’s point was: hardware keeps involving, and parallelism is implicitly present in functional programming.

Using fold as example, Gabriele showed us how some implementations can be inefficient when executed in parallel. In other example, using Parallel Map, she discussed the advantages of using data strucutures that properly exploit the power of GPUs.

We need to provide developers with parallel structures

She made another important point about the importance of how the user view relate to the concrete representation of such structures. At the very end, Gabriele demonstrated how the use of parallelism can be specialy useful for simulations.

Keynote: Functional Programming for Hardware Design: The Good, The Bad, The Ugly by Carl Seger

Carl told us about his time working for Intel. To make the work with circuits easier, he build VossII, a software suite for describing, visualising, analysing and proving properties about integrated circuits. In order to describe circuits and its properties, the software makes use of a functional language called fl.

When you build a circuit, visualization is something you really want

The talk was a report about Carl’s experience to implement the solution, how it was cumbersome at the beginning due to previous tools, and after proper start using VossII, how much easier it was to formally verificate assumptions, once having a symbolic spec.

Carl demoed these ideas, showing some fl code and building a few specs, among the examples, a DSL for time series and another one for functions. He then revealed that VossII is now open source.

At the end I had the chance to ask him about how hard was to implement such an useful solution inside the company. His answer didn’t surprise me: “I had to fight for it every day”.

ArKi-KV : Abusing Tagless-Final Approach to build Key-Value store by Sandeep Virdi

Sandeep presented how he built a Key-Value Store in Scala, using Tagless Final and Cats Effect.

His implementation is a LSM tree, therefore he showed us how it works and some of the problems. One of the most serious is that performance degrades as one keep adding more components to the tree.

Tuning LSM trees is tricky

We learned about how the read path can be optimized using such structure. Sandeep spoke about Bloom filters and the challenges of implementing partitioning, horizontally and vertically. When talking about I/O, he mentioned some interesting issues with Mmap on JVM.

Between the lessons learnt, he highlighted the importance of effects hierarchy and the parametric reasoning brought by Tagless Final.

Slides available here

Nix - the functional package manager by Piotr Gaczkowski

Like Piotr said himself, his talk was Nix for beginners. First we had a discussion about the huge amount of package managers we have out there, supporting languages (pip, rubygems) or the operational system (apt, brew).

Package management is hard

Piotr gave us an overview about Nix, making a clear distinction between the four main elements of its ecossystem: Nix lang, Nix cli, Nix Packages and NixOS. Among the advantages of using the tool, I would highlight that’s great for multi user environments, local versioning of the env and the remote packages.

I found this talk an excelent introduction to the tool. Even though I already knew about Nix, at the end I learnt something new: Lorri, a nix-shell replacement for project development!

Slides available here

Category Theory as a Tool for Thought by Daniel Beskin

This is the sort of talk that demands a lot of attention to follow, due to the advanced level of knowledge in category theory it requires. I don’t have many notes because of that, but I would call it a class in category theory that moved between categories quite fast. I hope the organisation recorded this one, I would like to watch it again :)

A tool to derive an idea from another idea

PaSe: An Extensible and Inspectable DSL for Micro-Animations by Ruben Pieters

Ruben presented his project PaSe, a Haskell library for expressing 2D animations compositionally. The name comes from its two main concepts: Parallel and Sequential composition.

His talk was a step-by-step introduction to the tool, with nice examples. It was a short talk, and one of my favourites of the day.

A DSL for fluorescence microscopy by Birthe van den Berg

Another short and awesome talk. Birthe is a biologist that works with microscopy, studying fluorescence. The equipment used to do her job is expensive, technically complex and there is little safe control to operate. So, she wrote a system in Haskell to solve the problem!

Birthe’s solution is a DSL that makes it easier to control hardware, like light source, camera and laser beans, making a better use of it. The software is modular, extensible and easy to use.

A system which can learn from scientists and vice versa

Keynote: How to specify it! A guide to writing properties of pure functions by John Hughes

The Keynote closing the first day was delivered by John Hughes, starting with a discussion about how useful unit tests actually are, followed by how much more effective property based tests are… and how they can fail as well.

Using QuickCheck to build some examples, John presented five sistematic ways of how to formulate tests:

  1. Is there an invariant?
  2. What is the postcondition? - “Don’t test for presence, ensure for contruction”
  3. Metamorphic properties
  4. Inductive properties
  5. Model based properties
Don’t think, test!

Having all of them in place, John questioned the effectiveness of a property, comparing the number of bugs missed for every category. Looking at the numbers, the takeaway was: Focus on Model-based properties first, them Metamorphic properties - they will catch what model based can miss.

Last but not least, John (re)shared his paper about property based tests.

Great first day. I had heard about Lambda Days before, but I still was amazed by the content delivered. A big thank you to everyone that made Lambda Days such an awesome conference!